summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartłomiej Piotrowski <b@bpiotrowski.pl>2012-07-10 10:32:32 +0200
committerBartłomiej Piotrowski <b@bpiotrowski.pl>2012-07-10 10:32:32 +0200
commit3fd12a0011693045356304a007f062c2f02669cd (patch)
tree2367f9c5bcf6aeb229d80cfed1e91e0fb480bfcc
parentcebc5ae5982e95ad03c3b9309e5d88e9eaf54018 (diff)
downloadaports-3fd12a0011693045356304a007f062c2f02669cd.tar.bz2
aports-3fd12a0011693045356304a007f062c2f02669cd.tar.xz
testing/mlocate: new aport
-rw-r--r--testing/mlocate/APKBUILD48
-rw-r--r--testing/mlocate/mlocate.pre-install3
-rw-r--r--testing/mlocate/updatedb.conf4
-rw-r--r--testing/mlocate/updatedb.cron.daily29
4 files changed, 84 insertions, 0 deletions
diff --git a/testing/mlocate/APKBUILD b/testing/mlocate/APKBUILD
new file mode 100644
index 000000000..f23c46578
--- /dev/null
+++ b/testing/mlocate/APKBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+
+pkgname=mlocate
+pkgver=0.25
+pkgrel=0
+pkgdesc='An utility to index and quickly search for files by name'
+url='https://fedorahosted.org/mlocate/'
+arch='all'
+license='GPL'
+install="$pkgname.pre-install"
+makedepends='uclibc-dev sed'
+subpackages="$pkgname-doc"
+source="https://fedorahosted.org/releases/m/l/mlocate/mlocate-$pkgver.tar.xz
+ updatedb.conf
+ updatedb.cron.daily"
+
+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 locate $pkgdir/usr/bin/locate
+ chmod 2755 $pkgdir/usr/bin/locate
+
+ install -dm755 $pkgdir/var/lib
+ install -dm750 -g locate $pkgdir/var/lib/locate
+
+ install -Dm644 ${srcdir}/updatedb.conf $pkgdir/etc/updatedb.conf
+ install -Dm744 ${srcdir}/updatedb.cron.daily $pkgdir/etc/cron.daily/updatedb
+}
+
+md5sums="c6d043b170613b0e327a815b497f680a mlocate-0.25.tar.xz
+465315bfa3380a23fae9a383270cb2ec updatedb.conf
+cde5da81bebad2de556ef2e43d895e13 updatedb.cron.daily"
diff --git a/testing/mlocate/mlocate.pre-install b/testing/mlocate/mlocate.pre-install
new file mode 100644
index 000000000..18aa121d0
--- /dev/null
+++ b/testing/mlocate/mlocate.pre-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+addgroup -S locate 2>/dev/null
+exit 0
diff --git a/testing/mlocate/updatedb.conf b/testing/mlocate/updatedb.conf
new file mode 100644
index 000000000..ea33c32cf
--- /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/lock /var/run /var/spool /var/tmp"
diff --git a/testing/mlocate/updatedb.cron.daily b/testing/mlocate/updatedb.cron.daily
new file mode 100644
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