Skip to content
Permalink
Browse files

Update to 3.1

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@18730 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
pguyot committed Jul 25, 2006
1 parent 268729f commit e86565603092d5667be009f13f47c8ef8c237b4e
@@ -1,11 +1,10 @@
# $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 \
for files on your system. It uses incremental encoding just like \
@@ -18,22 +17,28 @@ long_description Secure locate provides a secure way to index and quickly search
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
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
}

pre-destroot {
@@ -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

This file was deleted.

@@ -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

This file was deleted.

This file was deleted.

@@ -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)
@@ -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)
{
@@ -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"
@@ -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;
}

0 comments on commit e865656

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