diff --git a/srcpkgs/findutils/files/updatedb.conf b/srcpkgs/findutils/files/updatedb.conf new file mode 100644 index 00000000000..1e63312475c --- /dev/null +++ b/srcpkgs/findutils/files/updatedb.conf @@ -0,0 +1,9 @@ +# Configuration file for updatedb(1) from findutils. +# +# Directories to exclude from the database: +PRUNEPATHS="/media /mnt /tmp /var/tmp /var/cache /var/lock /var/run /var/spool" + +# Filesystems to exclude from the database: +PRUNEFS="afs auto autofs binfmt_misc cifs coda configfs cramfs debugfs devpts" +PRUNEFS="$PRUNEFS devtmpfs ftpfs iso9660 mqueue ncpfs nfs nfs4 proc ramfs" +PRUNEFS="$PRUNEFS securityfs shfs smbfs sshfs sysfs tmpfs udf usbfs vboxsf" diff --git a/srcpkgs/findutils/files/updatedb.cron-daily b/srcpkgs/findutils/files/updatedb.cron-daily index c581ac7f9d3..6852ea1b78a 100755 --- a/srcpkgs/findutils/files/updatedb.cron-daily +++ b/srcpkgs/findutils/files/updatedb.cron-daily @@ -1,6 +1,19 @@ #!/bin/sh +# Read system defaults. +if [ -r /etc/updatedb.conf ]; then + . /etc/updatedb.conf +fi + +if [ -n "$PRUNEFS" ]; then + args="$args --prunefs='$PRUNEFS'" +fi + +if [ -n "$PRUNEPATHS" ]; then + args="$args --prunepaths='$PRUNEPATHS'" +fi + # Update the "locate" database if [ -x /usr/bin/updatedb ]; then - /usr/bin/updatedb + /usr/bin/updatedb ${args} fi diff --git a/srcpkgs/findutils/template b/srcpkgs/findutils/template index f0a360c8530..112aefd221a 100644 --- a/srcpkgs/findutils/template +++ b/srcpkgs/findutils/template @@ -1,6 +1,7 @@ # Template file for 'findutils' pkgname=findutils version=4.4.2 +revision=1 distfiles="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$version.tar.gz" build_style=gnu_configure configure_args="--localstatedir=/var/lib/locate" @@ -13,13 +14,17 @@ long_desc=" other programs to provide modular and powerful directory search and file locating capabilities to other commands." +conf_files="/etc/updatedb.conf" + Add_dependency run glibc Add_dependency build gettext Add_dependency build texinfo post_install() { - # Insdtall the cron daily job. + # Install the cron daily job. install -D -m744 ${FILESDIR}/updatedb.cron-daily \ ${DESTDIR}/etc/cron.daily/updatedb + # Install the updatedb conf file. + install -D -m640 ${FILESDIR}/updatedb.conf ${DESTDIR}/etc/updatedb.conf }