Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-devhelp
Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-devhelp@g.o
From: Mike Frysinger <vapier@g.o>
Subject: Re: [gentoo-dev] My first ebuild: app-cdr/furiusisomount-0.11.3.1
Date: Sun, 25 Sep 2011 15:22:02 -0400
[ bcc gentoo-dev, to gentoo-devhelp]

On Sat, Sep 24, 2011 at 05:59, Moritz Schlarb <mail@...> 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 setup.py 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

> #http://launchpad.net/furiusisomount/python/0.11.3.1/+download/furiusisomount_0.11.3.1.tar.gz

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\/main.py\)\"/\/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


Navigation:
Lists: gentoo-devhelp: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
How to install MIME types?
Next by thread:
ebuild for gcc SVN-trunk fails since 2 weeks, why?
Previous by date:
Re: How to install MIME types?
Next by date:
ebuild for gcc SVN-trunk fails since 2 weeks, why?


Updated Jun 03, 2012

Summary: Archive of the gentoo-devhelp mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.