diff options
author | ohauer <ohauer@FreeBSD.org> | 2010-12-21 03:15:50 +0800 |
---|---|---|
committer | ohauer <ohauer@FreeBSD.org> | 2010-12-21 03:15:50 +0800 |
commit | b6db1324e57f5af5114db7aac4d325d51fae9fb4 (patch) | |
tree | c6c2c7793c1a45281a12676523cc4d2d1b7919a2 /net-mgmt | |
parent | 557687e4c66c51cc43aef095fe0c8beca89873b5 (diff) | |
download | freebsd-ports-gnome-b6db1324e57f5af5114db7aac4d325d51fae9fb4.tar.gz freebsd-ports-gnome-b6db1324e57f5af5114db7aac4d325d51fae9fb4.tar.zst freebsd-ports-gnome-b6db1324e57f5af5114db7aac4d325d51fae9fb4.zip |
- use registered user _flowd from UIDs/GIDs
- add additional MASTER_SITE
- remove pkg-install and add a workaround for the user creation
if installed from package (belongs to ports/152498 )
- add OPTIONS for PERL and PYTHON, with PERL on as default
- install tools to EXAMPLESDIR
- remove MD5 from distinfo
- fix pkg-plist "%%SITE_PERL%%/%%PERL_ARCH%%/auto" (belongs to perl not to flowd)
PR: ports/153310
Submitted by: ohauer
Approved by: Mohacsi Janos <janos.mohacsi _at_ bsd.hu> (maintainer)
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/flowd/Makefile | 35 | ||||
-rw-r--r-- | net-mgmt/flowd/distinfo | 1 | ||||
-rw-r--r-- | net-mgmt/flowd/pkg-install | 48 | ||||
-rw-r--r-- | net-mgmt/flowd/pkg-plist | 34 |
4 files changed, 48 insertions, 70 deletions
diff --git a/net-mgmt/flowd/Makefile b/net-mgmt/flowd/Makefile index ba77b4eb8af0..26c49861c737 100644 --- a/net-mgmt/flowd/Makefile +++ b/net-mgmt/flowd/Makefile @@ -7,13 +7,19 @@ PORTNAME= flowd PORTVERSION= 0.9.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt ipv6 -MASTER_SITES= http://www2.mindrot.org/files/flowd/ +MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} \ + http://www2.mindrot.org/files/flowd/ MAINTAINER= janos.mohacsi@bsd.hu COMMENT= The flowd is a small, fast and secure NetFlow collector +OPTIONS= PERL "Install flowd perl module" on \ + PYTHON "Install flowd Python support" off + +.include <bsd.port.options.mk> + GNU_CONFIGURE= yes CONFIGURE_ARGS= --localstatedir=/var USE_GMAKE= yes @@ -21,11 +27,9 @@ USE_RC_SUBR= flowd MAN8= flowd.8 flowd-reader.8 MAN5= flowd.conf.5 PORTDOCS= README INSTALL -FLOWD_USER?= _flowd -SCRIPTS_ENV+= FLOWD_USER="${FLOWD_USER}" -.if defined(FLOWD_UID) -SCRIPTS_ENV+= FLOWD_UID="${FLOWD_UID}" -.endif +FLOWD_USER= _flowd +USERS= ${FLOWD_USER} +GROUPS= ${FLOWD_USER} .if defined(WITH_PERL) USE_PERL5= yes @@ -60,8 +64,16 @@ pre-extract: post-patch: @${REINPLACE_CMD} -e "s;%%FLOWD_USER%%;${FLOWD_USER};g" \ ${WRKSRC}/flowd.h + ${REINPLACE_CMD} -i '' -e 's|/usr/bin/perl|${PERL}|' \ + ${WRKSRC}/tools/flowinsert.pl \ + ${WRKSRC}/tools/wormsuspects.pl post-install: +# XXX Workaround: can be removed if the bug described in ports/152498 is fixed! + @${EGREP} -e '^@exec.*${PW}' -e '^@exec ${INSTALL} -d -g' ${TMPPLIST} > ${WRKDIR}/.PLIST.ugid + @${EGREP} -v -e '^@exec.*${PW}' -e '^@exec ${INSTALL} -d -g' ${TMPPLIST} >> ${WRKDIR}/.PLIST.ugid + @${MV} -v ${WRKDIR}/.PLIST.ugid ${TMPPLIST} + .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} @@ -69,10 +81,10 @@ post-install: .if defined(WITH_PERL) cd ${WRKSRC}/Flowd-perl && \ - ${PERL} Makefile.PL INSTALLSITEMAN3DIR=${MAN3PREFIX}/man/man3 && \ + ${PERL} Makefile.PL INSTALLSITEMAN3DIR=${MAN3PREFIX}/man/man3 PREFIX=${PREFIX} && \ ${GMAKE} && \ ${GMAKE} install; - -@${RM} -f ${SITE_PERL}/${PERL_ARCH}/perllocal.pod + -@${RM} -f ${PREFIX}/lib/perl5/${PERL_VERSION}/${PERL_ARCH}/perllocal.pod .endif .if defined(WITH_PYTHON) @@ -81,6 +93,9 @@ post-install: ${PYTHON_CMD} setup.py install .endif - @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.if !defined(NOPORTEXAMPLES) + ${MKDIR} ${EXAMPLESDIR} + @( cd ${WRKSRC}/tools && ${COPYTREE_SHARE} \* ${EXAMPLESDIR}/ ) +.endif .include <bsd.port.mk> diff --git a/net-mgmt/flowd/distinfo b/net-mgmt/flowd/distinfo index f9980fd70d5e..49d6361d7ca4 100644 --- a/net-mgmt/flowd/distinfo +++ b/net-mgmt/flowd/distinfo @@ -1,3 +1,2 @@ -MD5 (flowd-0.9.1.tar.gz) = a3d0512b5e6d9c7d9e749d9894376ea4 SHA256 (flowd-0.9.1.tar.gz) = 3ce5e0bbf93b69b5de16b9ea644b38b8591948aadabfbbd6165a7ae505ccc10c SIZE (flowd-0.9.1.tar.gz) = 187483 diff --git a/net-mgmt/flowd/pkg-install b/net-mgmt/flowd/pkg-install deleted file mode 100644 index 729842125713..000000000000 --- a/net-mgmt/flowd/pkg-install +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# Based on cyrus-sasl2 port -# -# create 'flowd' user -# - -create_user() { - USER=${FLOWD_USER} - GROUP=nobody - PW=/usr/sbin/pw - - if [ -x /usr/sbin/nologin ]; then - shell=/usr/sbin/nologin - elif [ -x /sbin/nologin ]; then - shell=/sbin/nologin - else - shell=/nonexistent - fi - uhome="/var/empty" - if [ -z "${FLOWD_UID}" ]; then - uid=`${PW} usernext`; - uid=${uid%%:*} - else - uid=${FLOWD_UID} - fi - - if ! ${PW} show user ${USER} -q >/dev/null; then - if ! ${PW} add user ${USER} -u ${uid} -g ${GROUP} -d "${uhome}" \ - -c "flowd privilege separation user" -s "${shell}" -p "*" \ - ; then - e=$? - echo "*** Failed to add user \`${USER}'. Please add it manually." - exit ${e} - fi - echo "*** Added user \`${USER}' (id ${uid})" - else - echo "*** You already have user \`${USER} (id `id -u ${USER}`)'." - fi -} - -case $2 in - POST-INSTALL) - create_user - ;; -esac diff --git a/net-mgmt/flowd/pkg-plist b/net-mgmt/flowd/pkg-plist index d5c3f47d6799..6c65956dd9ac 100644 --- a/net-mgmt/flowd/pkg-plist +++ b/net-mgmt/flowd/pkg-plist @@ -1,19 +1,31 @@ bin/flowd-reader etc/flowd.conf.sample -lib/libflowd.a include/flowd/addr.h include/flowd/crc32.h -include/flowd/store.h -include/flowd/store-v2.h -include/flowd/flowd-pytypes.h -include/flowd/flowd-config.h include/flowd/flowd-common.h -sbin/flowd -%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd/Flowd.so -%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd/Flowd.bs -%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd/.packlist +include/flowd/flowd-config.h +include/flowd/flowd-pytypes.h +include/flowd/store-v2.h +include/flowd/store.h +lib/libflowd.a %%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/Flowd.pm -%%WITH_PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd -%%WITH_PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto +%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd/.packlist +%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd/Flowd.bs +%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd/Flowd.so %%WITH_PYTHON%%%%PYTHON_SITELIBDIR%%/flowd.so +sbin/flowd +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/README.tools +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowinsert.pl +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/bytes.html +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/flow_rrd.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/flows.html +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/packets.html +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flowrrd/plot.sh +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/flows.sql +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sockclient.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/stats.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/wormsuspects.pl +%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%/flowrrd +%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%% +%%WITH_PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Flowd @dirrm include/flowd |