[arch-commits] CVS update of core/base/mlocate (5 files)
James Rayner
james at archlinux.org
Sat Nov 3 07:14:24 UTC 2007
Date: Saturday, November 3, 2007 @ 03:14:24
Author: james
Path: /home/cvs-core/core/base/mlocate
Added: PKGBUILD (1.1) mlocate.db (1.1) mlocate.install (1.1)
updatedb.conf (1.1) updatedb.cron.daily (1.1)
upgpkg: mlocate 0.18-1
---------------------+
PKGBUILD | 45 +++++++++++++++++++++++++++++++++++++++++++++
mlocate.install | 27 +++++++++++++++++++++++++++
updatedb.conf | 6 ++++++
updatedb.cron.daily | 10 ++++++++++
4 files changed, 88 insertions(+)
Index: core/base/mlocate/PKGBUILD
diff -u /dev/null core/base/mlocate/PKGBUILD:1.1
--- /dev/null Sat Nov 3 03:14:24 2007
+++ core/base/mlocate/PKGBUILD Sat Nov 3 03:14:24 2007
@@ -0,0 +1,45 @@
+# $Id: PKGBUILD,v 1.1 2007/11/03 07:14:24 james Exp $
+# Maintainer: James Rayner <iphitus at gmail.com>
+# Contributor: lydgate
+
+pkgname=mlocate
+pkgver=0.18
+pkgrel=1
+pkgdesc="Faster merging drop-in for slocate"
+arch=(i686 x86_64)
+url="http://carolina.mff.cuni.cz/~trmac/blog/mlocate"
+license=("GPL")
+conflicts=('slocate')
+provides=('slocate')
+replaces=('slocate')
+depends=('glibc')
+backup=('etc/updatedb.conf')
+install=mlocate.install
+source=(http://people.redhat.com/mitr/mlocate/mlocate-$pkgver.tar.bz2 \
+ updatedb.conf updatedb.cron.daily)
+md5sums=('c4352d10b47e569297caedd2c2d22675' '0b12d7a78c8fcbd5fea7f3c9dc55c1bd'\
+ 'eee7f9db8c6145724313af6fd5fe9d66')
+
+build() {
+ 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 -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
+ ln -sv locate usr/bin/slocate
+ chgrp -v 21 usr/bin/locate
+ chmod -v 2755 usr/bin/locate
+
+ mkdir -pv var/lib
+ install -d -m750 -g21 var/lib/locate
+}
Index: core/base/mlocate/mlocate.install
diff -u /dev/null core/base/mlocate/mlocate.install:1.1
--- /dev/null Sat Nov 3 03:14:24 2007
+++ core/base/mlocate/mlocate.install Sat Nov 3 03:14:24 2007
@@ -0,0 +1,27 @@
+# arg 1: the new package version
+post_install() {
+ post_upgrade "$1" "$1"
+ echo "mlocate command is technically locate, but slocate is symlinked and still works."
+ echo "You should run updatedb as root."
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ # 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() {
+ getent group locate &>/dev/null && usr/sbin/groupdel locate &>/dev/null
+}
+
+op=$1
+shift
+
+$op $*
Index: core/base/mlocate/updatedb.conf
diff -u /dev/null core/base/mlocate/updatedb.conf:1.1
--- /dev/null Sat Nov 3 03:14:24 2007
+++ core/base/mlocate/updatedb.conf Sat Nov 3 03:14:24 2007
@@ -0,0 +1,6 @@
+# directories to exclude from the slocate database:
+PRUNEPATHS="/tmp /var/tmp /usr/tmp /var/spool /var/cache"
+
+# filesystems to exclude from the slocate database:
+PRUNEFS="nfs smbfs ncpfs afs proc smbfs autofs auto iso9660 coda ftpfs cifs"
+
Index: core/base/mlocate/updatedb.cron.daily
diff -u /dev/null core/base/mlocate/updatedb.cron.daily:1.1
--- /dev/null Sat Nov 3 03:14:24 2007
+++ core/base/mlocate/updatedb.cron.daily Sat Nov 3 03:14:24 2007
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Update the "locate" database
+if [ -x /usr/bin/updatedb ]; then
+ if [ -f /etc/updatedb.conf ]; then
+ /usr/bin/updatedb
+ else
+ /usr/bin/updatedb -f proc
+ fi
+fi
More information about the arch-commits
mailing list