You are not logged in.

#1 2008-12-21 18:36:49

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Trying to create my first PKGBUILD

Here is what i did:

# Author: Raul Gonzalez Duque <zootropo@gmail.com>
# Contributor: Xi0N <grayfox.i0n@gmail.cm>
pkgname=nautilus-rename-exif-date
pkgver=0.1.1
pkgrel=1
pkgdesc="Adds an entry to Nautilus' contextual menu to rename photos to their EXIF date"
arch=(i686 x86_64 ppc)
url="http://mundogeek.net/nautilus-scripts/" 
license="GPL" 
depends=('python' 'python-nautilus' 'nautilus') 
source=(http://launchpadlibrarian.net/17362131/nautilus-rename-exif-date_$pkgver-$pkgrel.tar.gz)
md5sums=('9f0a69ac588ff32db78f5349b6622afe')

build() { 
    cd "${startdir}/src/${pkgname}-${pkgver}/"
    install -m 755 $pkgname.py /usr/lib/nautilus/extensions-2.0/python/
    install -m 644 EXIF.py /usr/lib/nautilus/extensions-2.0/python/
    install -m 644 $pkgname.png /usr/share/pixmaps/
    msg "Restart nautilus with 'killall -9 nautilus'"
}

This is the PKGBUILD for installing a nautilus extension that enables to rename the pictures you have taken with a digital camera to their exif date, so you can organize them properly.

I dont know if this is the correct way to do it and i wanted to ask you what is wrong on it, because i would like to share it on AUR and maintain it.

Thanks! smile

Offline

#2 2008-12-21 18:49:09

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Trying to create my first PKGBUILD

I changed it to this:

# Author: Raul Gonzalez Duque <zootropo@gmail.com>
# Contributor: Xi0N <grayfox.i0n@gmail.cm>
pkgname=nautilus-rename-exif-date
pkgver=0.1.1
pkgrel=1
pkgdesc="Adds an entry to Nautilus' contextual menu to rename photos to their EXIF date"
arch=(i686 x86_64 ppc)
url="http://mundogeek.net/nautilus-scripts/" 
license="GPL" 
depends=('python' 'python-nautilus' 'nautilus') 
source=(http://launchpadlibrarian.net/17362131/nautilus-rename-exif-date_$pkgver-$pkgrel.tar.gz)
md5sums=('9f0a69ac588ff32db78f5349b6622afe')

build() { 
    cd "${startdir}/src/${pkgname}-${pkgver}/"
    make install DESTDIR=$pkgdir || return 1
    #install -m 755 $pkgname.py /usr/lib/nautilus/extensions-2.0/python/
    #install -m 644 EXIF.py /usr/lib/nautilus/extensions-2.0/python/
    #install -m 644 $pkgname.png /usr/share/pixmaps/
    msg "Restart nautilus with 'killall -9 nautilus'"
}

I think this is more correct that the one before and does the stuff pretty well...... i just want someone to tell me if is correct

Thanks!

Offline

#3 2008-12-21 20:00:43

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: Trying to create my first PKGBUILD

license is an array, so change the quotes to parentheses.  Also, I suggest moving the restart message to an .install file:

post_install() {
  echo "==> Restart nautilus with 'killall -9 nautilus'"
}

post_upgrade() {
  post_install $1
}

edit: I noticed you submitted the AUR package and used parentheses for the install entry.  I forgot to mention that 'install' isn't an array, so don't use parentheses there.

Last edited by tdy (2008-12-21 20:52:55)

Offline

#4 2008-12-21 20:46:52

kludge
Member
Registered: 2008-08-03
Posts: 294

Re: Trying to create my first PKGBUILD

first, have you installed 'namcap' and run it against yr PKGBUILD?  that can help quite a bit.

tdy wrote:

Also, I suggest moving the restart message to an .install file

let me second and strengthen that suggestions.  that msg is meaningless in the build() function, because you don't need to restart nautilus until after you've installed the package.  the PKGBUILD only tells makepkg how to *make* the *pkg*.  you will use pacman -U to install the package.  pacman will read the .install file and print the message, and *then* you'll need to restart nautilus.

also:

source=(http://launchpadlibrarian.net/17362131/nautilus-rename-exif-date_$pkgver-$pkgrel.tar.gz)

1) the 'pkgrel' variable is only applicable to the version of the PKGBUILD, not the packaged software itself.  you increment it when you change the PKGBUILD, and reset it to 1 when you increment 'pkgver'.  i don't know this package or it's versioning scheme, but i *suspect* that the line might be incorrect.

2) you've defined 'pkgname' as 'nautilus-rename-exif-date', so you can use $pkgname in the 'source' definition instead of retyping the entire package name.  it doesn't break the PKGBUILD, but it's good style.

hth!


[23:00:16]    dr_kludge | i want to invent an olfactory human-computer interface, integrate it into the web standards, then produce my own forked browser.
[23:00:32]    dr_kludge | can you guess what i'd call it?
[23:01:16]    dr_kludge | nosilla.
[23:01:32]    dr_kludge | i really should be going to bed.  i'm giggling madly about that.

Offline

#5 2008-12-21 21:00:00

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Trying to create my first PKGBUILD

OK, i commited those changes, and here it is: My first contribution to the community :

http://aur.archlinux.org/packages.php?ID=22391

I hope its useful for someone wink

Cheers!!!

Offline

Board footer

Powered by FluxBB