Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Aug 2012 05:08:00 +0000 (UTC)
From:      Jason Helfman <jgh@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r301938 - head/databases/jasperserver
Message-ID:  <201208030508.q73580KX073769@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jgh
Date: Fri Aug  3 05:08:00 2012
New Revision: 301938
URL: http://svn.freebsd.org/changeset/ports/301938

Log:
  - adopt optionsNG
  - pet portlint

Modified:
  head/databases/jasperserver/Makefile

Modified: head/databases/jasperserver/Makefile
==============================================================================
--- head/databases/jasperserver/Makefile	Fri Aug  3 04:24:58 2012	(r301937)
+++ head/databases/jasperserver/Makefile	Fri Aug  3 05:08:00 2012	(r301938)
@@ -42,13 +42,12 @@ USE_ZIP=	yes
 # use own DOS2UNIX in pre-patch, not the one from bsd.port.mk!
 DOS2UNIX_REGEX=	.*(css|dtd|java|js|txt|wsdd|xml|xsl)$$
 
-OPTIONS=	TOMCAT5 "Enable Tomcat 5.x support"	off \
-		TOMCAT6 "Enable Tomcat 6.x support"	on \
-		TOMCAT7 "Enable Tomcat 7.x support"	off \
-		MYSQL   "Enable Mysql 5.x support"	off \
-		POSTGRESQL "Enable PostgreSQL 9.x support" on \
-		XLS "Alternative Patches for XLS Spreadsheets" off
-
+OPTIONS_DEFINE=	XLS
+XLS_DESC=	Alternative Patches for XLS Spreadsheets
+OPTIONS_SINGLE=	AS DB
+OPTIONS_SINGLE_AS=	TOMCAT5 TOMCAT6 TOMCAT7
+OPTIONS_SINGLE_DB=	MYSQL PGSQL
+OPTIONS_DEFAULT=	TOMCAT6 PGSQL
 
 REPLACE_FILES=	${JS}/jasperserver-war/src/main/webappAdditions/WEB-INF/web.xml
 REPLACE_LIST_TEMP=	${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
@@ -72,18 +71,18 @@ PLIST_SUB=	DATABASE=${DATABASE} \
 
 .include <bsd.port.options.mk>
 
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MMYSQL}
 WANT_MYSQL_VER=	55
 DBUSER?=	root
 DBPASS?=
 DATABASE=	mysql
 RUN_DEPENDS+=	${JAVAJARDIR}/mysql-connector-java.jar:${PORTSDIR}/databases/mysql-connector-java
-BUILD_DEPENDS+= ${JAVAJARDIR}/mysql-connector-java.jar:${PORTSDIR}/databases/mysql-connector-java
+BUILD_DEPENDS+=	${JAVAJARDIR}/mysql-connector-java.jar:${PORTSDIR}/databases/mysql-connector-java
 PLIST_SUB+=	JDBC="mysql-connector-java.jar"
 .endif
 
 #use version 90, application is certified w/ pg90
-.if defined(WITH_POSTGRESQL)
+.if ${PORT_OPTIONS:MPGSQL}
 WANT_PGSQL_VER=	90
 JDBC=	postgresql-9.0-802.jdbc4.jar
 DISTFILES+=	postgresql-9.0-802.jdbc4.jar:source2
@@ -95,7 +94,7 @@ PLIST_SUB+=	JDBC=${JDBC}
 MASTER_SITES+=	http://jdbc.postgresql.org/download/:source2
 .endif
 
-.if defined(WITH_TOMCAT5)
+.if ${PORT_OPTIONS:MTOMCAT5}
 APPHOME?=	${LOCALBASE}/tomcat5.5
 BUILD_DEPENDS+=	${APPHOME}/bin/bootstrap.jar:${PORTSDIR}/www/tomcat55
 RUN_DEPENDS+=	${APPHOME}/bin/bootstrap.jar:${PORTSDIR}/www/tomcat55
@@ -104,7 +103,7 @@ PLIST_SUB+=	APP_VERSION="tomcat5.5"
 JDBCLOC=	common/lib
 .endif
 
-.if defined(WITH_TOMCAT6)
+.if ${PORT_OPTIONS:MTOMCAT6}
 APPHOME?=	${LOCALBASE}/apache-tomcat-6.0
 BUILD_DEPENDS+=	${APPHOME}/bin/bootstrap.jar:${PORTSDIR}/www/tomcat6
 RUN_DEPENDS+=	${APPHOME}/bin/bootstrap.jar:${PORTSDIR}/www/tomcat6
@@ -113,7 +112,7 @@ PLIST_SUB+=	APP_VERSION="apache-tomcat-6
 JDBCLOC=	lib
 .endif
 
-.if defined(WITH_TOMCAT7)
+.if ${PORT_OPTIONS:MTOMCAT7}
 APPHOME?=	${LOCALBASE}/apache-tomcat-7.0
 BUILD_DEPENDS+=	${APPHOME}/bin/bootstrap.jar:${PORTSDIR}/www/tomcat7
 RUN_DEPENDS+=	${APPHOME}/bin/bootstrap.jar:${PORTSDIR}/www/tomcat7
@@ -139,21 +138,6 @@ JSMAILPROTO?=	smtp
 JSMAILPORT?=	25
 JSTIMEOUT?=	20
 
-check-sanity:
-.if ( defined(WITH_TOMCAT5) && defined(WITH_TOMCAT6) )
-IGNORE=	you can only define one application server
-.elif ( defined(WITH_TOMCAT5) && defined(WITH_TOMCAT7) )
-IGNORE=	you can only define one application server
-.elif ( defined(WITH_TOMCAT6) && defined(WITH_TOMCAT7) )
-IGNORE=	you can only define one application server
-.elif ( !defined(APPHOME) )
-IGNORE=	choose at least one application server
-.elif ( defined(WITH_MYSQL) && defined(WITH_POSTGRESQL) )
-IGNORE=	you can only define one database
-.elif ( !defined(WITH_MYSQL) && !defined(WITH_POSTGRESQL) )
-IGNORE=	choose at least one database
-.endif
-
 pre-fetch:
 # show the update warning before we fetch ~400MB sources
 	@${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
@@ -177,7 +161,7 @@ post-patch:
 	@${SED} ${REPLACE_LIST_TEMP} ${file} > ${WRKDIR}/`basename ${file}`
 	@${ECHO_MSG} " [ DONE ]"
 .endfor
-.if defined(WITH_XLS)
+.if ${PORT_OPTIONS:MXLS}
 	@${ECHO} "Applying alternative patches for Xls."
 	@cd ${PATCH_WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/alt-patch-jasperserver__common__shared-config__applicationContext.xml
 	@cd ${PATCH_WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/alt-patch-jasperserver__jasperserver-war__src__main__webappAdditions__WEB-INF__classes__jasperreports.properties
@@ -204,7 +188,7 @@ pre-build:
 		${ECHO} "maven = ${JAVASHAREDIR}/maven2/bin/mvn" >> ${APP_PROPERTIES} ; \
 		else ${FALSE}; \
 	fi )
-.if !defined(WITH_POSTGRESQL)
+.if ${PORT_OPTIONS:MMYSQL}
 	@${ECHO} "maven.jdbc.groupId = mysql" >> ${APP_PROPERTIES}
 	@${ECHO} "maven.jdbc.version = 5.1.17-bin" >> ${APP_PROPERTIES}
 	@${ECHO} "maven.jdbc.artifactId = mysql-connector-java" >> ${APP_PROPERTIES}
@@ -213,7 +197,7 @@ pre-build:
 	@${ECHO} "js-pro-path = ${JS}" >> ${APP_PROPERTIES}
 	@${ECHO} "repo-path = ${JSREPO}" >> ${APP_PROPERTIES}
 
-.if defined(WITH_MYSQL)
+.if ${PORT_OPTIONS:MMYSQL}
 	${LN} -s ${JAVAJARDIR}/mysql-connector-java.jar ${SRCDIR}/${PORTNAME}/buildomatic/conf_source/db/mysql/jdbc/mysql-connector-java-5.1.17-bin.jar
 .endif
 
@@ -224,7 +208,7 @@ do-build:
 	@( ${CP} ${WRKDIR}/web.xml ${JS}/jasperserver-war/src/main/webappAdditions/WEB-INF/web.xml )
 	@( cd ${WRKSRC} && ./js-ant build-ce )
 
-.if !defined(WITH_POSTGRESQL)
+.if empty(PORT_OPTIONS:MPGSQL)
 	@${ECHO} "quartz.delegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate" > ${QTZ_PROPERTIES}
 .else
 	@${ECHO} "quartz.delegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate" > ${QTZ_PROPERTIES}
@@ -252,7 +236,7 @@ do-install:
 	@${INSTALL} -m 440 ${QTZ_PROPERTIES} ${JSHOME}/WEB-INF/
 
 #removed shipped driver from vendor
-.if !defined(WITH_MYSQL)
+.if empty(PORT_OPTIONS:MMYSQL)
 	${INSTALL_DATA} ${DISTDIR}/${JDBC} ${APPHOME}/${JDBCLOC}
 	@${RM} ${APPHOME}/${JDBCLOC}/postgresql-9.0-801.jdbc3.jar
 .else



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