aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2014-07-09 19:13:29 +0800
committertijl <tijl@FreeBSD.org>2014-07-09 19:13:29 +0800
commit27b0641f93b2f49f5afbb29d01bae559acb8597c (patch)
treeedd5ef7ed042dc90c475f5365f8ec87b49bc90a8 /net-mgmt
parentf553583f5c5a950c4befbd52f5fc9090f9e807dd (diff)
downloadfreebsd-ports-gnome-27b0641f93b2f49f5afbb29d01bae559acb8597c.tar.gz
freebsd-ports-gnome-27b0641f93b2f49f5afbb29d01bae559acb8597c.tar.zst
freebsd-ports-gnome-27b0641f93b2f49f5afbb29d01bae559acb8597c.zip
- Add USES=libtool
- Add INSTALL_TARGET=install-strip - Replace pkg-install and pkg-deinstall with USERS, GROUPS and pkg-plist commands - Use ETCDIR
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/flow-tools-ng/Makefile32
-rw-r--r--net-mgmt/flow-tools-ng/files/pkg-deinstall.in37
-rw-r--r--net-mgmt/flow-tools-ng/files/pkg-install.in81
-rw-r--r--net-mgmt/flow-tools-ng/pkg-plist39
4 files changed, 40 insertions, 149 deletions
diff --git a/net-mgmt/flow-tools-ng/Makefile b/net-mgmt/flow-tools-ng/Makefile
index 514939dbda14..9c82889740b8 100644
--- a/net-mgmt/flow-tools-ng/Makefile
+++ b/net-mgmt/flow-tools-ng/Makefile
@@ -3,6 +3,7 @@
PORTNAME= flow-tools
PORTVERSION= 0.68.5.1
+PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
PKGNAMESUFFIX= -ng
@@ -25,39 +26,34 @@ OPENSSL_USE= OPENSSL=yes
CONFLICTS= flow-tools-[0-9]*
-USES= gmake tar:bzip2
+USES= gmake libtool tar:bzip2
+USE_LDCONFIG= yes
USE_PYTHON_RUN= yes
GNU_CONFIGURE= yes
-CONFIGURE_ARGS+=--localstatedir="${PREFIX}"
-USE_LDCONFIG= Yes
+INSTALL_TARGET= install-strip
-SUB_FILES= pkg-install pkg-deinstall
+PLIST_SUB= RESETPREFIX=${PREFIX}
SUB_LIST= FLOW_CAPTURE_SPOOL="${FLOW_CAPTURE_SPOOL}" \
- FLOW_CAPTURE_USER="${FLOW_CAPTURE_USER}" \
- FLOW_CAPTURE_GROUP="${FLOW_CAPTURE_GROUP}" \
- FLOW_CAPTURE_UID="${FLOW_CAPTURE_UID}" \
- FLOW_CAPTURE_GID="${FLOW_CAPTURE_GID}" \
FLOW_CAPTURE_PIDDIR="${FLOW_CAPTURE_PIDDIR}"
USE_RC_SUBR= flow_capture flow_fanout
-VARDIR?= /var
-FLOW_CAPTURE_SPOOL= ${VARDIR}/db/flows
-FLOW_CAPTURE_USER= flowtools
-FLOW_CAPTURE_GROUP= flowtools
-FLOW_CAPTURE_UID= 174
-FLOW_CAPTURE_GID= 174
-FLOW_CAPTURE_PIDDIR= ${VARDIR}/run/flow-capture
+FLOW_CAPTURE_SPOOL= /var/db/flows
+FLOW_CAPTURE_PIDDIR= /var/run/flow-capture
+
+USERS= flowtools
+GROUPS= flowtools
post-patch:
@${REINPLACE_CMD}\
- -e 's|@sysconfdir@/sym/|${PREFIX}/share/flow-tools/|' \
- -e 's|@sysconfdir@/cfg/|${PREFIX}/etc/flow-tools/|' \
+ -e 's|@sysconfdir@/sym/|${ETCDIR}/|' \
+ -e 's|@sysconfdir@/cfg/|${ETCDIR}/|' \
${WRKSRC}/docs/flow-*.1.in ${WRKSRC}/docs/flow-*.html.in
@${REINPLACE_CMD} -e 's|!/bin/env|!/usr/bin/env|' \
${WRKSRC}/bin/* ${WRKSRC}/utils/*
post-install:
+ ${MKDIR} ${STAGEDIR}${FLOW_CAPTURE_SPOOL}
+ ${MKDIR} ${STAGEDIR}${FLOW_CAPTURE_PIDDIR}
${INSTALL_MAN} ${WRKSRC}/docs/*.1 ${STAGEDIR}${PREFIX}/man/man1/
- ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libft.so.0
.include <bsd.port.mk>
diff --git a/net-mgmt/flow-tools-ng/files/pkg-deinstall.in b/net-mgmt/flow-tools-ng/files/pkg-deinstall.in
deleted file mode 100644
index cbc04bea3005..000000000000
--- a/net-mgmt/flow-tools-ng/files/pkg-deinstall.in
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
-
-FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
-FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
-FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
-FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
-
-post-deinstall() {
- rmdir ${FLOW_CAPTURE_SPOOL} > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "WARNING: If you will NOT use this package anymore, please"
- echo " remove the following directory manually:"
- echo " ${FLOW_CAPTURE_SPOOL}"
- echo
- echo "Also flow-tools related user accounts and groups were not"
- echo "removed (${FLOW_CAPTURE_USER}:${FLOW_CAPTURE_GROUP})."
- echo "Do it manually, if needed."
- echo
- fi
-
-#
-# Remove pid directory
-#
- rm -rf ${FLOW_CAPTURE_PIDDIR} > /dev/null 2>&1
-}
-
-
-case $2 in
- POST-DEINSTALL)
- post-deinstall
- ;;
-esac
diff --git a/net-mgmt/flow-tools-ng/files/pkg-install.in b/net-mgmt/flow-tools-ng/files/pkg-install.in
deleted file mode 100644
index 3efd6d271982..000000000000
--- a/net-mgmt/flow-tools-ng/files/pkg-install.in
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
-
-FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
-FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
-FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
-FLOW_CAPTURE_UID="%%FLOW_CAPTURE_UID%%"
-FLOW_CAPTURE_GID="%%FLOW_CAPTURE_GID%%"
-FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
-
-if [ -x /usr/sbin/nologin ]; then
- NOLOGIN=/usr/sbin/nologin
-else
- NOLOGIN=/sbin/nologin
-fi
-
-pre-install() {
-#
-# Create group
-#
- pw groupshow ${FLOW_CAPTURE_GROUP} > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo -n "Creating '${FLOW_CAPTURE_GROUP}' group... "
- pw groupadd -n ${FLOW_CAPTURE_GROUP} -g ${FLOW_CAPTURE_GID} -q
-
- if [ $? -eq 0 ]; then
- echo "ok"
- else
- echo "failed"
- echo "Cannot create group '${FLOW_CAPTURE_GROUP}'" >&2
- echo "Please, create it manually." >&2
- exit 1
- fi
- else
- echo "Using existing group '${FLOW_CAPTURE_GROUP}'"
- fi
-
-#
-# Create user
-#
- pw usershow ${FLOW_CAPTURE_USER} > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo -n "Creating '${FLOW_CAPTURE_USER}' user... "
- pw useradd -n ${FLOW_CAPTURE_USER} -g ${FLOW_CAPTURE_GROUP} \
- -u ${FLOW_CAPTURE_UID} \
- -c "Flow-tools collector pseudo-user" \
- -d "/var/empty" -s "${NOLOGIN}" -h - -q
-
- if [ $? -eq 0 ]; then
- echo "ok"
- else
- echo "failed"
- echo "Cannot create user '${FLOW_CAPTURE_USER}'" >&2
- echo "Please, create it manually." >&2
- exit 1
- fi
- else
- echo "Using existing group '${FLOW_CAPTURE_USER}'"
- fi
-}
-
-post-install() {
- /usr/bin/install -d -m 700 -o ${FLOW_CAPTURE_USER} \
- -g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_PIDDIR}
- /usr/bin/install -d -m 1700 -o ${FLOW_CAPTURE_USER} \
- -g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_SPOOL}
-}
-
-
-case $2 in
- PRE-INSTALL)
- pre-install
- ;;
- POST-INSTALL)
- post-install
- ;;
-esac
diff --git a/net-mgmt/flow-tools-ng/pkg-plist b/net-mgmt/flow-tools-ng/pkg-plist
index ea57ae8655bc..cbfa02c9dd4c 100644
--- a/net-mgmt/flow-tools-ng/pkg-plist
+++ b/net-mgmt/flow-tools-ng/pkg-plist
@@ -22,23 +22,23 @@ bin/flow-split
bin/flow-stat
bin/flow-tag
bin/flow-xlate
-etc/flow-tools/asn.sym
-etc/flow-tools/filter.cfg
-etc/flow-tools/ip-prot.sym
-etc/flow-tools/ip-type.sym
-etc/flow-tools/map.cfg
-etc/flow-tools/mask.cfg
-etc/flow-tools/stat.cfg
-etc/flow-tools/tag.cfg
-etc/flow-tools/tag.sym
-etc/flow-tools/tcp-port.sym
-etc/flow-tools/xlate.cfg
+%%ETCDIR%%/asn.sym
+%%ETCDIR%%/filter.cfg
+%%ETCDIR%%/ip-prot.sym
+%%ETCDIR%%/ip-type.sym
+%%ETCDIR%%/map.cfg
+%%ETCDIR%%/mask.cfg
+%%ETCDIR%%/stat.cfg
+%%ETCDIR%%/tag.cfg
+%%ETCDIR%%/tag.sym
+%%ETCDIR%%/tcp-port.sym
+%%ETCDIR%%/xlate.cfg
include/ftlib.h
include/ftqueue.h
lib/libft.a
-lib/libft.la
lib/libft.so
lib/libft.so.0
+lib/libft.so.0.0.0
man/man1/flow-capture.1.gz
man/man1/flow-cat.1.gz
man/man1/flow-dscan.1.gz
@@ -70,4 +70,17 @@ man/man1/flow-rpt2rrd.1.gz
%%DATADIR%%/gprot
%%DATADIR%%/gserv
@dirrmtry %%DATADIR%%
-@dirrmtry etc/flow-tools
+@dirrmtry %%ETCDIR%%
+@cwd /var
+@exec install -d -o flowtools -g flowtools -m 1700 %D/db/flows
+@exec install -d -o flowtools -g flowtools -m 700 %D/run/flow-capture
+@owner flowtools
+@group flowtools
+@mode 700
+@dirrmtry run/flow-capture
+@mode 1700
+@dirrmtry db/flows
+@owner
+@group
+@mode
+@cwd %%RESETPREFIX%%