diff options
author | pav <pav@FreeBSD.org> | 2010-05-14 20:42:50 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2010-05-14 20:42:50 +0800 |
commit | d1f541bfb6565539fbe617307d6978bcc60d7c0d (patch) | |
tree | 9515301a4310f2e7179ae5097b38230708d3254e /net-mgmt/netams/Makefile | |
parent | 2c61bed137737a2b0227e32d685495344190c63f (diff) | |
download | freebsd-ports-gnome-d1f541bfb6565539fbe617307d6978bcc60d7c0d.tar.gz freebsd-ports-gnome-d1f541bfb6565539fbe617307d6978bcc60d7c0d.tar.zst freebsd-ports-gnome-d1f541bfb6565539fbe617307d6978bcc60d7c0d.zip |
- Update to 3.4.5
PR: ports/143410
Submitted by: Anton Vinokurov <anton@netams.com> (maintainer)
Diffstat (limited to 'net-mgmt/netams/Makefile')
-rw-r--r-- | net-mgmt/netams/Makefile | 261 |
1 files changed, 56 insertions, 205 deletions
diff --git a/net-mgmt/netams/Makefile b/net-mgmt/netams/Makefile index a606f3b3b5e1..eabb633ab1fe 100644 --- a/net-mgmt/netams/Makefile +++ b/net-mgmt/netams/Makefile @@ -6,25 +6,31 @@ # PORTNAME= netams -DISTVERSION= 3.4.1rc1 +PORTVERSION= 3.4.5 CATEGORIES= net-mgmt MASTER_SITES= http://www.netams.com/files/ MAINTAINER= jura@netams.com COMMENT= Network Traffic Accounting and Monitoring Software +BUILD_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/GD.pm:${PORTSDIR}/graphics/p5-GD \ + ${SITE_PERL}/GD/Graph.pm:${PORTSDIR}/graphics/p5-GD-Graph \ + ${SITE_PERL}/GD/Text.pm:${PORTSDIR}/graphics/p5-GD-TextUtil \ + ${SITE_PERL}/${PERL_ARCH}/Storable.pm:${PORTSDIR}/devel/p5-Storable \ + ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \ + ${SITE_PERL}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI \ + ${SITE_PERL}/Crypt/GeneratePassword.pm:${PORTSDIR}/security/p5-Crypt-GeneratePassword +RUN_DEPENDS= httpd:${PORTSDIR}/www/apache22 \ + mysql-server>=5.0.86:${PORTSDIR}/databases/mysql50-server +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd \ + jpeg.11:${PORTSDIR}/graphics/jpeg \ + mysqlclient.15:${PORTSDIR}/databases/mysql50-client \ + pcap.1:${PORTSDIR}/net/libpcap + USE_SUBMAKE= yes +SUB_FILES= pkg-message 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}" \ @@ -32,220 +38,65 @@ SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ MKDIR="${MKDIR}" \ REALCURDIR="${.CURDIR}" -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 - -.include <bsd.port.pre.mk> - -.if ${ARCH} != "i386" -BROKEN= does not compile -.elif ${OSVERSION} >= 800000 -BROKEN= does not compile -.endif +DATADIR= ${PREFIX}/etc -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 +WWWDIR= ${PREFIX}/www/netams -.if defined(WITH_MYSQL) -USE_MYSQL= yes -IGNORE_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(WITHOUT_BW) - @${REINPLACE_CMD} -e 's|.*BW_limit.*DEFINE += -DHAVE_BW.*|#&|' \ - ${WRKSRC}/configure.sh -.endif - -.if defined(WITH_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 - @${REINPLACE_CMD} -e 's|^CC.*|CC=${CC}|; s|^CPP.*|CPP=${CXX}|' \ - ${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 +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 graph.cgi \ + monitor.cgi rrdgraph.cgi statistic.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 netams_html.cgi \ + statistic.pl +IMAGES= logo_sm.jpg admintool-logo.gif showtable-logo.gif rrdgraph-logo.gif +MAN8= netams.8 flowprobe.8 netamsctl.8 -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 +.include <bsd.port.pre.mk> 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.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/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} + ${MKDIR} ${WWWDIR} ${WWWDIR}/cgi-bin ${WWWDIR}/cgi-bin/admin ${WWWDIR}/images \ + ${DATADIR}/netams ${DATADIR}/netams/tools ${DATADIR}/netams/tools/oracle \ + ${DATADIR}/apache22 ${DATADIR}/apache22/Includes + ${INSTALL_DATA} ${WRKSRC}/addon/netams.conf ${DATADIR}/netams/netams.conf.sample + ${INSTALL_DATA} ${WRKSRC}/addon/ru-networks.txt ${DATADIR}/netams/ru-networks.txt.sample + ${INSTALL_DATA} ${WRKSRC}/addon/ua-networks.txt ${DATADIR}/netams/ua-networks.txt.sample + ${INSTALL_DATA} ${WRKSRC}/addon/.netamsctl.rc ${DATADIR}/.netamsctl.rc + ${INSTALL_DATA} ${WRKSRC}/addon/mysql_rotate.pl ${DATADIR}/netams/mysql_rotate.pl + ${INSTALL_DATA} ${WRKSRC}/addon/snmp2netams.pl ${DATADIR}/netams/snmp2netams.pl + ${INSTALL_DATA} ${WRKSRC}/addon/ua-networks-get.sh ${DATADIR}/netams/ua-networks-get.sh + ${INSTALL_DATA} ${WRKSRC}/cgi-bin/admin/billing_users_table.sql ${DATADIR}/netams/tools/billing_users_table.sql + ${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema-Pg.sql ${DATADIR}/netams/tools/cardtool_schema-Pg.sql + ${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema.sql ${DATADIR}/netams/tools/cardtool_schema.sql + ${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams.sh ${DATADIR}/netams/tools/oracle/netams.sh + ${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_drop.sql ${DATADIR}/netams/tools/oracle/netams_drop.sql + ${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_tb.sql ${DATADIR}/netams/tools/oracle/netams_tb.sql + ${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_tg.sql ${DATADIR}/netams/tools/oracle/netams_tg.sql + ${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_ts.sql ${DATADIR}/netams/tools/oracle/netams_ts.sql + ${INSTALL_DATA} ${WRKSRC}/addon/index.html ${WWWDIR}/index.html + ${INSTALL_DATA} ${WRKSRC}/addon/netams.js ${WWWDIR}/netams.js + ${INSTALL_DATA} ${WRKSRC}/addon/netams-apache-freebsd.conf ${DATADIR}/apache22/Includes/netams-apache-freebsd.conf .for f in ${IMAGES} - ${INSTALL_DATA} ${WRKSRC}/cgi-bin/images/${f} ${WWWDIR}/cgi-bin/images + ${INSTALL_DATA} ${WRKSRC}/cgi-bin/images/${f} ${WWWDIR}/images/ .endfor -.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 +.for f in ${CGI} + ${INSTALL_DATA} ${WRKSRC}/cgi-bin/${f} ${WWWDIR}/cgi-bin/ .endfor .for f in ${ADMINCGI} - @${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 + ${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 + ${INSTALL_MAN} ${WRKSRC}/doc/${f} ${PREFIX}/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> |