Skip to content
Permalink
Browse files

Bug: https://trac.macports.org/ticket/1269

Submitted by:	 pguyot@kallisys.net
Reviewed by:
Approved by:
Obtained from:

new port, slocate 2.7.

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@4170 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Felix Kronlage
Felix Kronlage committed Dec 9, 2003
1 parent add1c0f commit 8646c774b2a132642ea9fb6e5cd293ee20d01da5
@@ -0,0 +1,42 @@
# $Id: Portfile,v 1.1 2003/12/09 00:53:28 fkr Exp $

PortSystem 1.0
name slocate
version 2.7
categories sysutils
homepage http://www.geekreview.org/slocate/
description Secure Locate is a replacement for locate.
long_description 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. \
The big advantage is that slocate will find files in your ~, even \
if you made it unreadable by "nobody" (who traditionally performs \
the locate database update), without letting another user find \
files there.

platforms darwin
maintainers pguyot@kallisys.net
master_sites ftp://ftp.geekreview.org/slocate/src/
checksums md5 4872830642ea2ed5f9aff932720583c9
patchfiles patch-Makefile.am patch-main.c patch-doc-slocate.1.linux
configure.cmd ./autogen.sh

pre-patch { system "gzip -d ${worksrcpath}/doc/slocate.1.linux.gz" }

post-patch { reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/main.c
reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/doc/slocate.1.linux
system "gzip ${worksrcpath}/doc/slocate.1.linux" }

pre-destroot { addgroup slocate }
post-destroot { system "install -d -g slocate -o root ${destroot}${prefix}/var/db/slocate"
system "touch ${destroot}${prefix}/var/db/slocate/.turd"
system "install ${portpath}/files/daily.slocate ${destroot}${prefix}/etc/"
reinplace "s|__PREFIX__|${prefix}|g" ${destroot}${prefix}/etc/daily.slocate }

post-install { ui_msg "\nslocate's database should be updated on a regular basis. In"
ui_msg "${prefix}/etc/daily.slocate, you'll find some lines to put in"
ui_msg "/etc/daily.local to update the database on a daily basis (for example)."
ui_msg "If you want to disable the weekly update of the system's built-in locate,"
ui_msg "edit the file /etc/weekly.\n" }
@@ -0,0 +1,21 @@
#!/bin/sh -

# daily.slocate
#
# These are actually lines to put in /etc/daily.local (create it if it doesn't
# exist) to update the slocate database daily. You can also put the lines in
# /etc/weekly.local if you want to update the database only weekly.
# The advantage of .daily files over /etc/daily and /etc/weekly files is that
# next system update won't discard your changes.
#
if [ -x __PREFIX__/bin/slocate ]; then
echo ""
echo "Rebuilding slocate database:"
if [ -f __PREFIX__/etc/updatedb.conf ]; then
# One day, I'll look at the bug that requires doing cd / when launched
# with periodic.
(cd / && __PREFIX__/bin/slocate -u -c)
else
(cd / && __PREFIX__/bin/slocate -u)
fi
fi
@@ -0,0 +1,32 @@
--- Makefile.am Sun Dec 7 01:58:41 2003
+++ Makefile.am Sun Dec 7 01:59:23 2003
@@ -11,18 +11,13 @@
#CFLAGS = -g3

install-exec-hook:
-if FREEBSD
- -/usr/sbin/pw groupadd slocate
-else
- -/usr/sbin/groupadd slocate
-endif
$(INSTALL) -d $(DESTDIR)$(datadir)/slocate
chown root.slocate $(DESTDIR)$(bindir)/slocate
chown root.slocate $(DESTDIR)$(datadir)/slocate
chmod 2755 $(DESTDIR)$(bindir)/slocate
chmod 0750 $(DESTDIR)$(datadir)/slocate
- -ln -f -s $(DESTDIR)$(bindir)/slocate $(DESTDIR)$(bindir)/updatedb
- -ln -f -s $(DESTDIR)$(bindir)/slocate $(DESTDIR)$(bindir)/locate
+ -ln -f -s $(bindir)/slocate $(DESTDIR)$(bindir)/updatedb
+ -ln -f -s $(bindir)/slocate $(DESTDIR)$(bindir)/locate
if CRON
$(mkinstalldirs) $(DESTDIR)/etc/cron.daily/
$(INSTALL) -m 755 slocate.cron $(DESTDIR)/etc/cron.daily/slocate
@@ -32,7 +27,7 @@
endif
$(INSTALL) -m 644 doc/slocate.1.linux.gz $(DESTDIR)$(mandir)/man1/slocate.1.gz
$(INSTALL) -m 644 doc/updatedb.1.gz $(DESTDIR)$(mandir)/man1/updatedb.1.gz
- -ln -f -s $(DESTDIR)$(mandir)/man1/slocate.1.gz $(DESTDIR)$(mandir)/man1/locate.1.gz
+ -ln -f -s $(mandir)/man1/slocate.1.gz $(DESTDIR)$(mandir)/man1/locate.1.gz

uninstall:
rm -f $(DESTDIR)$(bindir)/locate
@@ -0,0 +1,11 @@
--- doc/slocate.1.linux Sun Dec 7 02:25:58 2003
+++ doc/slocate.1.linux Sun Dec 7 02:23:53 2003
@@ -40,7 +40,7 @@
Exclude files on specific file systems from the slocate database.
.TP
.I \-c
-Parse '/etc/updatedb.conf' when updating the slocate database.
+Parse '__PREFIX__/etc/updatedb.conf' when updating the slocate database.
.TP
.I \-l <level>
Security level.
@@ -0,0 +1,30 @@
--- main.c Sun Dec 7 02:14:30 2003
+++ main.c Sun Dec 7 02:20:06 2003
@@ -125,23 +125,11 @@
char **SLOCATE_PATH = NULL;

/* More fitting paths for FreeBSD -matt */
-#if defined(__FreeBSD__)
-char *SLOCATEDB = "/var/db/slocate/slocate.db";
-char *TMPSLOCATEDB = "/var/db/slocate/slocate.db.tmp";
-char *SLOCATEDB_DIR = "/var/db/slocate/";
-#elif defined(__SunOS__)
-char *SLOCATEDB = "/var/db/slocate/slocate.db";
-char *TMPSLOCATEDB = "/var/db/slocate/slocate.db.tmp";
-char *SLOCATEDB_DIR = "/var/db/slocate/";
-#undef MTAB_FILE
-#define MTAB_FILE "/etc/mnttab"
-#else
-char *SLOCATEDB = "/var/lib/slocate/slocate.db";
-char *TMPSLOCATEDB = "/var/lib/slocate/slocate.db.tmp";
-char *SLOCATEDB_DIR = "/var/lib/slocate/";
-#endif
+char *SLOCATEDB = "__PREFIX__/var/db/slocate/slocate.db";
+char *TMPSLOCATEDB = "__PREFIX__/var/db/slocate/slocate.db.tmp";
+char *SLOCATEDB_DIR = "__PREFIX__/var/db/slocate/";

-# define UPDATEDB_CONF "/etc/updatedb.conf"
+# define UPDATEDB_CONF "__PREFIX__/etc/updatedb.conf"
char *EXCLUDE_DIR=NULL;
int EXCLUDE=0;
int VERBOSE=0;

0 comments on commit 8646c77

Please sign in to comment.
You can’t perform that action at this time.