1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

* pkg-plist cleanup

* Create log and datadirs in rc script
* Put logs in /var/log/activemq by default not in /var/db/activemq
This commit is contained in:
Tom Judge 2014-02-21 20:05:35 +00:00
parent f27f0fe550
commit 834893aeab
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=345533
3 changed files with 52 additions and 42 deletions

View File

@ -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}

View File

@ -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_javargs} \
-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() {

View File

@ -1,6 +1,3 @@
@unexec if [ -d %%MQDB%% ]; then echo "You should remove %%MQDB%% if you don't need it any more."; fi
@dirrmtry %%MQDB%%
@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-settings.css
%%PORTDOCS%%%%DOCSDIR%%/user-guide.html
@owner %%MQUSER%%
@group %%MQGROUP%%
@unexec if cmp -s %D/activemq.xml %D/activemq.xml.sample ; then rm -f %D/activemq.xml ; fi
@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
@exec if [ ! -f %D/activemq.xml ]; then cp -p %D/%F %B/activemq.xml; fi
@unexec if cmp -s %D/credentials-enc.properties %D/credentials-enc.properties.sample ; then rm -f %D/credentials-enc.properties ; fi
@exec if [ ! -f %B/activemq.xml ]; then cp -p %D/%F %B/activemq.xml; fi
@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
@exec if [ ! -f %D/credentials-enc.properties ]; then cp -p %D/%F %B/credentials-enc.properties; fi
@unexec if cmp -s %D/credentials.properties %D/credentials.properties.sample ; then rm -f %D/credentials.properties ; fi
@exec if [ ! -f %B/credentials-enc.properties ]; then cp -p %D/%F %B/credentials-enc.properties; fi
@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
@exec if [ ! -f %D/credentials.properties ]; then cp -p %D/%F %B/credentials.properties; fi
@unexec if cmp -s %D/jetty-realm.properties.xml %D/jetty-realm.properties.xml.sample ; then rm -f %D/jetty-realm.properties.xml ; fi
@exec if [ ! -f %B/credentials.properties ]; then cp -p %D/%F %B/credentials.properties; fi
@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
@exec if [ ! -f %D/jetty-realm.properties ]; then cp -p %D/%F %B/jetty-realm.properties; fi
@unexec if cmp -s %D/jetty.xml %D/jetty.xml.sample ; then rm -f %D/jetty.xml ; fi
@exec if [ ! -f %B/jetty-realm.properties ]; then cp -p %D/%F %B/jetty-realm.properties; fi
@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
@exec if [ ! -f %D/jetty.xml ]; then cp -p %D/%F %B/jetty.xml; fi
@unexec if cmp -s %D/jmx.access %D/jmx.access.sample ; then rm -f %D/jmx.access ; fi
@exec if [ ! -f %B/jetty.xml ]; then cp -p %D/%F %B/jetty.xml; fi
@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
@exec if [ ! -f %D/jmx.access ]; then cp -p %D/%F %B/jmx.access; fi
@unexec if cmp -s %D/jmx.password %D/jmx.password.sample ; then rm -f %D/jmx.password ; fi
@exec if [ ! -f %B/jmx.access ]; then cp -p %D/%F %B/jmx.access; fi
@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
@exec if [ ! -f %D/jmx.password ]; then cp -p %D/%F %B/jmx.password; fi
@unexec if cmp -s %D/log4j.properties %D/log4j.properties.sample ; then rm -f %D/log4j.properties ; fi
@exec if [ ! -f %B/jmx.password ]; then cp -p %D/%F %B/jmx.password; fi
@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
@exec if [ ! -f %D/log4j.properties ]; then cp -p %D/%F %B/log4j.properties; fi
@unexec if cmp -s %D/logging.properties %D/logging.properties.sample ; then rm -f %D/logging.properties ; fi
@exec if [ ! -f %B/log4j.properties ]; then cp -p %D/%F %B/log4j.properties; fi
@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
@exec if [ ! -f %D/logging.properties ]; then cp -p %D/%F %B/logging.properties; fi
@unexec if cmp -s %D/broker-localhost.cert %D/broker-localhost.cert.sample ; then rm -f %D/broker-localhost.cert ; fi
@exec if [ ! -f %B/logging.properties ]; then cp -p %D/%F %B/logging.properties; fi
@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
@exec if [ ! -f %D/broker-localhost.cert ]; then cp -p %D/%F %B/broker-localhost.cert; fi
@unexec if cmp -s %D/broker.ks %D/broker.ks.sample ; then rm -f %D/broker.ks ; fi
@exec if [ ! -f %B/broker-localhost.cert ]; then cp -p %D/%F %B/broker-localhost.cert; fi
@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
@exec if [ ! -f %D/broker.ks ]; then cp -p %D/%F %B/broker.ks; fi
@unexec if cmp -s %D/broker.ts %D/broker.ts.sample ; then rm -f %D/broker.ts ; fi
@exec if [ ! -f %B/broker.ks ]; then cp -p %D/%F %B/broker.ks; fi
@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
@exec if [ ! -f %D/broker.ts ]; then cp -p %D/%F %B/broker.ts; fi
@unexec if cmp -s %D/client.ks %D/client.ks.sample ; then rm -f %D/client.ks ; fi
@exec if [ ! -f %B/broker.ts ]; then cp -p %D/%F %B/broker.ts; fi
@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
@exec if [ ! -f %D/client.ks ]; then cp -p %D/%F %B/client.ks; fi
@unexec if cmp -s %D/client.ts %D/client.ts.sample ; then rm -f %D/client.ts ; fi
@exec if [ ! -f %B/client.ks ]; then cp -p %D/%F %B/client.ks; fi
@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
@exec if [ ! -f %D/client.ts ]; then cp -p %D/%F %B/client.ts; fi
@unexec if cmp -s %D/groups.properties %D/groups.properties.sample ; then rm -f %D/groups.properties ; fi
@exec if [ ! -f %B/client.ts ]; then cp -p %D/%F %B/client.ts; fi
@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
@exec if [ ! -f %D/groups.properties ]; then cp -p %D/%F %B/groups.properties; fi
@unexec if cmp -s %D/login.config %D/login.config.sample ; then rm -f %D/login.config ; fi
@exec if [ ! -f %B/groups.properties ]; then cp -p %D/%F %B/groups.properties; fi
@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
@exec if [ ! -f %D/login.config ]; then cp -p %D/%F %B/login.config; fi
@unexec if cmp -s %D/users.properties %D/users.properties.sample ; then rm -f %D/users.properties ; fi
@exec if [ ! -f %B/login.config ]; then cp -p %D/%F %B/login.config; fi
@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
@exec if [ ! -f %D/users.properties ]; then cp -p %D/%F %B/users.properties; fi
@owner
@group
@exec if [ ! -f %B/users.properties ]; then cp -p %D/%F %B/users.properties; fi
@owner root
@group wheel
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/java/pom.xml
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/java/readme.md
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/java/src/main/java/example/Listener.java