diff options
Diffstat (limited to 'net-mgmt/netdisco/Makefile')
-rw-r--r-- | net-mgmt/netdisco/Makefile | 123 |
1 files changed, 62 insertions, 61 deletions
diff --git a/net-mgmt/netdisco/Makefile b/net-mgmt/netdisco/Makefile index 29f85787b225..25b168199848 100644 --- a/net-mgmt/netdisco/Makefile +++ b/net-mgmt/netdisco/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= netdisco -PORTVERSION= 1.3.2 -PORTREVISION= 1 +PORTVERSION= 1.3.3 CATEGORIES= net-mgmt www MASTER_SITES= SF @@ -26,23 +25,23 @@ RUN_DEPENDS+= p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP \ p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser \ p5-Parallel-ForkManager>=0:${PORTSDIR}/devel/p5-Parallel-ForkManager -USERS= netdisco -GROUPS= netdisco - -USES= perl5 +USES= perl5 shebangfix +USE_PERL5= run build fixpacklist USE_PGSQL= yes USE_RC_SUBR= netdisco NO_BUILD= yes -NO_STAGE= yes +NETDISCO_USER= netdisco +NETDISCO_GROUP= netdisco NETDISCO_RUNDIR=/var/run NETDISCO_DBDIR= /var/db/netdisco SUB_FILES= pkg-message -SUB_LIST= NETDISCO_DBDIR=${NETDISCO_DBDIR} NETDISCO_RUNDIR=${NETDISCO_RUNDIR} NETDISCO_USER=${USERS} NETDISCO_GROUP=${GROUPS} -PLIST_SUB= NETDISCO_DBDIR=${NETDISCO_DBDIR} NETDISCO_RUNDIR=${NETDISCO_RUNDIR} +#SUB_LIST= NETDISCO_DBDIR=${NETDISCO_DBDIR} NETDISCO_RUNDIR=${NETDISCO_RUNDIR} NETDISCO_USER=${NETDISCO_USER} NETDISCO_GROUP=${NETDISCO_GROUP} +PLIST_SUB= NETDISCO_DBDIR=${NETDISCO_DBDIR} NETDISCO_RUNDIR=${NETDISCO_RUNDIR} NETDISCO_USER=${NETDISCO_USER} +SHEBANG_FILES= bin/parse_kismet_ap netdisco WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} @@ -67,6 +66,12 @@ MIBINCLUDES:=${MIBINCLUDES:S/ /:/g:S/"//g} MIBINCLUDES="#please add here mibs dirs list (at least snmp and rfc ones)" .endif +REINPLACE_EXPR= -e 's!%%PREFIX%%!${PREFIX}!g' -e 's!%%DATADIR%%!${DATADIR}!g' \ + -e 's!%%DOCSDIR%%!${DOCSDIR}!g' -e 's!%%NETDISCO_RUNDIR%%!${NETDISCO_RUNDIR}!g' \ + -e 's!%%NETDISCO_USER%%!${NETDISCO_USER}!g' -e 's!%%NETDISCO_GROUP%%!${NETDISCO_GROUP}!g' \ + -e 's!%%NETDISCO_DBDIR%%!${NETDISCO_DBDIR}!g' -e 's!%%ETCDIR%%!${ETCDIR}!g' \ + -e 's!%%SITE_PERL%%!${SITE_PERL}!g' -e 's!%%MIBINCLUDES%%!${MIBINCLUDES}!g' + .if ${PORT_OPTIONS:MGRAPHVIZ} RUN_DEPENDS+= p5-Graph>=0:${PORTSDIR}/math/p5-Graph \ p5-GraphViz>=0:${PORTSDIR}/graphics/p5-GraphViz @@ -78,84 +83,80 @@ RUN_DEPENDS+= ${APACHE_PKGNAMEPREFIX}mod_perl2>=0:${PORTSDIR}/www/mod_perl2 \ p5-libapreq2>=0:${PORTSDIR}/www/p5-libapreq2 \ p5-MasonX-Request-WithApacheSession>=0:${PORTSDIR}/www/p5-MasonX-Request-WithApacheSession USE_APACHE_RUN= 22 +REINPLACE_EXPR+= -e 's!%%APACHEMODDIR%%!${APACHEMODDIR}!g' -e 's!%%APACHEETCDIR%%!${APACHEETCDIR}!g' \ + -e 's!%%WWWDIR%%!${WWWDIR}!g' +PLIST_SUB+= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} WEBUI="" .else -WWWDIR= "@comment " +PLIST_SUB+= WWWOWN="@comment " \ + WWWGRP="@comment " \ + WWWDIR="@comment " \ + WEBUI="@comment " .endif +USERS+= ${NETDISCO_USER} +GROUPS+= ${NETDISCO_GROUP} + pre-install: . for i in ${ALTER_FILES} @(${MV} ${WRKSRC}/${i}.bak ${WRKSRC}/${i} 2>/dev/null || ${TRUE}) . endfor cd ${WRKSRC} && \ - ${REINPLACE_CMD} -e 's#%%WWWDIR%%#${WWWDIR}#g' \ - -e 's#%%PREFIX%%#${PREFIX}#g' \ - -e 's#%%DATADIR%%#${DATADIR}#g' \ - -e 's#%%DOCSDIR%%#${DOCSDIR}#g' \ - -e 's#%%NETDISCO_RUNDIR%%#${NETDISCO_RUNDIR}#g' \ - -e 's#%%NETDISCO_USER%%#${USERS}#g' \ - -e 's#%%NETDISCO_GROUP%%#${GROUPS}#g' \ - -e 's#%%NETDISCO_DBDIR%%#${NETDISCO_DBDIR}#g' \ - -e 's#%%ETCDIR%%#${ETCDIR}#g' \ - -e 's#%%SITE_PERL%%#${SITE_PERL}#g' \ - -e 's#%%LOCALBASE%%#${LOCALBASE}#g' \ - -e 's#%%APACHEMODDIR%%#${APACHEMODDIR}#g' \ - -e 's#%%APACHEETCDIR%%#${APACHEETCDIR}#g' \ - -e 's#%%MIBINCLUDES%%#${MIBINCLUDES}#g' \ - ${ALTER_FILES} + ${REINPLACE_CMD} ${REINPLACE_EXPR} ${ALTER_FILES} do-install: . for i in netdisco bin/parse_mac bin/port_control bin/parse_kismet_ap - cd ${WRKSRC} && ${INSTALL_SCRIPT} ${i} ${PREFIX}/bin + cd ${WRKSRC} && ${INSTALL_SCRIPT} ${i} ${STAGEDIR}${PREFIX}/bin . endfor . if ${PORT_OPTIONS:MWEBUI} - ${MKDIR} ${WWWDIR} - cd ${WRKSRC}/html && ${INSTALL_DATA} autohandler *.* ${WWWDIR} + ${MKDIR} ${STAGEDIR}${WWWDIR} + cd ${WRKSRC}/html && ${INSTALL_DATA} autohandler *.* ${STAGEDIR}${WWWDIR} - ${MKDIR} ${WWWDIR}/doc - cd ${WRKSRC}/html/doc && ${INSTALL_DATA} *.* ${WWWDIR}/doc - - ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR} - - ${MKDIR} ${WWWDIR}/mason + ${MKDIR} ${STAGEDIR}${WWWDIR}/doc + cd ${WRKSRC}/html/doc && ${INSTALL_DATA} *.* ${STAGEDIR}${WWWDIR}/doc . endif - ${INSTALL_DATA} ${WRKSRC}/netdisco.pm ${SITE_PERL} - ${INSTALL} -d -m 750 -o ${USERS} -g ${GROUPS} ${ETCDIR} + ${MKDIR} -m 755 -p ${STAGEDIR}${PREFIX}/${SITE_PERL_REL} -. for i in ${CONFIG_FILES} - cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${ETCDIR}/${i}.sample - @(if [ ! -f ${ETCDIR}/${i} ]; then \ - ${INSTALL} -m 640 -o ${USERS} -g ${GROUPS} ${ETCDIR}/${i}.sample ${ETCDIR}/${i}; \ - fi) -. endfor - - ${CHOWN} -R ${USERS}:${GROUPS} ${ETCDIR} - ${CHMOD} -R 660 ${ETCDIR}/* + ${INSTALL_DATA} ${WRKSRC}/netdisco.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL} + ${INSTALL} -d -m 750 ${STAGEDIR}${ETCDIR} - ${INSTALL} -d ${DATADIR}/sql + ${INSTALL} -d ${STAGEDIR}${DATADIR}/sql cd ${WRKSRC}/sql && \ - ${INSTALL_DATA} *.sql pg ${DATADIR}/sql + ${INSTALL_DATA} *.sql pg ${STAGEDIR}${DATADIR}/sql - ${INSTALL_DATA} ${WRKSRC}/Makefile ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/Makefile ${STAGEDIR}${DATADIR} -. if !defined(PACKAGE_BUILDING) - @(if [ -d ${LOCALBASE}/${APACHEETCDIR}/Includes ] ; then \ - ${ECHO_MSG} "===> Adding config in ${LOCALBASE}/${APACHEETCDIR}/Includes..."; \ - test -L ${LOCALBASE}/${APACHEETCDIR}/Includes/netdisco_apache.conf || \ - ${LN} -s ${ETCDIR}/netdisco_apache.conf ${LOCALBASE}/${APACHEETCDIR}/Includes/netdisco_apache.conf; \ - test -L ${LOCALBASE}/${APACHEETCDIR}/Includes/netdisco_apache_dir.conf || \ - ${LN} -s ${ETCDIR}/netdisco_apache_dir.conf ${LOCALBASE}/${APACHEETCDIR}/Includes/netdisco_apache_dir.conf;\ - fi) -. endif +. for i in ${CONFIG_FILES} + ${INSTALL} -m 640 ${WRKSRC}/${i} ${STAGEDIR}${ETCDIR}/${i}.sample +. endfor post-install: -. if ${PORT_OPTIONS:MDOCS} - ${MKDIR} ${DOCSDIR} - (cd ${WRKSRC} && ${INSTALL_MAN} ${DOCFILES} ${DOCSDIR}) + ${MKDIR} ${STAGEDIR}${DOCSDIR} + (cd ${WRKSRC} && ${INSTALL_MAN} ${DOCFILES} ${STAGEDIR}${DOCSDIR}) +. if ${PORT_OPTIONS:MWEBUI} + ${ECHO_CMD} "@unexec ${RM} -rf ${WWWDIR}/mason" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${MKDIR} -m 750 ${WWWDIR}/mason" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CHOWN} -R ${WWWOWN} ${WWWDIR}/mason" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CHOWN} ${NETDISCO_USER} ${WWWDIR}" >> ${TMPPLIST} +. endif + ${ECHO_CMD} "@exec ${CHOWN} -R ${NETDISCO_USER}:${NETDISCO_GROUP} ${ETCDIR}" +. if !defined(PACKAGE_BUILDING) + @(if [ -d ${PREFIX}/${APACHEETCDIR}/Includes ] ; then \ + ${ECHO_MSG} "===> Adding config in ${PREFIX}/${APACHEETCDIR}/Includes..."; \ + test -L ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache.conf || \ + ${LN} -s ${ETCDIR}/netdisco_apache.conf ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache.conf; \ + test -L ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache_dir.conf || \ + ${LN} -s ${ETCDIR}/netdisco_apache_dir.conf ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache_dir.conf;\ + fi) . endif - @${CAT} ${PKGMESSAGE} +. for i in ${CONFIG_FILES} + cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${STAGEDIR}${ETCDIR}/${i}.sample + @(if [ ! -f ${STAGEDIR}${ETCDIR}/${i} ]; then \ + ${INSTALL} -m 640 ${STAGEDIR}${ETCDIR}/${i}.sample ${STAGEDIR}${ETCDIR}/${i}; \ + fi) +. endfor .include <bsd.port.mk> |