Gentoo Archives: gentoo-devhelp

From: Mike Frysinger <vapier@g.o>
To: gentoo-devhelp@l.g.o
Subject: [gentoo-devhelp] Re: [gentoo-dev] My first ebuild: app-cdr/furiusisomount-
Date: Sun, 25 Sep 2011 19:22:34
[ bcc gentoo-dev, to gentoo-devhelp]

On Sat, Sep 24, 2011 at 05:59, Moritz Schlarb <mail@××××××××××××××.de> wrote:
> Hello developers! > > I wrote my first ebuild and I would like to ask for some feedback on it.
we use the gentoo-devhelp list for this stuff
> Because the application neither has a makefile nor is using distribute > since it's python, I have to install all files by hand, or have I?
use the distutils eclass ? see if it has a or something like that.
> DESCRIPTION="Simple Gtk+ Interface to Mount ISO, IMG, BIN, MDF and NRG Image files without burning to disk."
the description is generally a sentence fragment, so drop the period at the end don't leave uncomment URLs in there
> KEYWORDS="~x86"
generally we default to ~amd64 ~x86. especially since you said this is python code and not compiled.
> src_prepare() { > mv ${PN}_${PV} ${P}
mucking with source tree layout is generally a src_unpack operation
> sed -i -e "s/\"\(src\/\)\"/\/usr\/share\/${PN}\/\1/" ${P}/furiusisomount || die "sed failed"
use ":" as your separator and you wan't have to escape all of the forward slashes. when dealing with long lines, it's customary to wrap it like so: sed -i \ <-e option> \ <-e option> \ path/to/file || die also, there's no need to add a message to `die` here since the PM is smart enough to show you the snippet of code that failed as well as the line number
> src_install() {
i think once you convert to distutils, much of this will go away. i'll respond just to give you an idea of how to do things in general.
> dodir /usr/share/${PN}/ > > dodir /usr/share/${PN}/src > insinto /usr/share/${PN}/src
there's no need for these dodir's as the doins and such helpers will automatically create the required directories
> for i in $(find src -name '*.py' ) ; do
when you use variables, you need to do "local i" so you don't clobber/export them unintentionally i imagine the `find` could be replaced with: src/*.py
> doins $i
need to use "|| die" when using `doins` -mike