summaryrefslogtreecommitdiffstats
path: root/abs/core/mlocate
diff options
context:
space:
mode:
authorJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
committerJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
commit0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a (patch)
treec0aa2c0b53c317be87eacfcb77b63f53f1f415e7 /abs/core/mlocate
downloadlinhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.zip
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.gz
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.bz2
initial import
Diffstat (limited to 'abs/core/mlocate')
-rw-r--r--abs/core/mlocate/PKGBUILD47
-rw-r--r--abs/core/mlocate/mlocate.db0
-rw-r--r--abs/core/mlocate/mlocate.install27
-rw-r--r--abs/core/mlocate/updatedb.conf5
-rwxr-xr-xabs/core/mlocate/updatedb.cron.daily10
5 files changed, 89 insertions, 0 deletions
diff --git a/abs/core/mlocate/PKGBUILD b/abs/core/mlocate/PKGBUILD
new file mode 100644
index 0000000..50db92b
--- /dev/null
+++ b/abs/core/mlocate/PKGBUILD
@@ -0,0 +1,47 @@
+# $Id: PKGBUILD 1939 2008-05-24 00:35:29Z james $
+# Maintainer: James Rayner <iphitus@gmail.com>
+# Contributor: lydgate
+
+pkgname=mlocate
+pkgver=0.20
+pkgrel=11
+pkgdesc="Faster merging drop-in for slocate"
+arch=(i686 x86_64)
+url="http://carolina.mff.cuni.cz/~trmac/blog/mlocate"
+license=("GPL")
+groups=("base")
+conflicts=('slocate')
+provides=('slocate')
+replaces=('slocate')
+depends=('glibc')
+backup=('etc/updatedb.conf')
+install=mlocate.install
+source=("https://fedorahosted.org/mlocate/attachment/wiki/MlocateDownloads/mlocate-$pkgver.tar.bz2?format=raw" \
+ updatedb.conf updatedb.cron.daily)
+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
+}
+
+md5sums=('ad5e4eb1f2aecf1a5af9fe36c6e297f4'
+ '08f642828fe8a6a0c8e5059133c9a9e2'
+ 'eee7f9db8c6145724313af6fd5fe9d66')
diff --git a/abs/core/mlocate/mlocate.db b/abs/core/mlocate/mlocate.db
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/abs/core/mlocate/mlocate.db
diff --git a/abs/core/mlocate/mlocate.install b/abs/core/mlocate/mlocate.install
new file mode 100644
index 0000000..d29e4d8
--- /dev/null
+++ b/abs/core/mlocate/mlocate.install
@@ -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 $*
diff --git a/abs/core/mlocate/updatedb.conf b/abs/core/mlocate/updatedb.conf
new file mode 100644
index 0000000..f02fe97
--- /dev/null
+++ b/abs/core/mlocate/updatedb.conf
@@ -0,0 +1,5 @@
+# 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 nfs4 smbfs cifs ncpfs afs proc autofs auto iso9660 coda ftpfs sshfs shfs"
diff --git a/abs/core/mlocate/updatedb.cron.daily b/abs/core/mlocate/updatedb.cron.daily
new file mode 100755
index 0000000..b457cf8
--- /dev/null
+++ b/abs/core/mlocate/updatedb.cron.daily
@@ -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