From 6d22541bcebb7236bedfb98a96d5a1292072e86c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 21 Jun 2012 00:01:36 +0000 Subject: Thu Jun 21 00:01:36 UTC 2012 --- testing/mlocate/PKGBUILD | 51 +++++++++++++++++++++++++++++++++++++ testing/mlocate/updatedb.conf | 4 +++ testing/mlocate/updatedb.cron.daily | 29 +++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 testing/mlocate/PKGBUILD create mode 100644 testing/mlocate/updatedb.conf create mode 100755 testing/mlocate/updatedb.cron.daily (limited to 'testing/mlocate') diff --git a/testing/mlocate/PKGBUILD b/testing/mlocate/PKGBUILD new file mode 100644 index 000000000..50a15650f --- /dev/null +++ b/testing/mlocate/PKGBUILD @@ -0,0 +1,51 @@ +# $Id: PKGBUILD 162087 2012-06-19 15:29:24Z allan $ +# Maintainer: Allan McRae +# Contributor: lydgate + +pkgname=mlocate +pkgver=0.25 +pkgrel=2 +pkgdesc="Faster merging drop-in for slocate" +arch=('i686' 'x86_64') +url="http://carolina.mff.cuni.cz/~trmac/blog/mlocate" +license=('GPL') +depends=('glibc' 'coreutils' 'sh') +backup=('etc/updatedb.conf' + 'etc/cron.daily/updatedb') +source=(https://fedorahosted.org/releases/m/l/mlocate/mlocate-$pkgver.tar.xz + updatedb.conf + updatedb.cron.daily) +md5sums=('c6d043b170613b0e327a815b497f680a' + 'b56d81de17fe29b01b4b28861acb8fd4' + 'cde5da81bebad2de556ef2e43d895e13') + +build() { + cd $srcdir/$pkgname-$pkgver + + sed -i '/^groupname /s/mlocate/locate/' Makefile.in + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib + make + +} + +check() { + cd $srcdir/$pkgname-$pkgver + make check +} + +package() { + cd $srcdir/$pkgname-$pkgver + + make DESTDIR=$pkgdir install + + ln -s locate $pkgdir/usr/bin/slocate + chgrp 21 $pkgdir/usr/bin/locate + chmod 2755 $pkgdir/usr/bin/locate + + install -dm755 $pkgdir/var/lib + install -dm750 -g21 $pkgdir/var/lib/locate + + # Set up a default updatedb.conf and a daily cronjob + install -Dm644 ${srcdir}/updatedb.conf $pkgdir/etc/updatedb.conf + install -Dm744 ${srcdir}/updatedb.cron.daily $pkgdir/etc/cron.daily/updatedb +} diff --git a/testing/mlocate/updatedb.conf b/testing/mlocate/updatedb.conf new file mode 100644 index 000000000..633c17482 --- /dev/null +++ b/testing/mlocate/updatedb.conf @@ -0,0 +1,4 @@ +PRUNE_BIND_MOUNTS = "yes" +PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset cramfs debugfs devpts devtmpfs ecryptfs exofs ftpfs fuse fuse.encfs fuse.sshfs fusectl gfs gfs2 hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs sshfs sysfs tmpfs ubifs udf usbfs vboxsf" +PRUNENAMES = ".git .hg .svn" +PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev /var/cache /var/lib/pacman/local /var/lock /var/run /var/spool /var/tmp" diff --git a/testing/mlocate/updatedb.cron.daily b/testing/mlocate/updatedb.cron.daily new file mode 100755 index 000000000..cac9bb063 --- /dev/null +++ b/testing/mlocate/updatedb.cron.daily @@ -0,0 +1,29 @@ +#!/bin/sh + +# nicenesses range from -20 (most favorable scheduling) to 19 (least favorable) +NICE=19 + +# 0 for none, 1 for real time, 2 for best-effort, 3 for idle +IONICE_CLASS=2 + +# 0-7 (for IONICE_CLASS 1 and 2 only), 0=highest, 7=lowest +IONICE_PRIORITY=7 + +UPDATEDB="/usr/bin/updatedb" + +if [ -x /usr/bin/nice ]; then + UPDATEDB="/usr/bin/nice -n ${NICE:-19} ${UPDATEDB}" +fi + +if [ -x /usr/bin/ionice ]; then + UPDATEDB="/usr/bin/ionice -c ${IONICE_CLASS:-2} -n ${IONICE_PRIORITY:-7} ${UPDATEDB}" +fi + +# Update the "locate" database +if [ -x /usr/bin/updatedb ]; then + if [ -f /etc/updatedb.conf ]; then + ${UPDATEDB} + else + ${UPDATEDB} -f proc + fi +fi -- cgit v1.2.3-54-g00ecf