Monday, May 17, 2010

Adapting an outdated PKGBUILD -Arch

When you download a PKGBUILd and do: makepkg -sci PKGBUILD
this will be normally enought but with an outdated PKGBUILD you will have to change
some variables
Lets take this packagebuild as example

# $Id: PKGBUILD,v 1.00 2009/05/31 01:00 darkbaboon Exp $
# Contributor: Ronan Rabouin

pkgname=adeskbar
pkgver=0.1.7.4
pkgrel=1
pkgdesc="A Quick Application Launcher"
arch=('i686' 'x86_64')
url="http://www.ad-comp.be/index.php?category/ADesk-Bar"
license=('GPL3')
depends=('python')
provides=($pkgname)
conflicts=($pkgname-bzr)
source=(http://www.ad-comp.be/public/projets/ADeskBar/$pkgname-$pkgver.tar.bz2)
md5sums=('9d07f253905fda8f986795415f684550')

build() {
cd $srcdir
install -d $pkgdir/usr/{bin,share/$pkgname,share/pixmaps,share/applications}
cp -a $srcdir/$pkgname-$pkgver/src/* $pkgdir/usr/share/$pkgname
install -m 644 $srcdir/$pkgname-$pkgver/$pkgname.png $pkgdir/usr/share/pixmaps/
install -m 644 $srcdir/$pkgname-$pkgver/$pkgname.desktop $pkgdir/usr/share/applications/

echo -e "#!/bin/bash\nif [ -f ~/.config/$pkgname/config ]; then\n/usr/share/$pkgname/$pkgname\nelse\n \
/usr/share/$pkgname/$pkgname-conf\n/usr/share/$pkgname/$pkgname\nfi" >$pkgdir/usr/bin/$pkgname
chmod 755 $pkgdir/usr/bin/$pkgname
}


What had to be changed??
pkgver=0.1.7.4 had to become pkgver=0.2

source=(http://www.ad-comp.be/public/projets/ADeskBar/$pkgname-$pkgver.tar.bz2) did not work because in the version 0.2 there was suddenly an underscore in the name
so had to be changed to>
source=(http://www.ad-comp.be/public/projets/ADeskBar/adeskbar_0.2.tar.bz2)

Third the validity check was negative because the file size has changed.
So determine md5sum of the now downloaded file:
Open in terminal the folder were it is and
md5sum adeskbar_0.2.tar.bz2
which gives e71f44e1a76054af9f2d2c939c1f6d3b
So change
md5sums=('9d07f253905fda8f986795415f684550')
to
md5sums=('e71f44e1a76054af9f2d2c939c1f6d3b')

Now we can do again:
makepkg -sci PKGBUILD

And all should go well.

This last md5sum problem can also be solved by
makepkg -g >> PKGBUILD

And then:
makepkg -sci PKGBUILD

No comments:

Blog Archive