public inbox for gentoo-devhelp@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-devhelp@lists.gentoo.org
Subject: [gentoo-devhelp] Re: [gentoo-dev] My first ebuild: app-cdr/furiusisomount-0.11.3.1
Date: Sun, 25 Sep 2011 15:22:02 -0400	[thread overview]
Message-ID: <CAJaTeTqh68cuDmGNKCrE53v92aRyd+ZPD-E0y4mjkxSQGWB-rQ@mail.gmail.com> (raw)
In-Reply-To: <4E7DA9EF.7050901@moritz-schlarb.de>

[ bcc gentoo-dev, to gentoo-devhelp]

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



           reply	other threads:[~2011-09-25 19:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <4E7DA9EF.7050901@moritz-schlarb.de>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJaTeTqh68cuDmGNKCrE53v92aRyd+ZPD-E0y4mjkxSQGWB-rQ@mail.gmail.com \
    --to=vapier@gentoo.org \
    --cc=gentoo-devhelp@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox