svn commit: r345533 - in head/net/activemq: . files

Tom Judge tj at FreeBSD.org
Fri Feb 21 20:05:36 UTC 2014


Author: tj
Date: Fri Feb 21 20:05:35 2014
New Revision: 345533
URL: http://svnweb.freebsd.org/changeset/ports/345533
QAT: https://qat.redports.org/buildarchive/r345533/

Log:
  * pkg-plist cleanup
  * Create log and datadirs in rc script
  * Put logs in /var/log/activemq by default not in /var/db/activemq

Modified:
  head/net/activemq/Makefile
  head/net/activemq/files/activemq.in
  head/net/activemq/pkg-plist

Modified: head/net/activemq/Makefile
==============================================================================
--- head/net/activemq/Makefile	Fri Feb 21 18:55:46 2014	(r345532)
+++ head/net/activemq/Makefile	Fri Feb 21 20:05:35 2014	(r345533)
@@ -2,7 +2,7 @@
 
 PORTNAME=	activemq
 PORTVERSION=	5.9.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net java
 MASTER_SITES=	http://www.sai.msu.su/apache/${MASTER_SITE_SUBDIR}/ \
 		${MASTER_SITE_APACHE}/${MASTER_SITE_SUBDIR}/
@@ -70,6 +70,9 @@ OPTIONS_DEFINE=	DOCS EXAMPLES
 
 .include <bsd.port.options.mk>
 
+post-patch:
+	 @${REINPLACE_CMD} -e 's|activemq.base}/data|activemq.logs}|g' ${WRKSRC}/conf/log4j.properties
+
 do-install:
 .if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
@@ -80,7 +83,6 @@ do-install:
 .endif
 
 	@${MKDIR} ${STAGEDIR}${MQDATA} ${STAGEDIR}${MQDATA}/bin ${STAGEDIR}${ETCDIR}
-	@${MKDIR} ${STAGEDIR}${MQDB}
 
 .if ${PORT_OPTIONS:MEXAMPLES}
 	@cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}

Modified: head/net/activemq/files/activemq.in
==============================================================================
--- head/net/activemq/files/activemq.in	Fri Feb 21 18:55:46 2014	(r345532)
+++ head/net/activemq/files/activemq.in	Fri Feb 21 20:05:35 2014	(r345533)
@@ -40,9 +40,12 @@ load_rc_config $name
 : ${activemq_classpath:=%%ETCDIR%%}
 : ${activemq_conf:=%%ETCDIR%%}
 : ${activemq_data:=%%MQDB%%}
+: ${activemq_logs:=/var/log/activemq}
 : ${activemq_home:=%%DATADIR%%}
 : ${activemq_javargs:='-Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dcom.sun.management.jmxremote'}
 : ${activemq_stop_timeout:="10"}
+: ${activemq_hostname:=`/bin/hostname`}
+
 
 pidfile=/var/run/${name}.pid
 
@@ -52,8 +55,10 @@ java_options=" 	-server -jar ${activemq_
 		-Dactivemq.classpath=${activemq_classpath} \
 		-Dactivemq.conf=${activemq_conf} \
 		-Dactivemq.data=${activemq_data} \
+		-Dactivemq.logs=${activemq_logs} \
 		-Dactivemq.home=${activemq_home} \
-		-Dactivemq.base=${activemq_home}"
+		-Dactivemq.base=${activemq_home} \
+		-Dactivemq.hostname=${activemq_hostname}"
 
 java_command="%%LOCALBASE%%/bin/java ${java_options} ${jar_file}"
 
@@ -66,6 +71,12 @@ stop_cmd="activemq_stop"
 activemq_precmd() {
         touch ${pidfile}
         chown ${activemq_user}:${activemq_group} ${pidfile}
+	if [ ! -d ${activemq_logs} ]; then 
+		/usr/bin/install -d -o ${activemq_user} -g ${activemq_group} ${activemq_logs}
+	fi
+	if [ ! -d ${activemq_data} ]; then 
+		/usr/bin/install -d -o ${activemq_user} -g ${activemq_group} ${activemq_data}
+	fi
 }
 
 activemq_stop() {

Modified: head/net/activemq/pkg-plist
==============================================================================
--- head/net/activemq/pkg-plist	Fri Feb 21 18:55:46 2014	(r345532)
+++ head/net/activemq/pkg-plist	Fri Feb 21 20:05:35 2014	(r345533)
@@ -1,6 +1,3 @@
- at unexec if [ -d %%MQDB%% ]; then echo "You should remove %%MQDB%% if you don't need it any more."; fi
- at dirrmtry %%MQDB%%
- at exec install -d -o %%MQUSER%% -g %%MQGROUP%% %%MQDB%%
 @exec mkdir -p %D/lib/activemq/webapps/hawtio/app/activemq/js
 @exec mkdir -p %D/lib/activemq/webapps/hawtio/app/apollo/js
 @exec mkdir -p %D/lib/activemq/webapps/hawtio/app/branding/js
@@ -1048,59 +1045,59 @@ lib/activemq/webapps/styles/type-setting
 %%PORTDOCS%%%%DOCSDIR%%/user-guide.html
 @owner %%MQUSER%%
 @group %%MQGROUP%%
- at unexec if cmp -s %D/activemq.xml %D/activemq.xml.sample ; then rm -f %D/activemq.xml ; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/activemq.xml %D/%%ETCDIR%%/activemq.xml.sample ; then rm -f %D/%%ETCDIR%%/activemq.xml ; fi
 %%ETCDIR%%/activemq.xml.sample
- at exec if [ ! -f %D/activemq.xml ]; then cp -p %D/%F %B/activemq.xml; fi
- at unexec if cmp -s %D/credentials-enc.properties %D/credentials-enc.properties.sample ; then rm -f %D/credentials-enc.properties ; fi
+ at exec if [ ! -f %B/activemq.xml ]; then cp -p %D/%F %B/activemq.xml; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/credentials-enc.properties %D/%%ETCDIR%%/credentials-enc.properties.sample ; then rm -f %D/%%ETCDIR%%/credentials-enc.properties ; fi
 %%ETCDIR%%/credentials-enc.properties.sample
- at exec if [ ! -f %D/credentials-enc.properties ]; then cp -p %D/%F %B/credentials-enc.properties; fi
- at unexec if cmp -s %D/credentials.properties %D/credentials.properties.sample ; then rm -f %D/credentials.properties ; fi
+ at exec if [ ! -f %B/credentials-enc.properties ]; then cp -p %D/%F %B/credentials-enc.properties; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/credentials.properties %D/%%ETCDIR%%/credentials.properties.sample ; then rm -f %D/%%ETCDIR%%/credentials.properties ; fi
 %%ETCDIR%%/credentials.properties.sample
- at exec if [ ! -f %D/credentials.properties ]; then cp -p %D/%F %B/credentials.properties; fi
- at unexec if cmp -s %D/jetty-realm.properties.xml %D/jetty-realm.properties.xml.sample ; then rm -f %D/jetty-realm.properties.xml ; fi
+ at exec if [ ! -f %B/credentials.properties ]; then cp -p %D/%F %B/credentials.properties; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/jetty-realm.properties %D/%%ETCDIR%%/jetty-realm.properties.sample ; then rm -f %D/%%ETCDIR%%/jetty-realm.properties ; fi
 %%ETCDIR%%/jetty-realm.properties.sample
- at exec if [ ! -f %D/jetty-realm.properties ]; then cp -p %D/%F %B/jetty-realm.properties; fi
- at unexec if cmp -s %D/jetty.xml %D/jetty.xml.sample ; then rm -f %D/jetty.xml ; fi
+ at exec if [ ! -f %B/jetty-realm.properties ]; then cp -p %D/%F %B/jetty-realm.properties; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/jetty.xml %D/%%ETCDIR%%/jetty.xml.sample ; then rm -f %D/%%ETCDIR%%/jetty.xml ; fi
 %%ETCDIR%%/jetty.xml.sample
- at exec if [ ! -f %D/jetty.xml ]; then cp -p %D/%F %B/jetty.xml; fi
- at unexec if cmp -s %D/jmx.access %D/jmx.access.sample ; then rm -f %D/jmx.access ; fi
+ at exec if [ ! -f %B/jetty.xml ]; then cp -p %D/%F %B/jetty.xml; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/jmx.access %D/%%ETCDIR%%/jmx.access.sample ; then rm -f %D/%%ETCDIR%%/jmx.access ; fi
 %%ETCDIR%%/jmx.access.sample
- at exec if [ ! -f %D/jmx.access ]; then cp -p %D/%F %B/jmx.access; fi
- at unexec if cmp -s %D/jmx.password %D/jmx.password.sample ; then rm -f %D/jmx.password ; fi
+ at exec if [ ! -f %B/jmx.access ]; then cp -p %D/%F %B/jmx.access; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/jmx.password %D/%%ETCDIR%%/jmx.password.sample ; then rm -f %D/%%ETCDIR%%/jmx.password ; fi
 %%ETCDIR%%/jmx.password.sample
- at exec if [ ! -f %D/jmx.password ]; then cp -p %D/%F %B/jmx.password; fi
- at unexec if cmp -s %D/log4j.properties %D/log4j.properties.sample ; then rm -f %D/log4j.properties ; fi
+ at exec if [ ! -f %B/jmx.password ]; then cp -p %D/%F %B/jmx.password; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/log4j.properties %D/%%ETCDIR%%/log4j.properties.sample ; then rm -f %D/%%ETCDIR%%/log4j.properties ; fi
 %%ETCDIR%%/log4j.properties.sample
- at exec if [ ! -f %D/log4j.properties ]; then cp -p %D/%F %B/log4j.properties; fi
- at unexec if cmp -s %D/logging.properties %D/logging.properties.sample ; then rm -f %D/logging.properties ; fi
+ at exec if [ ! -f %B/log4j.properties ]; then cp -p %D/%F %B/log4j.properties; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/logging.properties %D/%%ETCDIR%%/logging.properties.sample ; then rm -f %D/%%ETCDIR%%/logging.properties ; fi
 %%ETCDIR%%/logging.properties.sample
- at exec if [ ! -f %D/logging.properties ]; then cp -p %D/%F %B/logging.properties; fi
- at unexec if cmp -s %D/broker-localhost.cert %D/broker-localhost.cert.sample ; then rm -f %D/broker-localhost.cert ; fi
+ at exec if [ ! -f %B/logging.properties ]; then cp -p %D/%F %B/logging.properties; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/broker-localhost.cert %D/%%ETCDIR%%/broker-localhost.cert.sample ; then rm -f %D/%%ETCDIR%%/broker-localhost.cert ; fi
 %%ETCDIR%%/broker-localhost.cert.sample
- at exec if [ ! -f %D/broker-localhost.cert ]; then cp -p %D/%F %B/broker-localhost.cert; fi
- at unexec if cmp -s %D/broker.ks %D/broker.ks.sample ; then rm -f %D/broker.ks ; fi
+ at exec if [ ! -f %B/broker-localhost.cert ]; then cp -p %D/%F %B/broker-localhost.cert; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/broker.ks %D/%%ETCDIR%%/broker.ks.sample ; then rm -f %D/%%ETCDIR%%/broker.ks ; fi
 %%ETCDIR%%/broker.ks.sample
- at exec if [ ! -f %D/broker.ks ]; then cp -p %D/%F %B/broker.ks; fi
- at unexec if cmp -s %D/broker.ts %D/broker.ts.sample ; then rm -f %D/broker.ts ; fi
+ at exec if [ ! -f %B/broker.ks ]; then cp -p %D/%F %B/broker.ks; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/broker.ts %D/%%ETCDIR%%/broker.ts.sample ; then rm -f %D/%%ETCDIR%%/broker.ts ; fi
 %%ETCDIR%%/broker.ts.sample
- at exec if [ ! -f %D/broker.ts ]; then cp -p %D/%F %B/broker.ts; fi
- at unexec if cmp -s %D/client.ks %D/client.ks.sample ; then rm -f %D/client.ks ; fi
+ at exec if [ ! -f %B/broker.ts ]; then cp -p %D/%F %B/broker.ts; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/client.ks %D/%%ETCDIR%%/client.ks.sample ; then rm -f %D/%%ETCDIR%%/client.ks ; fi
 %%ETCDIR%%/client.ks.sample
- at exec if [ ! -f %D/client.ks ]; then cp -p %D/%F %B/client.ks; fi
- at unexec if cmp -s %D/client.ts %D/client.ts.sample ; then rm -f %D/client.ts ; fi
+ at exec if [ ! -f %B/client.ks ]; then cp -p %D/%F %B/client.ks; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/client.ts %D/%%ETCDIR%%/client.ts.sample ; then rm -f %D/%%ETCDIR%%/client.ts ; fi
 %%ETCDIR%%/client.ts.sample
- at exec if [ ! -f %D/client.ts ]; then cp -p %D/%F %B/client.ts; fi
- at unexec if cmp -s %D/groups.properties %D/groups.properties.sample ; then rm -f %D/groups.properties ; fi
+ at exec if [ ! -f %B/client.ts ]; then cp -p %D/%F %B/client.ts; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/groups.properties %D/%%ETCDIR%%/groups.properties.sample ; then rm -f %D/%%ETCDIR%%/groups.properties ; fi
 %%ETCDIR%%/groups.properties.sample
- at exec if [ ! -f %D/groups.properties ]; then cp -p %D/%F %B/groups.properties; fi
- at unexec if cmp -s %D/login.config %D/login.config.sample ; then rm -f %D/login.config ; fi
+ at exec if [ ! -f %B/groups.properties ]; then cp -p %D/%F %B/groups.properties; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/login.config %D/%%ETCDIR%%/login.config.sample ; then rm -f %D/%%ETCDIR%%/login.config ; fi
 %%ETCDIR%%/login.config.sample
- at exec if [ ! -f %D/login.config ]; then cp -p %D/%F %B/login.config; fi
- at unexec if cmp -s %D/users.properties %D/users.properties.sample ; then rm -f %D/users.properties ; fi
+ at exec if [ ! -f %B/login.config ]; then cp -p %D/%F %B/login.config; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/users.properties %D/%%ETCDIR%%/users.properties.sample ; then rm -f %D/%%ETCDIR%%/users.properties ; fi
 %%ETCDIR%%/users.properties.sample
- at exec if [ ! -f %D/users.properties ]; then cp -p %D/%F %B/users.properties; fi
- at owner
- at group
+ at exec if [ ! -f %B/users.properties ]; then cp -p %D/%F %B/users.properties; fi
+ at owner root
+ at group wheel
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/java/pom.xml
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/java/readme.md
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/java/src/main/java/example/Listener.java


More information about the svn-ports-all mailing list