diff -Naur ../../../arch/base/slocate/PKGBUILD ./PKGBUILD --- ../../../arch/base/slocate/PKGBUILD 2006-07-12 07:22:25.000000000 +0100 +++ ./PKGBUILD 2007-04-14 07:07:52.000000000 +0100 @@ -2,10 +2,11 @@ # Maintainer: judd pkgname=slocate pkgver=3.1 -pkgrel=2 +pkgrel=3 pkgdesc="Provides a secure way to index and quickly search for local files" arch=(i686 x86_64) url="http://www.geekreview.org/slocate" +license=('GPL') depends=('glibc' 'shadow' 'filesystem') backup=('etc/updatedb.conf') install=slocate.install @@ -15,21 +16,25 @@ 'a61a949c87381699c0da04021ae36f12') build() { - cd $startdir/src/$pkgname-$pkgver - make || return 1 + cd "$startdir"/src/$pkgname-$pkgver + + sed -i '/#define DB_GROUP/s/slocate/locate/' src/slocate.h + make -C src || return 1 # install (the Makefile does a bad job of it, so we do it ourselves) - install -cD -m644 ../updatedb.conf $startdir/pkg/etc/updatedb.conf - install -cD -m744 ../updatedb.cron.daily $startdir/pkg/etc/cron.daily/updatedb - mkdir -p $startdir/pkg/usr/bin - install -cD -m2755 --group=21 src/slocate $startdir/pkg/usr/bin/slocate - (cd $startdir/pkg/usr/bin && ln -sf slocate locate) - (cd $startdir/pkg/usr/bin && ln -sf slocate updatedb) - install -cD -m644 doc/slocate.1 $startdir/pkg/usr/man/man1/slocate.1 - install -cD -m644 doc/updatedb.1 $startdir/pkg/usr/man/man1/updatedb.1 - (cd $startdir/pkg/usr/man/man1 && ln -sf slocate.1 locate.1) + install -v -D -m644 ../updatedb.conf "$startdir"/pkg/etc/updatedb.conf + install -v -D -m744 ../updatedb.cron.daily "$startdir"/pkg/etc/cron.daily/updatedb + + mkdir -pv "$startdir"/pkg/usr/bin + install -v -D -m2755 -g21 src/slocate "$startdir"/pkg/usr/bin/slocate + install -v -D -m644 doc/slocate.1 "$startdir"/pkg/usr/man/man1/slocate.1 + install -v -D -m644 doc/updatedb.1 "$startdir"/pkg/usr/man/man1/updatedb.1 + + cd "$startdir"/pkg + ln -sv slocate usr/bin/locate + ln -sv slocate usr/bin/updatedb # slocate's gid will be 21 - mkdir -p $startdir/pkg/var/lib - install -cd -m750 --group=21 $startdir/pkg/var/lib/slocate + mkdir -pv var/lib + install -d -m750 -g21 var/lib/slocate } diff -Naur ../../../arch/base/slocate/slocate.install ./slocate.install --- ../../../arch/base/slocate/slocate.install 2006-07-12 07:22:26.000000000 +0100 +++ ./slocate.install 2007-04-14 06:44:40.000000000 +0100 @@ -1,18 +1,23 @@ # arg 1: the new package version post_install() { - sbin/ldconfig -r . &>/dev/null - usr/sbin/groupadd -g 21 slocate >/dev/null 2>&1 + post_upgrade "$1" "$1" + echo "You should run updatedb as root." } # arg 1: the new package version # arg 2: the old package version post_upgrade() { - usr/sbin/groupadd -g 21 slocate >/dev/null 2>&1 + # This can be removed after {m,x}locate have both been updated + getent group slocate &>/dev/null && usr/sbin/groupdel slocate &>/dev/null + getent group mlocate &>/dev/null && usr/sbin/groupdel mlocate &>/dev/null + + getent group locate || usr/sbin/groupadd -g 21 locate &>/dev/null + chown -R root:locate var/lib/slocate } # arg 1: the old package version pre_remove() { - usr/sbin/groupdel slocate >/dev/null 2>&1 + getent group locate &>/dev/null && usr/sbin/groupdel locate &>/dev/null } op=$1