Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 May 2013 09:04:36 GMT
From:      "Ilya A. Arkhipov" <rum1cro@yandex.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/178445: [patch] net-mgmt/netams: moving to optionsng
Message-ID:  <201305090904.r4994aM1015758@oldred.FreeBSD.org>
Resent-Message-ID: <201305090910.r499A2nl096150@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         178445
>Category:       ports
>Synopsis:       [patch] net-mgmt/netams: moving to optionsng
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 09 09:10:02 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Ilya A. Arkhipov
>Release:        10.0-CURRENT
>Organization:
Rambler
>Environment:
FreeBSD mhome 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Thu Mar 29 18:04:50 UTC 2012     root@mhome:/usr/obj/usr/src/sys/MICROKERNEL  amd64

>Description:
patch for net-mgmt/netams for moving to optionsng
>How-To-Repeat:
Install it
>Fix:
diff -Nru netams_old/Makefile netams/Makefile
--- netams_old/Makefile	2013-05-09 12:27:22.881706219 +0400
+++ netams/Makefile	2013-05-09 12:38:07.953705562 +0400
@@ -1,9 +1,5 @@
-# New ports collection makefile for: NetAMS
-# Date created:        24 December 2003
-# Whom: 	       jura@netams.com
-#
-# $FreeBSD: ports/net-mgmt/netams/Makefile,v 1.31 2012/11/17 06:00:34 svnexp Exp $
-#
+# Created by: Yuriy N. Shkandybin <jura@netams.com>
+# $FreeBSD$
 
 PORTNAME=	netams
 PORTVERSION=	3.4.5
@@ -21,10 +17,12 @@
 USE_RC_SUBR=	netams
 MANCOMPRESSED=	no
 
-OPTIONS=	DEBUG		"Build with debug symbols"			off \
-		MYSQL		"Build with MySQL storage support" 		on  \
-		POSTGRESQL	"Build with PostgreSQL storage support"		off \
-		CGI 		"Install admin/user CGI scripts"		off
+OPTIONS_DEFINE=	DEBUG MYSQL POSTGRESQL CGI
+OPTIONS_DEFAULT=	MYSQL
+DEBUG_DESC=	Build with debug symbols
+MYSQL_DESC=	Build with MySQL storage support
+POSTGRESQL_DESC=	Build with PostgreSQL storage support
+CGI_DESC=	Install admin/user CGI scripts
 
 SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
 		PREFIX="${PREFIX}" \
@@ -46,18 +44,18 @@
 
 .include <bsd.port.pre.mk>
 
-.if !defined(WITH_MYSQL) && !defined(WITH_POSTGRESQL)
+.if empty(PORT_OPTIONS:MMYSQL) && empty(PORT_OPTIONS:MPOSTGRESQL)
 IGNORE=requires at least one database backend selected. Run 'make config'
 .endif
 
-.if defined(WITH_POSTGRESQL)
+.if ${PORT_OPTIONS:MPOSTGRESQL}
 USE_PGSQL=		yes
 PLIST_SUB+=		POSTGRESQL=""
 .else
 PLIST_SUB+=		POSTGRESQL="@comment "
 .endif
 
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MMYSQL}
 USE_MYSQL=		yes
 BROKEN_WITH_MYSQL=	323
 PLIST_SUB+=		MYSQL=""
@@ -65,15 +63,15 @@
 PLIST_SUB+=		MYSQL="@comment "
 .endif
 
-.if defined(WITH_POSTGRESQL) && defined(WITH_CGI)
+.if ${PORT_OPTIONS:MPOSTGRESQL} && ${PORT_OPTIONS:MCGI}
 RUN_DEPENDS+=		p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg
 .endif
 
-.if defined(WITH_MYSQL) && defined(WITH_CGI)
+.if ${PORT_OPTIONS:MMYSQL} && ${PORT_OPTIONS:MCGI}
 RUN_DEPENDS+=		p5-DBD-mysql50>=0:${PORTSDIR}/databases/p5-DBD-mysql50
 .endif
 
-.if defined(WITH_CGI)
+.if ${PORT_OPTIONS:MCGI}
 RUN_DEPENDS+=	p5-GD>=0:${PORTSDIR}/graphics/p5-GD \
 		p5-GD-Graph>=0:${PORTSDIR}/graphics/p5-GD-Graph \
 		p5-GD-TextUtil>=0:${PORTSDIR}/graphics/p5-GD-TextUtil \
@@ -88,15 +86,15 @@
 .endif
 
 pre-patch:
-.if !defined(WITH_DEBUG)
+.if empty(PORT_OPTIONS:MDEBUG)
 	@${REINPLACE_CMD} -e 's|.*sh configure.sh|& -nodebug|' \
 		${WRKSRC}/Makefile
 .endif
-.if !defined(WITH_POSTGRESQL)
+.if empty(PORT_OPTIONS:MPOSTGRESQL)
 	@${REINPLACE_CMD} -e 's|locate_file "libpq\.so".*|v1="" \&\& v2=""|' \
 		${WRKSRC}/configure.sh
 .endif
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MWITH_MYSQL}
 	@${REINPLACE_CMD} -e 's|^#!/usr/bin/perl|#!/usr/local/bin/perl|' ${WRKSRC}/addon/mysql_rotate.pl
 .else
 	@${REINPLACE_CMD} -e 's|locate_file "libmysqlclient\.so".*|v1="" \&\& v2=""|' \
@@ -121,11 +119,11 @@
 	${INSTALL_DATA} ${WRKSRC}/addon/ru-networks.txt ${DATADIR}/ru-networks.txt.sample
 	${INSTALL_DATA} ${WRKSRC}/addon/ua-networks.txt ${DATADIR}/ua-networks.txt.sample
 	${INSTALL_DATA} ${WRKSRC}/addon/.netamsctl.rc ${DATADIR}/.netamsctl.rc
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MMYSQL}
 	${INSTALL_DATA} ${WRKSRC}/addon/mysql_rotate.pl ${DATADIR}/mysql_rotate.pl
 	${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema.sql ${DATADIR}/tools/cardtool_schema.sql
 .endif
-.if defined(WITH_POSTGRESQL)
+.if ${PORT_OPTIONS:MPOSTGRESQL}
 	${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema-Pg.sql ${DATADIR}/tools/cardtool_schema-Pg.sql
 	${INSTALL_DATA} ${WRKSRC}/addon/postgresql_schema.sql ${DATADIR}/tools/postgresql_schema.sql
 .endif
@@ -138,7 +136,7 @@
 	${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_tg.sql ${DATADIR}/tools/oracle/netams_tg.sql
 	${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_ts.sql ${DATADIR}/tools/oracle/netams_ts.sql
 	${INSTALL_DATA} ${WRKSRC}/addon/netams-apache-freebsd.conf ${DATADIR}/netams-apache-freebsd.conf
-.if defined(WITH_CGI)
+.if ${PORT_OPTIONS:MCGI}
 	${MKDIR} ${WWWDIR} ${WWWDIR}/cgi-bin ${WWWDIR}/cgi-bin/admin ${WWWDIR}/images
 	${INSTALL_DATA} ${WRKSRC}/addon/index.html ${WWWDIR}/index.html
 	${INSTALL_DATA} ${WRKSRC}/addon/netams.js ${WWWDIR}/netams.js


Patch attached with submission follows:

diff -Nru netams_old/Makefile netams/Makefile
--- netams_old/Makefile	2013-05-09 12:27:22.881706219 +0400
+++ netams/Makefile	2013-05-09 12:38:07.953705562 +0400
@@ -1,9 +1,5 @@
-# New ports collection makefile for: NetAMS
-# Date created:        24 December 2003
-# Whom: 	       jura@netams.com
-#
-# $FreeBSD: ports/net-mgmt/netams/Makefile,v 1.31 2012/11/17 06:00:34 svnexp Exp $
-#
+# Created by: Yuriy N. Shkandybin <jura@netams.com>
+# $FreeBSD$
 
 PORTNAME=	netams
 PORTVERSION=	3.4.5
@@ -21,10 +17,12 @@
 USE_RC_SUBR=	netams
 MANCOMPRESSED=	no
 
-OPTIONS=	DEBUG		"Build with debug symbols"			off \
-		MYSQL		"Build with MySQL storage support" 		on  \
-		POSTGRESQL	"Build with PostgreSQL storage support"		off \
-		CGI 		"Install admin/user CGI scripts"		off
+OPTIONS_DEFINE=	DEBUG MYSQL POSTGRESQL CGI
+OPTIONS_DEFAULT=	MYSQL
+DEBUG_DESC=	Build with debug symbols
+MYSQL_DESC=	Build with MySQL storage support
+POSTGRESQL_DESC=	Build with PostgreSQL storage support
+CGI_DESC=	Install admin/user CGI scripts
 
 SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
 		PREFIX="${PREFIX}" \
@@ -46,18 +44,18 @@
 
 .include <bsd.port.pre.mk>
 
-.if !defined(WITH_MYSQL) && !defined(WITH_POSTGRESQL)
+.if empty(PORT_OPTIONS:MMYSQL) && empty(PORT_OPTIONS:MPOSTGRESQL)
 IGNORE=requires at least one database backend selected. Run 'make config'
 .endif
 
-.if defined(WITH_POSTGRESQL)
+.if ${PORT_OPTIONS:MPOSTGRESQL}
 USE_PGSQL=		yes
 PLIST_SUB+=		POSTGRESQL=""
 .else
 PLIST_SUB+=		POSTGRESQL="@comment "
 .endif
 
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MMYSQL}
 USE_MYSQL=		yes
 BROKEN_WITH_MYSQL=	323
 PLIST_SUB+=		MYSQL=""
@@ -65,15 +63,15 @@
 PLIST_SUB+=		MYSQL="@comment "
 .endif
 
-.if defined(WITH_POSTGRESQL) && defined(WITH_CGI)
+.if ${PORT_OPTIONS:MPOSTGRESQL} && ${PORT_OPTIONS:MCGI}
 RUN_DEPENDS+=		p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg
 .endif
 
-.if defined(WITH_MYSQL) && defined(WITH_CGI)
+.if ${PORT_OPTIONS:MMYSQL} && ${PORT_OPTIONS:MCGI}
 RUN_DEPENDS+=		p5-DBD-mysql50>=0:${PORTSDIR}/databases/p5-DBD-mysql50
 .endif
 
-.if defined(WITH_CGI)
+.if ${PORT_OPTIONS:MCGI}
 RUN_DEPENDS+=	p5-GD>=0:${PORTSDIR}/graphics/p5-GD \
 		p5-GD-Graph>=0:${PORTSDIR}/graphics/p5-GD-Graph \
 		p5-GD-TextUtil>=0:${PORTSDIR}/graphics/p5-GD-TextUtil \
@@ -88,15 +86,15 @@
 .endif
 
 pre-patch:
-.if !defined(WITH_DEBUG)
+.if empty(PORT_OPTIONS:MDEBUG)
 	@${REINPLACE_CMD} -e 's|.*sh configure.sh|& -nodebug|' \
 		${WRKSRC}/Makefile
 .endif
-.if !defined(WITH_POSTGRESQL)
+.if empty(PORT_OPTIONS:MPOSTGRESQL)
 	@${REINPLACE_CMD} -e 's|locate_file "libpq\.so".*|v1="" \&\& v2=""|' \
 		${WRKSRC}/configure.sh
 .endif
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MWITH_MYSQL}
 	@${REINPLACE_CMD} -e 's|^#!/usr/bin/perl|#!/usr/local/bin/perl|' ${WRKSRC}/addon/mysql_rotate.pl
 .else
 	@${REINPLACE_CMD} -e 's|locate_file "libmysqlclient\.so".*|v1="" \&\& v2=""|' \
@@ -121,11 +119,11 @@
 	${INSTALL_DATA} ${WRKSRC}/addon/ru-networks.txt ${DATADIR}/ru-networks.txt.sample
 	${INSTALL_DATA} ${WRKSRC}/addon/ua-networks.txt ${DATADIR}/ua-networks.txt.sample
 	${INSTALL_DATA} ${WRKSRC}/addon/.netamsctl.rc ${DATADIR}/.netamsctl.rc
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MMYSQL}
 	${INSTALL_DATA} ${WRKSRC}/addon/mysql_rotate.pl ${DATADIR}/mysql_rotate.pl
 	${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema.sql ${DATADIR}/tools/cardtool_schema.sql
 .endif
-.if defined(WITH_POSTGRESQL)
+.if ${PORT_OPTIONS:MPOSTGRESQL}
 	${INSTALL_DATA} ${WRKSRC}/addon/cardtool_schema-Pg.sql ${DATADIR}/tools/cardtool_schema-Pg.sql
 	${INSTALL_DATA} ${WRKSRC}/addon/postgresql_schema.sql ${DATADIR}/tools/postgresql_schema.sql
 .endif
@@ -138,7 +136,7 @@
 	${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_tg.sql ${DATADIR}/tools/oracle/netams_tg.sql
 	${INSTALL_DATA} ${WRKSRC}/addon/oracle/netams_ts.sql ${DATADIR}/tools/oracle/netams_ts.sql
 	${INSTALL_DATA} ${WRKSRC}/addon/netams-apache-freebsd.conf ${DATADIR}/netams-apache-freebsd.conf
-.if defined(WITH_CGI)
+.if ${PORT_OPTIONS:MCGI}
 	${MKDIR} ${WWWDIR} ${WWWDIR}/cgi-bin ${WWWDIR}/cgi-bin/admin ${WWWDIR}/images
 	${INSTALL_DATA} ${WRKSRC}/addon/index.html ${WWWDIR}/index.html
 	${INSTALL_DATA} ${WRKSRC}/addon/netams.js ${WWWDIR}/netams.js


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305090904.r4994aM1015758>