summaryrefslogtreecommitdiff
path: root/sysutils/slocate
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2012-12-12 15:24:17 +0000
committerwiz <wiz@pkgsrc.org>2012-12-12 15:24:17 +0000
commit80f16977a98d42dd5b2881671a04760d6b4380ae (patch)
treefc028264715bb3a430404b703cada7d2374b0ef3 /sysutils/slocate
parentec6de840da605cc671850e4f59026d246dcb910f (diff)
downloadpkgsrc-80f16977a98d42dd5b2881671a04760d6b4380ae.tar.gz
Import slocate-3.1 as sysutils/slocate, packaged for wip by diro, Adam Hoka,
poppnk. Secure locate provides a secure way to index and quickly search for files on your system. It uses incremental encoding just like GNU locate to compress its database to make searching faster, but it will also check file permissions and ownership so that users will not see files they do not have access to.
Diffstat (limited to 'sysutils/slocate')
-rw-r--r--sysutils/slocate/DESCR4
-rw-r--r--sysutils/slocate/MESSAGE12
-rw-r--r--sysutils/slocate/Makefile42
-rw-r--r--sysutils/slocate/PLIST8
-rw-r--r--sysutils/slocate/distinfo7
-rw-r--r--sysutils/slocate/files/updatedb.conf9
-rw-r--r--sysutils/slocate/patches/patch-ae23
-rw-r--r--sysutils/slocate/patches/patch-af23
8 files changed, 128 insertions, 0 deletions
diff --git a/sysutils/slocate/DESCR b/sysutils/slocate/DESCR
new file mode 100644
index 00000000000..5d9ff05eabd
--- /dev/null
+++ b/sysutils/slocate/DESCR
@@ -0,0 +1,4 @@
+Secure locate provides a secure way to index and quickly search for files on
+your system. It uses incremental encoding just like GNU locate to compress
+its database to make searching faster, but it will also check file permissions
+and ownership so that users will not see files they do not have access to.
diff --git a/sysutils/slocate/MESSAGE b/sysutils/slocate/MESSAGE
new file mode 100644
index 00000000000..e9b5df86ee3
--- /dev/null
+++ b/sysutils/slocate/MESSAGE
@@ -0,0 +1,12 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2012/12/12 15:24:17 wiz Exp $
+
+To upgrade the slocate db periodically, add this to your daily cron jobs:
+
+ 0 6 * * * root ${PREFIX}/bin/updatedb
+
+You can find an example updatedb.conf here:
+
+ ${EGDIR}/updatedb.conf
+
+===========================================================================
diff --git a/sysutils/slocate/Makefile b/sysutils/slocate/Makefile
new file mode 100644
index 00000000000..93f66365d3f
--- /dev/null
+++ b/sysutils/slocate/Makefile
@@ -0,0 +1,42 @@
+# $NetBSD: Makefile,v 1.1 2012/12/12 15:24:17 wiz Exp $
+#
+
+DISTNAME= slocate-3.1
+CATEGORIES= sysutils
+MASTER_SITES= http://fossies.org/unix/misc/old/
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://sourceforge.net/projects/slocate/
+COMMENT= Secure Locate
+LICENSE= gnu-gpl-v2
+
+NO_CONFIGURE= YES
+USE_TOOLS+= gmake
+
+INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${EGDIR}
+
+SLOCATE_GROUP?= slocate
+PKG_GROUPS= ${SLOCATE_GROUP}
+PKG_GROUPS_VARS+= SLOCATE_GROUP
+
+EGDIR= ${PREFIX}/share/examples/slocate
+MESSAGE_SUBST+= EGDIR=${EGDIR}
+
+OWN_DIRS= ${PREFIX}/var/slocate
+OWN_DIRS_PERMS+= ${PREFIX}/var/slocate ${ROOT_USER} ${SLOCATE_GROUP} 0750
+
+SPECIAL_PERMS+= src/slocate ${ROOT_USER} ${SLOCATE_GROUP} 2755
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/slocate ${DESTDIR}${PREFIX}/bin/
+ ${LN} -f -s ${PREFIX}/bin/slocate ${DESTDIR}${PREFIX}/bin/locate
+ ${LN} -f -s ${PREFIX}/bin/slocate ${DESTDIR}${PREFIX}/bin/updatedb
+ ${INSTALL_MAN} ${WRKSRC}/doc/updatedb.1 \
+ ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/updatedb.1
+ ${INSTALL_MAN} ${WRKSRC}/doc/slocate.1 \
+ ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/slocate.1
+ ${LN} -f -s ${PREFIX}/${PKGMANDIR}/man1/slocate.1 \
+ ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/locate.1
+ ${INSTALL_DATA} ${FILESDIR}/updatedb.conf ${DESTDIR}${EGDIR}/updatedb.conf
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/slocate/PLIST b/sysutils/slocate/PLIST
new file mode 100644
index 00000000000..2925671ccb1
--- /dev/null
+++ b/sysutils/slocate/PLIST
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1 2012/12/12 15:24:17 wiz Exp $
+bin/locate
+bin/slocate
+bin/updatedb
+man/man1/locate.1
+man/man1/slocate.1
+man/man1/updatedb.1
+share/examples/slocate/updatedb.conf
diff --git a/sysutils/slocate/distinfo b/sysutils/slocate/distinfo
new file mode 100644
index 00000000000..64f39ba3d06
--- /dev/null
+++ b/sysutils/slocate/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2012/12/12 15:24:17 wiz Exp $
+
+SHA1 (slocate-3.1.tar.gz) = e427552664385b86931b7626c26bd95ae5f9f085
+RMD160 (slocate-3.1.tar.gz) = d3b1e818cc35ce8e87ec1b0764f6b2145a319e13
+Size (slocate-3.1.tar.gz) = 37748 bytes
+SHA1 (patch-ae) = a91bcc950628ee8bbe87e17066502a030b8b9c6d
+SHA1 (patch-af) = 9f12826f9263753d423fa01f0d7904dadbbca0d0
diff --git a/sysutils/slocate/files/updatedb.conf b/sysutils/slocate/files/updatedb.conf
new file mode 100644
index 00000000000..7aebde87c5f
--- /dev/null
+++ b/sysutils/slocate/files/updatedb.conf
@@ -0,0 +1,9 @@
+# This file sets environment variables which are used by updatedb
+# $NetBSD: updatedb.conf,v 1.1 2012/12/12 15:24:17 wiz Exp $
+
+# filesystems which are pruned from updatedb database
+PRUNEFS="NFS nfs afs proc smbfs autofs auto iso9660 ncpfs coda devpts ftpfs"
+export PRUNEFS
+# paths which are pruned from updatedb database
+PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /amd /alex /var/spool"
+export PRUNEPATHS
diff --git a/sysutils/slocate/patches/patch-ae b/sysutils/slocate/patches/patch-ae
new file mode 100644
index 00000000000..442a5bfa026
--- /dev/null
+++ b/sysutils/slocate/patches/patch-ae
@@ -0,0 +1,23 @@
+$NetBSD: patch-ae,v 1.1 2012/12/12 15:24:17 wiz Exp $
+
+Remove this block if FNM_CASEFOLD is not set.
+
+--- src/utils.c.orig 2007-11-17 13:22:15.000000000 +0100
++++ src/utils.c
+@@ -139,6 +139,7 @@ int match(struct g_data_s *g_data, char
+ ret = 1;
+
+ EXIT:
++#ifndef FNM_CASEFOLD
+ if (nocase_str)
+ free(nocase_str);
+ nocase_str = NULL;
+@@ -147,7 +148,7 @@ EXIT:
+ free(nocase_path);
+
+ nocase_path = NULL;
+-
++#endif
+ return ret;
+ }
+
diff --git a/sysutils/slocate/patches/patch-af b/sysutils/slocate/patches/patch-af
new file mode 100644
index 00000000000..da60155feed
--- /dev/null
+++ b/sysutils/slocate/patches/patch-af
@@ -0,0 +1,23 @@
+$NetBSD: patch-af,v 1.1 2012/12/12 15:24:17 wiz Exp $
+
+Don't hardcode CFLAGS or CC.
+
+--- src/Makefile.orig 2007-11-17 13:35:02.000000000 +0100
++++ src/Makefile
+@@ -1,13 +1,13 @@
+ OBJS=slocate.o cmds.o conf.o utils.o
+ HEADERS=slocate.h cmds.h conf.h utils.h
+
+-CFLAGS=-Wall -Wshadow
+-CFLAGS+=-O2
++#CFLAGS=-Wall -Wshadow
++#CFLAGS+=-O2
+ #CFLAGS+=-g3
+ #LDFLAGS+=-lefence
+
+ PROG=slocate
+-CC=gcc
++#CC=gcc
+
+ all: $(OBJS) $(MOD_OBJS)
+ $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(MOD_OBJS)