# GF9: Custom ebuilds and keeping rsync from removing them

## pjp

Navigation: [Gentoo Fundamentals] [Table of Contents]

How can I create custom ebuilds that portage will find and that don't get deleted when resyncing?

Add the line PORTDIR_OVERLAY=/usr/local/portage to /etc/make.conf and place your ebuilds there. Use the directory structure and folder names from the official portage directory in /usr/portage/ for your packages. That is, you should create a directory structure such as

```
$PORTDIR_OVERLAY/category/package/
```

 and put your ebuild package-version.ebuild there. Portage will otherwise complain with a "not a valid PORTDIR heirarchy" [sic] error message. Once you're confident your ebuild script works, submit it for inclusion here.

2006-06-02: Directory structure updates.  --kallamej

----------

