mlocate: add hook to set proper perms; add daily cronjob.

Thanks @chneukirchen.
This commit is contained in:
Steve Prybylski 2015-11-17 19:25:56 -05:00
parent 5e316485a1
commit d207af727c
3 changed files with 38 additions and 1 deletions

7
srcpkgs/mlocate/INSTALL Normal file
View file

@ -0,0 +1,7 @@
# INSTALL
case "$ACTION" in
post)
chown root:mlocate usr/bin/mlocate
chmod 2755 usr/bin/mlocate
;;
esac

View file

@ -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/mupdatedb"
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/mupdatedb ]; then
if [ -f /etc/updatedb.conf ]; then
${UPDATEDB}
else
${UPDATEDB} -f proc
fi
fi

View file

@ -1,7 +1,7 @@
# Template file for 'mlocate'
pkgname=mlocate
version=0.26
revision=1
revision=2
build_style=gnu-configure
configure_args="--program-prefix=m --localstatedir=/var/lib"
system_accounts="mlocate"
@ -21,6 +21,7 @@ alternatives="
locate:updatedb.1:/usr/share/man/man1/mupdatedb.1"
post_install() {
vinstall ${FILESDIR}/mupdatedb.cron-daily 744 etc/cron.daily mupdatedb
# rename for compatibility with findutils.
mv ${DESTDIR}/usr/share/man/man8/mupdatedb.8 ${DESTDIR}/usr/share/man/man1/mupdatedb.1
# remove 'm' prefix.