Writing ebuilds for Gentoo – my experiences
Being new to the Gentoo world, I had to quickly write a few ebuilds. This process is reasonably well documented in Ebuild howto and wiki, however, some issues are not very clear.
Here’s what wasn’t obvious to me:
- Installing packages using ebuild and a full path to your ebuild doesn’t work (from the man-page: The implementation of emerge /path/to/ebuild is broken and so this syntax shouldn’t be used).
- In this case, to install your package you should probably create PORTDIR_OVERLAY in /etc/make.conf (e.g.,
PORTDIR_OVERLAY="/usr/local/portage", see this wiki page). - Your package has to be in one of the predefined categories. If you come up with something new, Portage will happily ignore it.
- Before emerging, you should recompute the digest of your package using
emerge /path/to/ebuild digestcommand. - It seems that from within the package, it is difficult to distinguish whether the package is being installed for the first time vs. updated and updated vs. removed. For this, I wrote a hack, which I documented in my blog.
December 18th, 2005 at 12:34 am
I am getting started writing ebuilds and came accross the same issues, I want to add a catagory for cad
I am having a bit of a problem with it not being able to find my configure file, I think because it is in a subdirectory. Do you have any advice about that?
when the tar expands it puts things in /var/tmp/portage/opencascade-5.2/work inside work is the subdirectory ros that has the configure file and a src direcory that contais the source
December 22nd, 2005 at 4:25 pm
Well, looking at the source
/usr/lib/portage/bin/ebuild.shit looks that you can predefine a variableECONF_SOURCEand, indeed, some of the packages do this. Hope this helps!