diff options
author | beech <beech@FreeBSD.org> | 2008-05-08 18:16:04 +0800 |
---|---|---|
committer | beech <beech@FreeBSD.org> | 2008-05-08 18:16:04 +0800 |
commit | 4300c14941a2c5cb262184657a09cfa3aa1f0655 (patch) | |
tree | 3d7be5afcebe85a66498ee9acbb4a2268b045f72 /net-mgmt/netams | |
parent | ec68a9793f63a3e8593062c443e1fe6a1d5a9880 (diff) | |
download | freebsd-ports-gnome-4300c14941a2c5cb262184657a09cfa3aa1f0655.tar.gz freebsd-ports-gnome-4300c14941a2c5cb262184657a09cfa3aa1f0655.tar.zst freebsd-ports-gnome-4300c14941a2c5cb262184657a09cfa3aa1f0655.zip |
- Update to 3.4.1rc1
- Fix options
- Add package creation
- Use SF macro
PR: ports/123492
Submitted by: Yarodin <yarodin@gmail.com>
Reviewed by: Yuriy Shkandybin <jura@netams.com> (maintainer)
Diffstat (limited to 'net-mgmt/netams')
-rw-r--r-- | net-mgmt/netams/Makefile | 221 | ||||
-rw-r--r-- | net-mgmt/netams/distinfo | 6 | ||||
-rw-r--r-- | net-mgmt/netams/files/netams.in | 2 | ||||
-rw-r--r-- | net-mgmt/netams/files/pkg-message.in | 16 | ||||
-rw-r--r-- | net-mgmt/netams/pkg-plist | 46 |
5 files changed, 195 insertions, 96 deletions
diff --git a/net-mgmt/netams/Makefile b/net-mgmt/netams/Makefile index d9460b88e0eb..def106d89441 100644 --- a/net-mgmt/netams/Makefile +++ b/net-mgmt/netams/Makefile @@ -6,90 +6,241 @@ # PORTNAME= netams -DISTVERSION= 3.4.0rc2 +DISTVERSION= 3.4.1rc1 CATEGORIES= net-mgmt -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ - http://www.netams.com/files/ -MASTER_SITE_SUBDIR= ${PORTNAME} +MASTER_SITES= http://www.netams.com/files/ \ + SF MAINTAINER= jura@netams.com COMMENT= Network Traffic Accounting and Monitoring Software -NO_PACKAGE= Depends on installed SQL database - USE_SUBMAKE= yes USE_RC_SUBR= netams MANCOMPRESSED= no - SUB_FILES= pkg-message +OPTIONS= DEBUG "Build with debug symbols" off \ + BW "Build with bandwidth limitation functionality" on \ + HASH "Build with HASH storage support" off \ + MYSQL "Build with MySQL storage support" on \ + POSTGRESQL "Build with PostgreSQL storage support" off \ + FREERADIUS "Build with FreeRadius and rlm module" off \ + CGI "Install admin/user CGI scripts" off + SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ PREFIX="${PREFIX}" \ TOUCH="${TOUCH}" \ MKDIR="${MKDIR}" \ REALCURDIR="${.CURDIR}" -ADMINCGI= .htaccess index.cgi policy.cgi showusercard.cgi user.cgi \ - access.cgi login.cgi quota.cgi showusercard.tmpl view.cgi \ - account.cgi netams.cgi radius.cgi subplan.cgi config.cgi \ - plan.cgi russian.res unit.cgi cardtool.cgi -CGI= .htaccess config.cgi netams_api.pl russian.res \ - netams_example.cgi usertool.cgi admintool.cgi login.cgi \ - netams_graph.cgi activate.cgi activate.tmpl -IMAGES= logo.gif logo_sm.jpg admintool-logo.gif showtable-logo.gif +ADMINCGI= .htaccess access.cgi account.cgi billing_users_table.sql cardtool.cgi \ + config.cgi graph.cgi index.cgi login.cgi monitor.cgi netams.cgi \ + plan.cgi policy.cgi quota.cgi radius.cgi rrdgraph.cgi russian.res \ + showusercard.cgi showusercard.tmpl statistic.cgi subplan.cgi unit.cgi \ + user.cgi view.cgi +USERCGI= .htaccess activate.cgi activate.tmpl admintool.cgi config.cgi \ + login.cgi netams_api.pl netams_example.cgi netams_graph.cgi \ + netams_html.cgi russian.res statistic.pl usertool.cgi +IMAGES= admintool-logo.gif logo-small.gif logo.gif logo_sm.jpg rrdgraph-logo.gif \ + showtable-logo.gif MAN8= netams.8 flowprobe.8 netamsctl.8 -OPTIONS= DEBUG "Build with debug symbols" off \ - BW "Build with bandwidth limitation functionality" off \ - HASH "Build with HASH support" off - .include <bsd.port.pre.mk> -post-patch: -.if defined(WITHOUT_DEBUG) - @${REINPLACE_CMD} -e 's|configure.sh|configure.sh -nodebug|' \ +PLIST_FILES+= etc/netams.conf.sample \ + libexec/netams \ + sbin/flowprobe \ + sbin/ipfw2netflow \ + sbin/ascii2netflow \ + bin/netamsctl \ + %%DATADIR%%/ru-networks.txt.sample \ + %%DATADIR%%/.netamsctl.rc \ + %%DATADIR%%/netams-netgraphctl.sh \ + %%DATADIR%%/netams-startup-failover.sh \ + %%DATADIR%%/ua-networks-get.sh \ + %%DATADIR%%/snmp2netams.pl \ + %%DATADIR%%/subnet-sum.c \ + %%DATADIR%%/TODO.txt + +.if defined(WITH_MYSQL) +USE_MYSQL= yes +BROKEN_WITH_MYSQL= 323 +PLIST_FILES+= %%DATADIR%%/cardtool_schema.sql \ + %%DATADIR%%/mysql_rotate.pl +.endif + +.if defined(WITH_POSTGRESQL) +USE_PGSQL= yes +PLIST_FILES+= %%DATADIR%%/cardtool_schema-Pg.sql \ + %%DATADIR%%/postgresql_schema.sql +.endif + +.if defined(WITH_FREERADIUS) +FREERADIUS_VERSION=`${CAT} ${PORTSDIR}/net/freeradius/Makefile|grep PORTVERSION?=|${SED} -n 's|PORTVERSION?=[^0-9]*\([0-9\.]*\)|\1|p'` +RUN_DEPENDS+= freeradius>=1.1.7:${PORTSDIR}/net/freeradius +PLIST_FILES+= lib/rlm_netams.a \ + lib/rlm_netams.la \ + lib/rlm_netams.so \ + lib/rlm_netams-${FREERADIUS_VERSION}.la \ + lib/rlm_netams-${FREERADIUS_VERSION}.so \ + %%DATADIR%%/README.radius +.endif + +.if defined(WITH_CGI) +USE_APACHE= 1.3+ +USE_PERL5= yes +.for f in ${IMAGES} +PLIST_FILES+= %%WWWDIR%%/cgi-bin/images/${f} +.endfor +.for f in ${USERCGI} +PLIST_FILES+= %%WWWDIR%%/cgi-bin/${f} +.endfor +.for f in ${ADMINCGI} +PLIST_FILES+= %%WWWDIR%%/cgi-bin/admin/${f} +.endfor +PLIST_FILES+= %%WWWDIR%%/index.html \ + %%DATADIR%%/httpd.conf +.endif + +PLIST_FILES+= "@unexec ${RMDIR} %D/www/netams/cgi-bin/images 2>/dev/null || ${TRUE}" \ + "@unexec ${RMDIR} %D/www/netams/cgi-bin/admin 2>/dev/null || ${TRUE}" \ + "@unexec ${RMDIR} %D/www/netams/cgi-bin 2>/dev/null || ${TRUE}" \ + "@unexec ${RMDIR} %D/www/netams 2>/dev/null || ${TRUE}" \ + "@unexec ${RMDIR} %D/share/netams 2>/dev/null || ${TRUE}" + +pre-patch: +.if defined(WITH_DEBUG) + @${REINPLACE_CMD} -e 's|#\(echo.*Memory_debug.*DEFINE += -DMEMORY_DEBUG.*\)|\1|' \ + ${WRKSRC}/configure.sh + @${REINPLACE_CMD} -e 's|#\(echo.*Mutex_debug.*DEFINE += -DMUTEX_DEBUG.*\)|\1|' \ + ${WRKSRC}/configure.sh +.else + @${REINPLACE_CMD} -e 's|.*sh configure.sh|& -nodebug|' \ ${WRKSRC}/Makefile .endif -.if defined(WITH_BW) - @${REINPLACE_CMD} -e 's|#DEFINE += -DHAVE_BW|DEFINE += -DHAVE_BW|' \ +.if defined(WITHOUT_BW) + @${REINPLACE_CMD} -e 's|.*BW_limit.*DEFINE += -DHAVE_BW.*|#&|' \ ${WRKSRC}/configure.sh .endif .if defined(WITH_HASH) - @${REINPLACE_CMD} -e 's|#DEFINE += -DUSE_HASH|DEFINE += -DUSE_HASH|' \ + @${REINPLACE_CMD} -e 's|#\(echo.*Hash_database.*DEFINE += -DUSE_HASH.*\)|\1|' \ ${WRKSRC}/configure.sh .endif + @${REINPLACE_CMD} -e 's|^CC.*|CC=${CXX}|; s|^CPP.*|CPP=${CXX}|' \ - ${WRKSRC}/src/Makefile + ${WRKSRC}/src/Makefile @${REINPLACE_CMD} -e 's|^CC.*|CC=${CC}|; s|^CPP.*|CPP=${CXX}|' \ - ${WRKSRC}/lib/Makefile \ - ${WRKSRC}/lib/libipulog/Makefile + ${WRKSRC}/lib/Makefile \ + ${WRKSRC}/lib/libipulog/Makefile + +.if defined(WITHOUT_MYSQL) + @${REINPLACE_CMD} -e 's|locate_file "libmysqlclient\.so".*|v1="" \&\& v2=""|' \ + ${WRKSRC}/configure.sh +.endif + +.if defined(WITHOUT_POSTGRESQL) + @${REINPLACE_CMD} -e 's|locate_file "libpq\.so".*|v1="" \&\& v2=""|' \ + ${WRKSRC}/configure.sh +.endif + +.if defined(WITHOUT_FREERADIUS) + @${REINPLACE_CMD} -e 's|locate_file "openssl\/md5\.h".*|v1=""|; s|echo "No RADIUS support.*|| ' \ + ${WRKSRC}/configure.sh +.endif + +pre-install: +.if defined(WITH_FREERADIUS) + @cd ${PORTSDIR}/net/freeradius/ && make + @${FIND} ${PORTSDIR}/net/freeradius/ -type d -name "freeradius*" -exec ${CP} -R ${WRKSRC}/addon/rlm_netams '{}'/src/modules/ \; + @cd `${FIND} ${PORTSDIR}/net/freeradius/ -type d -name "freeradius*"`/src/modules/rlm_netams && ${GMAKE} && ${GMAKE} install +.endif do-install: + ${MKDIR} ${DATADIR} ${INSTALL_PROGRAM} ${WRKSRC}/src/netams ${PREFIX}/libexec/netams ${INSTALL_PROGRAM} ${WRKSRC}/src/flowprobe ${PREFIX}/sbin/flowprobe ${INSTALL_PROGRAM} ${WRKSRC}/src/ipfw2netflow ${PREFIX}/sbin/ipfw2netflow ${INSTALL_PROGRAM} ${WRKSRC}/src/ascii2netflow ${PREFIX}/sbin/ascii2netflow ${INSTALL_PROGRAM} ${WRKSRC}/src/netamsctl ${PREFIX}/bin/netamsctl - ${INSTALL_DATA} ${WRKSRC}/addon/netams.cfg ${PREFIX}/etc/netams.cfg.sample - ${MKDIR} ${DATADIR}/cgi-bin/admin ${DATADIR}/cgi-bin/images + ${INSTALL_DATA} ${WRKSRC}/addon/netams.conf ${PREFIX}/etc/netams.conf.sample ${INSTALL_DATA} ${WRKSRC}/addon/ru-networks.txt ${DATADIR}/ru-networks.txt.sample - ${INSTALL_DATA} ${WRKSRC}/addon/.netamsctl.rc ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/addon/.netamsctl.rc ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/addon/netams-netgraphctl.sh ${DATADIR} + ${CHMOD} 0755 ${DATADIR}/netams-netgraphctl.sh + ${INSTALL_DATA} ${WRKSRC}/addon/netams-startup-failover.sh ${DATADIR} + ${CHMOD} 0755 ${DATADIR}/netams-startup-failover.sh + ${INSTALL_DATA} ${WRKSRC}/addon/ua-networks-get.sh ${DATADIR} + ${CHMOD} 0755 ${DATADIR}/ua-networks-get.sh + @${REINPLACE_CMD} -e 's|^#!/usr/bin/perl|#!/usr/local/bin/perl|' ${WRKSRC}/addon/snmp2netams.pl + ${INSTALL_DATA} ${WRKSRC}/addon/snmp2netams.pl ${DATADIR} + ${CHMOD} 0755 ${DATADIR}/snmp2netams.pl + ${INSTALL_DATA} ${WRKSRC}/addon/subnet-sum.c ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/doc/TODO.txt ${DATADIR} + +.if defined(WITH_MYSQL) + ${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema.sql ${DATADIR} + @${REINPLACE_CMD} -e 's|^#!/usr/bin/perl|#!/usr/local/bin/perl|' ${WRKSRC}/addon/mysql_rotate.pl + ${INSTALL_DATA} ${WRKSRC}/addon/mysql_rotate.pl ${DATADIR} + ${CHMOD} 0755 ${DATADIR}/mysql_rotate.pl +.endif + +.if defined(WITH_POSTGRESQL) + ${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema-Pg.sql ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/addon/postgresql_schema.sql ${DATADIR} +.endif + +.if defined(WITH_CGI) + ${INSTALL_DATA} ${WRKSRC}/addon/netams-apache ${DATADIR}/httpd.conf + ${MKDIR} ${WWWDIR}/cgi-bin/admin ${WWWDIR}/cgi-bin/images + ${INSTALL_DATA} ${WRKSRC}/addon/index.html ${WWWDIR} .for f in ${IMAGES} - ${INSTALL_DATA} ${WRKSRC}/cgi-bin/images/${f} ${DATADIR}/cgi-bin/images + ${INSTALL_DATA} ${WRKSRC}/cgi-bin/images/${f} ${WWWDIR}/cgi-bin/images .endfor -.for f in ${CGI} - ${INSTALL_DATA} ${WRKSRC}/cgi-bin/${f} ${DATADIR}/cgi-bin +.for f in ${USERCGI} + @${REINPLACE_CMD} -e 's|^#!/usr/bin/perl|#!/usr/local/bin/perl|' ${WRKSRC}/cgi-bin/${f} + ${INSTALL_DATA} ${WRKSRC}/cgi-bin/${f} ${WWWDIR}/cgi-bin .endfor .for f in ${ADMINCGI} - ${INSTALL_DATA} ${WRKSRC}/cgi-bin/admin/${f} ${DATADIR}/cgi-bin/admin + @${REINPLACE_CMD} -e 's|^#!/usr/bin/perl|#!/usr/local/bin/perl|' ${WRKSRC}/cgi-bin/admin/${f} + ${INSTALL_DATA} ${WRKSRC}/cgi-bin/admin/${f} ${WWWDIR}/cgi-bin/admin .endfor + @${FIND} ${WWWDIR} -name *.cgi | ${XARGS} ${CHMOD} 755 + @${FIND} ${WWWDIR} -name *.pl | ${XARGS} ${CHMOD} 755 +.endif + +.if defined(WITH_FREERADIUS) + ${INSTALL_DATA} ${WRKSRC}/addon/rlm_netams/README ${DATADIR}/README.radius +.endif + .for f in ${MAN8} ${INSTALL_MAN} ${WRKSRC}/doc/${f} ${MAN8PREFIX}/man/man8 .endfor post-install: +.if defined(WITH_FREERADIUS) + cd ${PORTSDIR}/net/freeradius/ && make clean +.endif @${CAT} ${PKGMESSAGE} +.if defined(WITH_CGI) + @${ECHO_MSG} "By default, CGI scripts are installed to ${WWWDIR}," + @${ECHO_MSG} "but web server NOT configured!!! You should do it yourself according to" + @${ECHO_MSG} "example ${DATADIR}/httpd.conf." + @${ECHO_MSG} "" +.endif +.if defined(WITH_FREERADIUS) + @${ECHO_MSG} "Radius module has been installed. But you should configure it yourself" + @${ECHO_MSG} "according to example ${DATADIR}/README.radius." + @${ECHO_MSG} "" +.endif + @${ECHO_MSG} "And PLEASE READ THE DOCUMENTATION FIRST!" + @${ECHO_MSG} "http://www.netams.com" + @${ECHO_MSG} "" + @${ECHO_MSG} "----------------------------------------------------------------------------" + @${ECHO_MSG} "WARNING!" + @${ECHO_MSG} "From version 3.4.1 name of default netams configuration + @${ECHO_MSG} "file changed to netams.conf!" + @${ECHO_MSG} "----------------------------------------------------------------------------" .include <bsd.port.post.mk> diff --git a/net-mgmt/netams/distinfo b/net-mgmt/netams/distinfo index b7c5c5dcc1ef..af6b84caf426 100644 --- a/net-mgmt/netams/distinfo +++ b/net-mgmt/netams/distinfo @@ -1,3 +1,3 @@ -MD5 (netams-3.4.0rc2.tar.gz) = 3093e50f8ee7a297cb8c2bc6bacd0666 -SHA256 (netams-3.4.0rc2.tar.gz) = 7cbfdefa94f075a5dab40613d25738c0e2e40652638338b52632a0efdbc4f68e -SIZE (netams-3.4.0rc2.tar.gz) = 375729 +MD5 (netams-3.4.1rc1.tar.gz) = 72e7a145f39c89a4f6c5a4ff4121ac2f +SHA256 (netams-3.4.1rc1.tar.gz) = 7b03914c1e07895282667ccff4f66dc023ec2760974eecc10efdbbc98edb1809 +SIZE (netams-3.4.1rc1.tar.gz) = 391192 diff --git a/net-mgmt/netams/files/netams.in b/net-mgmt/netams/files/netams.in index fb7d48469e38..2e607b8613c5 100644 --- a/net-mgmt/netams/files/netams.in +++ b/net-mgmt/netams/files/netams.in @@ -28,7 +28,7 @@ rcvar=`set_rcvar` load_rc_config $name : ${netams_enable="NO"} -: ${netams_config="%%PREFIX%%/etc/netams.cfg"} +: ${netams_config="%%PREFIX%%/etc/netams.conf"} pidfile="/var/run/netams.pid" command="%%PREFIX%%/libexec/netams" diff --git a/net-mgmt/netams/files/pkg-message.in b/net-mgmt/netams/files/pkg-message.in index 31cb60263150..2892e0b05d52 100644 --- a/net-mgmt/netams/files/pkg-message.in +++ b/net-mgmt/netams/files/pkg-message.in @@ -1,19 +1,13 @@ --------------------------------------------------------------------------- +---------------------------------------------------------------------------- The NeTAMS package has been successfully installed. Check %%DATADIR%% and http://www.netams.com for examples. A sample configuration file has been installed to %%PREFIX%%/etc as -"netams.cfg.sample". This may be renamed to "netams.cfg" and edited. +"netams.conf.sample". This may be renamed to "netams.conf" and edited. -In order to use the netamsctl programs, you may copy -%%DATADIR%%/.netamsctl.rc to your home directory and edit it. +In order to use the netamsctl programs, +you may copy %%DATADIR%%/.netamsctl.rc to your +home directory and edit it. -By default, CGI scripts are NOT installed, as well as web server is NOT configured. -You should do it yourself, and then copy entire %%DATADIR%%/cgi/ directory to appropriate place. - -And PLEASE READ THE DOCUMENTATION FIRST! -http://www.netams.com - --------------------------------------------------------------------------- diff --git a/net-mgmt/netams/pkg-plist b/net-mgmt/netams/pkg-plist deleted file mode 100644 index efcea4d19aec..000000000000 --- a/net-mgmt/netams/pkg-plist +++ /dev/null @@ -1,46 +0,0 @@ -etc/netams.cfg.sample -libexec/netams -sbin/flowprobe -sbin/ipfw2netflow -sbin/ascii2netflow -bin/netamsctl -%%DATADIR%%/ru-networks.txt.sample -%%DATADIR%%/.netamsctl.rc -%%DATADIR%%/cgi-bin/.htaccess -%%DATADIR%%/cgi-bin/config.cgi -%%DATADIR%%/cgi-bin/netams_api.pl -%%DATADIR%%/cgi-bin/russian.res -%%DATADIR%%/cgi-bin/netams_example.cgi -%%DATADIR%%/cgi-bin/usertool.cgi -%%DATADIR%%/cgi-bin/admintool.cgi -%%DATADIR%%/cgi-bin/activate.cgi -%%DATADIR%%/cgi-bin/activate.tmpl -%%DATADIR%%/cgi-bin/login.cgi -%%DATADIR%%/cgi-bin/netams_graph.cgi -%%DATADIR%%/cgi-bin/admin/.htaccess -%%DATADIR%%/cgi-bin/admin/cardtool.cgi -%%DATADIR%%/cgi-bin/admin/index.cgi -%%DATADIR%%/cgi-bin/admin/policy.cgi -%%DATADIR%%/cgi-bin/admin/showusercard.cgi -%%DATADIR%%/cgi-bin/admin/user.cgi -%%DATADIR%%/cgi-bin/admin/access.cgi -%%DATADIR%%/cgi-bin/admin/login.cgi -%%DATADIR%%/cgi-bin/admin/quota.cgi -%%DATADIR%%/cgi-bin/admin/showusercard.tmpl -%%DATADIR%%/cgi-bin/admin/view.cgi -%%DATADIR%%/cgi-bin/admin/account.cgi -%%DATADIR%%/cgi-bin/admin/netams.cgi -%%DATADIR%%/cgi-bin/admin/radius.cgi -%%DATADIR%%/cgi-bin/admin/subplan.cgi -%%DATADIR%%/cgi-bin/admin/config.cgi -%%DATADIR%%/cgi-bin/admin/plan.cgi -%%DATADIR%%/cgi-bin/admin/russian.res -%%DATADIR%%/cgi-bin/admin/unit.cgi -%%DATADIR%%/cgi-bin/images/admintool-logo.gif -%%DATADIR%%/cgi-bin/images/logo.gif -%%DATADIR%%/cgi-bin/images/logo_sm.jpg -%%DATADIR%%/cgi-bin/images/showtable-logo.gif -@dirrm %%DATADIR%%/cgi-bin/images -@dirrm %%DATADIR%%/cgi-bin/admin -@dirrm %%DATADIR%%/cgi-bin -@dirrm %%DATADIR%% |