Index: trunk/dports/sysutils/slocate/Portfile
===================================================================
--- trunk/dports/sysutils/slocate/Portfile	(revision 18729)
+++ trunk/dports/sysutils/slocate/Portfile	(revision 18730)
@@ -1,10 +1,9 @@
-# $Id: Portfile,v 1.3 2005/08/07 00:21:49 pguyot Exp $
+# $Id: Portfile,v 1.4 2006/07/25 15:25:41 pguyot Exp $
 
 PortSystem			1.0
 name				slocate
-version				2.7
-revision			2
+version				3.1
 categories			sysutils
-homepage			http://www.geekreview.org/slocate/
+homepage			http://slocate.trakker.ca/
 description			Secure Locate is a replacement for locate.
 long_description	Secure locate provides a secure way to index and quickly search \
@@ -19,20 +18,26 @@
 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
-configure.args		--mandir=${prefix}/share/man/
+master_sites		http://slocate.trakker.ca/files/
+checksums      		md5 908e6949d959ae7b686c10bb76b35bf3 \
+					sha1 e427552664385b86931b7626c26bd95ae5f9f085 \
+					rmd160 d3b1e818cc35ce8e87ec1b0764f6b2145a319e13
+patchfiles			patch-Makefile \
+					patch-src-Makefile \
+					patch-src-conf.c \
+					patch-src-slocate.h \
+					patch-src-utils.c \
+					patch-doc-slocate.1
 
-pre-patch {
-	system "gzip -d ${worksrcpath}/doc/slocate.1.linux.gz"
-}
+use_configure		no
 
 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"
+	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/src/slocate.h
+	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/doc/slocate.1
+	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/src/Makefile
+	reinplace "s|__DESTROOT__|${destroot}|g" ${worksrcpath}/src/Makefile
+	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Makefile
+	reinplace "s|__DESTROOT__|${destroot}|g" ${worksrcpath}/Makefile
+	reinplace "s|__USER__|${install.user}|g" ${worksrcpath}/Makefile
+	reinplace "s|__GROUP__|${install.group}|g" ${worksrcpath}/Makefile
 }
 
Index: trunk/dports/sysutils/slocate/files/patch-Makefile
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-Makefile	(revision 18730)
+++ trunk/dports/sysutils/slocate/files/patch-Makefile	(revision 18730)
@@ -0,0 +1,18 @@
+--- Makefile.orig	2006-07-26 00:11:02.000000000 +0900
++++ Makefile	2006-07-26 00:10:59.000000000 +0900
+@@ -2,12 +2,12 @@
+ 	make -C src
+ install:
+ 	make -C src install
+-	install -d -m 0755 /usr/local/man/man1
+-	install -m 0644 -o root -g root doc/slocate.1 /usr/local/man/man1
++	install -d -m 0755 __DESTROOT__/__PREFIX__/share/man/man1
++	install -m 0644 -o __USER__ -g __GROUP__ doc/slocate.1 __DESTROOT__/__PREFIX__/share/man/man1
+ 	
+ uninstall:
+ 	make -C src uninstall
+-	rm -f /usr/local/man/man1/slocate.1
++	rm -f __DESTROOT__/__PREFIX__/share/man/man1/slocate.1
+ 
+ clean:
+ 	make -C src clean
Index: trunk/dports/sysutils/slocate/files/patch-Makefile.am
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-Makefile.am	(revision 18729)
+++ 	(revision )
@@ -1,32 +1,0 @@
---- 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
Index: trunk/dports/sysutils/slocate/files/patch-doc-slocate.1
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-doc-slocate.1	(revision 18730)
+++ trunk/dports/sysutils/slocate/files/patch-doc-slocate.1	(revision 18730)
@@ -0,0 +1,20 @@
+--- doc/slocate.1.orig	2006-07-25 23:56:30.000000000 +0900
++++ doc/slocate.1	2006-07-25 23:57:11.000000000 +0900
+@@ -41,7 +41,7 @@
+ Exclude files on specific file systems from the slocate database.
+ .TP
+ .I \-c
+-Parse '/etc/updatedb.conf' when updating the slocate database. (see 
++Parse '__PREFIX__/etc/updatedb.conf' when updating the slocate database. (see 
+ .SM
+ .B CONFIGURATION FILE
+ below).
+@@ -91,7 +91,7 @@
+ 	Colon-separated list of databases to search.
+ .SH CONFIGURATION FILE
+ Secure Locate will parse GNU Locate's 
+-.I /etc/updatedb.conf
++.I __PREFIX__/etc/updatedb.conf
+ when the 
+ .I-c
+ argument is provided. But please be aware that Secure Locate currently
Index: trunk/dports/sysutils/slocate/files/patch-doc-slocate.1.linux
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-doc-slocate.1.linux	(revision 18729)
+++ 	(revision )
@@ -1,11 +1,0 @@
---- 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.
Index: trunk/dports/sysutils/slocate/files/patch-main.c
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-main.c	(revision 18729)
+++ 	(revision )
@@ -1,39 +1,0 @@
---- main.c.orig	2005-06-20 15:29:38.000000000 +0900
-+++ main.c	2005-06-20 15:30:16.000000000 +0900
-@@ -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;
-@@ -1031,7 +1019,7 @@
- 	*dirchk = dirstr;
- 	dirchk[1] = NULL;
- 	
--	dir = fts_open(dirchk,FTS_PHYSICAL,NULL);
-+	dir = fts_open(dirchk,FTS_PHYSICAL|FTS_NOCHDIR,NULL);
- 	
- 	/* If fts_open failes, report and exit */
- 	if (!dir)
Index: trunk/dports/sysutils/slocate/files/patch-src-Makefile
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-src-Makefile	(revision 18730)
+++ trunk/dports/sysutils/slocate/files/patch-src-Makefile	(revision 18730)
@@ -0,0 +1,16 @@
+--- src/Makefile.orig	2006-07-25 23:51:01.000000000 +0900
++++ src/Makefile	2006-07-25 23:51:43.000000000 +0900
+@@ -16,11 +16,10 @@
+ 	$(CC) -c $(CFLAGS) -o $@ $<
+ 
+ install:
+-	-groupadd slocate
+-	install -m 2755 -o root -g slocate slocate /usr/local/bin/
++	install -m 2755 -o root -g slocate slocate __DESTROOT__/__PREFIX__/bin
+ 	
+ uninstall:
+-	rm -f /usr/local/bin/slocate
++	rm -f __DESTROOT__/__PREFIX__/bin/slocate
+ 	
+ clean:
+ 	rm -f $(PROG) $(OBJS)
Index: trunk/dports/sysutils/slocate/files/patch-src-conf.c
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-src-conf.c	(revision 18730)
+++ trunk/dports/sysutils/slocate/files/patch-src-conf.c	(revision 18730)
@@ -0,0 +1,16 @@
+--- src/conf.c.orig	2006-07-26 00:04:39.000000000 +0900
++++ src/conf.c	2006-07-26 00:06:07.000000000 +0900
+@@ -26,6 +26,13 @@
+ #include "utils.h"
+ #include "cmds.h"
+ 
++char* strndup(const char* ptr, size_t n)
++{
++	char* result = (char*) malloc(n);
++	strncpy(result, ptr, n-1);
++	result[n] = 0;
++	return result;
++}
+ 
+ char * get_next_char(char ch, char *ptr)
+ {
Index: trunk/dports/sysutils/slocate/files/patch-src-slocate.h
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-src-slocate.h	(revision 18730)
+++ trunk/dports/sysutils/slocate/files/patch-src-slocate.h	(revision 18730)
@@ -0,0 +1,27 @@
+--- src/slocate.h.orig	2006-07-25 23:54:44.000000000 +0900
++++ src/slocate.h	2006-07-25 23:55:28.000000000 +0900
+@@ -32,20 +32,12 @@
+ /* Printable version of WARN_SECONDS.  */
+ #define WARN_MESSAGE "8 days"
+ 
+-#define MTAB_FILE "/etc/mtab"
+-#define UPDATEDB_FILE "/etc/updatedb.conf"
++#define MTAB_FILE "__PREFIX__/etc/mtab"
++#define UPDATEDB_FILE "__PREFIX__/etc/updatedb.conf"
+ 
+ /* More fitting paths for FreeBSD -matt */
+-#if defined(__FreeBSD__)
+-# define DEFAULT_DB "/var/db/slocate/slocate.db"
+-# define DEFAULT_DB_DIR "/var/db/slocate/"
+-#elif defined(__SunOS__)
+-# define DEFAULT_DB "/var/db/slocate/slocate.db"
+-# define DEFAULT_DB_DIR "/var/db/slocate/"
+-#else
+-# define DEFAULT_DB "/var/lib/slocate/slocate.db"
+-# define DEFAULT_DB_DIR "/var/lib/slocate/"
+-#endif
++# define DEFAULT_DB "__PREFIX__/var/db/slocate/slocate.db"
++# define DEFAULT_DB_DIR "__PREFIX__/var/db/slocate/"
+ 
+ #define DB_UID 0
+ #define DB_GROUP "slocate"
Index: trunk/dports/sysutils/slocate/files/patch-src-utils.c
===================================================================
--- trunk/dports/sysutils/slocate/files/patch-src-utils.c	(revision 18730)
+++ trunk/dports/sysutils/slocate/files/patch-src-utils.c	(revision 18730)
@@ -0,0 +1,20 @@
+--- src/utils.c.orig	2006-07-26 00:06:53.000000000 +0900
++++ src/utils.c	2006-07-26 00:08:07.000000000 +0900
+@@ -139,6 +139,7 @@
+ 	    ret = 1;		
+ 
+ EXIT:
++#ifndef FNM_CASEFOLD
+ 	if (nocase_str)
+ 	    free(nocase_str);
+ 	nocase_str = NULL;
+@@ -147,7 +148,8 @@
+ 	    free(nocase_path);
+ 	
+ 	nocase_path = NULL;
+-	
++#endif
++
+ 	return ret;
+ }
+ 
