diff options
author | alexey <alexey@FreeBSD.org> | 2013-11-29 01:49:05 +0800 |
---|---|---|
committer | alexey <alexey@FreeBSD.org> | 2013-11-29 01:49:05 +0800 |
commit | c7279119f97afdcd5211831944b3e2c884d4c0a8 (patch) | |
tree | 24430bb35f15e526865f287eacd0afcbf2cac284 /net-mgmt/grepcidr | |
parent | af087a18b9672069ee8d4b867ee99f257364e16e (diff) | |
download | freebsd-ports-gnome-c7279119f97afdcd5211831944b3e2c884d4c0a8.tar.gz freebsd-ports-gnome-c7279119f97afdcd5211831944b3e2c884d4c0a8.tar.zst freebsd-ports-gnome-c7279119f97afdcd5211831944b3e2c884d4c0a8.zip |
* Update to 1.4
* STAGE support
Approved by: wg (mentor)
Diffstat (limited to 'net-mgmt/grepcidr')
-rw-r--r-- | net-mgmt/grepcidr/Makefile | 20 | ||||
-rw-r--r-- | net-mgmt/grepcidr/distinfo | 4 | ||||
-rw-r--r-- | net-mgmt/grepcidr/files/patch-grepcidr.c | 65 | ||||
-rw-r--r-- | net-mgmt/grepcidr/pkg-descr | 2 |
4 files changed, 15 insertions, 76 deletions
diff --git a/net-mgmt/grepcidr/Makefile b/net-mgmt/grepcidr/Makefile index 0ebb487d2232..8a59b2e12455 100644 --- a/net-mgmt/grepcidr/Makefile +++ b/net-mgmt/grepcidr/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= grepcidr -PORTVERSION= 1.3 -PORTREVISION= 1 +PORTVERSION= 1.4 CATEGORIES= net-mgmt textproc MASTER_SITES= http://www.pc-tools.net/files/unix/ \ ftp://ftp.renatasystems.org/pub/FreeBSD/ports/distfiles/ @@ -11,14 +10,19 @@ MASTER_SITES= http://www.pc-tools.net/files/unix/ \ MAINTAINER= alexey@renatasystems.org COMMENT= Filter IP addresses matching IPv4 CIDR/network specification -PLIST_FILES= bin/grepcidr +LICENSE= GPLv2 + +USES= gmake + +PLIST_FILES= bin/grepcidr \ + man/man1/grepcidr.1.gz -NO_STAGE= yes do-configure: - @${REINPLACE_CMD} \ - -e 's|/usr/local/bin|${PREFIX}/bin|' \ - -e 's|-s -O3 -Wall -pedantic|${CFLAGS} -DHAVE_STRING_H|' \ - -e 's|gcc|${CC}|' \ + ${REINPLACE_CMD} \ + -e 's|PREFIX=.*|PREFIX=${PREFIX}|' \ + -e 's|CFLAGS=.*|CFLAGS=${CFLAGS}|' \ + -e 's|DESTDIR=.*|DESTDIR=${STAGEDIR}|' \ + -e 's|MANDIR=.*|MANDIR=${MANPREFIX}/man|' \ ${WRKSRC}/Makefile .include <bsd.port.mk> diff --git a/net-mgmt/grepcidr/distinfo b/net-mgmt/grepcidr/distinfo index d32bbedbd199..4e553d78bf6e 100644 --- a/net-mgmt/grepcidr/distinfo +++ b/net-mgmt/grepcidr/distinfo @@ -1,2 +1,2 @@ -SHA256 (grepcidr-1.3.tar.gz) = 2bef080fe2efd9d82326fa41f3b1cca6b7ecbdac7b3c53f3db8fe0da5ab8fb81 -SIZE (grepcidr-1.3.tar.gz) = 21691 +SHA256 (grepcidr-1.4.tar.gz) = 0feca6a6905ab293d15a77ef5956bf58ae5dea8d88eb63c06c8024e9441bdb3b +SIZE (grepcidr-1.4.tar.gz) = 13806 diff --git a/net-mgmt/grepcidr/files/patch-grepcidr.c b/net-mgmt/grepcidr/files/patch-grepcidr.c deleted file mode 100644 index 8ec6e16a50e1..000000000000 --- a/net-mgmt/grepcidr/files/patch-grepcidr.c +++ /dev/null @@ -1,65 +0,0 @@ ---- ./grepcidr.c.orig 2005-04-23 18:00:16.000000000 -0400 -+++ ./grepcidr.c 2010-01-14 18:17:58.469773170 -0500 -@@ -81,13 +81,38 @@ - Convert IP address string to 32-bit integer version - Returns 0 on failure - */ --unsigned int ip_to_uint(const char* ip) -+unsigned int ip_to_uint(char** ip) - { - unsigned int IP[4]; /* 4 octets for IP address */ -- if ((sscanf(ip, "%u.%u.%u.%u", &IP[0], &IP[1], &IP[2], &IP[3]) == 4) && VALID_IP(IP)) -+ char *p = *ip; -+ char *dot; -+ -+ while (*p) { -+ while (*p && (*p < '0' || *p > '9')) -+ p++; -+ if (!*p) -+ break; -+ -+ /* speedup: check if the first digits are followed by a dot */ -+ dot = p + 1; -+ while (*dot >= '0' && *dot <='9') -+ dot++; -+ if (dot > p+3 || *dot != '.') { -+ p = dot; -+ continue; -+ } -+ -+ if ((sscanf(p, "%u.%u.%u.%u", &IP[0], &IP[1], &IP[2], &IP[3]) == 4) && VALID_IP(IP)) { -+ /* point to next possible integer */ -+ while (*p >= '0' && *p <= '9') -+ p++; -+ *ip = p; - return BUILD_IP(IP); -- else -- return 0; -+ } -+ p++; -+ } -+ *ip = p; -+ return 0; - } - - -@@ -276,7 +301,10 @@ - while (fgets(line, sizeof(line), inp_stream)) - { - struct netspec key; -- if ((key.min=ip_to_uint(line))) -+ char *ptr; -+ -+ ptr = line; -+ while ((key.min=ip_to_uint(&ptr))) - { - int match = 0; - if (bsearch(&key, array, patterns, sizeof(struct netspec), netsearch)) -@@ -288,6 +316,7 @@ - counting++; - else - printf("%s", line); -+ break; /* match only once per line */ - } - } - } diff --git a/net-mgmt/grepcidr/pkg-descr b/net-mgmt/grepcidr/pkg-descr index 5c259b52933c..f5ef5542fffd 100644 --- a/net-mgmt/grepcidr/pkg-descr +++ b/net-mgmt/grepcidr/pkg-descr @@ -11,4 +11,4 @@ filtering and processing, network security, log analysis, and many custom applications. Author: Jem Berkes -WWW: http://www.pc-tools.net/unix/grepcidr/ +WWW: http://www.pc-tools.net/unix/grepcidr/ |