diff --git a/srcpkgs/mlocate/INSTALL b/srcpkgs/mlocate/INSTALL new file mode 100644 index 00000000000..6ca399ff9e8 --- /dev/null +++ b/srcpkgs/mlocate/INSTALL @@ -0,0 +1,7 @@ +# INSTALL +case "$ACTION" in +post) + chown root:mlocate usr/bin/mlocate + chmod 2755 usr/bin/mlocate + ;; +esac diff --git a/srcpkgs/mlocate/files/mupdatedb.cron-daily b/srcpkgs/mlocate/files/mupdatedb.cron-daily new file mode 100644 index 00000000000..6621ab35e0b --- /dev/null +++ b/srcpkgs/mlocate/files/mupdatedb.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/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 diff --git a/srcpkgs/mlocate/template b/srcpkgs/mlocate/template index ba282006253..f7afdce6d11 100644 --- a/srcpkgs/mlocate/template +++ b/srcpkgs/mlocate/template @@ -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.