diff -Naur ../../../extra/system/mlocate/PKGBUILD ./PKGBUILD --- ../../../extra/system/mlocate/PKGBUILD 2007-04-09 04:20:05.000000000 +0100 +++ ./PKGBUILD 2007-04-14 07:04:43.000000000 +0100 @@ -4,7 +4,7 @@ pkgname=mlocate pkgver=0.16 -pkgrel=1 +pkgrel=2 pkgdesc="Faster merging drop-in for slocate" arch=(i686 x86_64) url="http://carolina.mff.cuni.cz/~trmac/blog/mlocate" @@ -12,36 +12,33 @@ conflicts=('slocate') provides=('slocate') depends=('glibc') -backup=('etc/updatedb.conf' 'usr/var/mlocate/mlocate.db') +backup=('etc/updatedb.conf') install=mlocate.install source=(http://people.redhat.com/mitr/mlocate/mlocate-$pkgver.tar.bz2 \ - updatedb.conf updatedb.cron.daily mlocate.db) + updatedb.conf updatedb.cron.daily) +md5sums=('4840542d9732eda6f41d4cd936852887' '0b12d7a78c8fcbd5fea7f3c9dc55c1bd' + 'eee7f9db8c6145724313af6fd5fe9d66') build() { - cd $startdir/src/$pkgname-$pkgver + cd "$startdir"/src/$pkgname-$pkgver # Build! + sed -i '/^groupname /s/mlocate/locate/' Makefile.in ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib make || return 1 # Set up a default updatedb.conf and a daily cronjob - install -cD -m644 ../updatedb.conf $startdir/pkg/etc/updatedb.conf - install -cD -m744 ../updatedb.cron.daily $startdir/pkg/etc/cron.daily/updatedb + install -v -D -m644 ../updatedb.conf "$startdir"/pkg/etc/updatedb.conf + install -v -D -m744 ../updatedb.cron.daily "$startdir"/pkg/etc/cron.daily/updatedb # Install Mlocate - make DESTDIR=$startdir/pkg install - (cd $startdir/pkg/usr/bin && ln -sf locate slocate) + make DESTDIR="$startdir"/pkg install - # Install dummy database - ensure permissions are correct - install -cD -m640 ../mlocate.db $startdir/pkg/var/lib/mlocate/mlocate.db - chmod 750 $startdir/pkg/var/lib/mlocate - - cd $startdir/pkg + cd "$startdir"/pkg ln -sv locate usr/bin/slocate - chgrp -v 21 var/lib/mlocate usr/bin/locate - chmod -v 750 var/lib/mlocate + chgrp -v 21 usr/bin/locate chmod -v 2755 usr/bin/locate + mkdir -pv var/lib + install -d -m750 -g21 var/lib/locate } -md5sums=('4840542d9732eda6f41d4cd936852887' '0b12d7a78c8fcbd5fea7f3c9dc55c1bd'\ - 'eee7f9db8c6145724313af6fd5fe9d66' 'd41d8cd98f00b204e9800998ecf8427e') diff -Naur ../../../extra/system/mlocate/mlocate.install ./mlocate.install --- ../../../extra/system/mlocate/mlocate.install 2007-04-09 04:20:05.000000000 +0100 +++ ./mlocate.install 2007-04-14 07:05:31.000000000 +0100 @@ -2,18 +2,23 @@ post_install() { post_upgrade "$1" "$1" echo "mlocate command is technically locate, but slocate is symlinked and still works." - echo "You should now run updatedb as root." + 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 mlocate &>/dev/null + # 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/mlocate } # arg 1: the old package version pre_remove() { - usr/sbin/groupdel mlocate &>/dev/null + getent group locate &>/dev/null && usr/sbin/groupdel locate &>/dev/null } op=$1