|
|
|
##
|
|
|
|
## activemq.spec -- OpenPKG RPM Package Specification
|
|
|
|
## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
|
|
|
|
##
|
|
|
|
## Permission to use, copy, modify, and distribute this software for
|
|
|
|
## any purpose with or without fee is hereby granted, provided that
|
|
|
|
## the above copyright notice and this permission notice appear in all
|
|
|
|
## copies.
|
|
|
|
##
|
|
|
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
|
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
|
|
|
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
## SUCH DAMAGE.
|
|
|
|
##
|
|
|
|
|
|
|
|
# package information
|
|
|
|
Name: activemq
|
|
|
|
Summary: Enterprise Messaging and Integration Patterns Provider
|
|
|
|
URL: http://activemq.apache.org/
|
|
|
|
Vendor: Apache Foundation
|
|
|
|
Packager: OpenPKG Foundation e.V.
|
|
|
|
Distribution: OpenPKG Community
|
|
|
|
Class: EVAL
|
|
|
|
Group: Network
|
|
|
|
License: Apache
|
|
|
|
Version: 5.3.0
|
|
|
|
Release: 20100108
|
|
|
|
|
|
|
|
# list of sources
|
|
|
|
Source0: http://www.apache.org/dist/activemq/apache-activemq/%{version}/apache-activemq-%{version}-bin.tar.gz
|
|
|
|
Source1: activemq.txt
|
|
|
|
Source2: activemq-ajax.js
|
|
|
|
Source3: rc.activemq
|
|
|
|
|
|
|
|
# build information
|
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20100101
|
|
|
|
PreReq: OpenPKG, openpkg >= 20100101, java
|
|
|
|
|
|
|
|
%description
|
|
|
|
ActiveMQ is the most popular and powerful Open-Source Enterprise
|
|
|
|
Messaging and Integration Patterns provider. ActiveMQ supports
|
|
|
|
OpenWire, STOMP and XMPP transports. ActiveMQ supports JMS 1.1
|
|
|
|
including support for transient, persistent, transactional and XA
|
|
|
|
messaging.
|
|
|
|
|
|
|
|
%track
|
|
|
|
prog activemq = {
|
|
|
|
version = %{version}
|
|
|
|
url = http://activemq.apache.org/download.html
|
|
|
|
regex = ActiveMQ\s+(\d+\.\d+\.\d+)\s+Release
|
|
|
|
}
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n apache-activemq-%{version}
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
|
|
# create installation hierarchy
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/activemq \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/libexec/activemq \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/share/activemq/service/WEB-INF \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/activemq/run \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/activemq/log \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/activemq/data
|
|
|
|
|
|
|
|
# install program components
|
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
|
bin/run.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/activemq/
|
|
|
|
cp -rp lib \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/libexec/activemq/
|
|
|
|
cp -rp webapps/* \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/share/activemq/
|
|
|
|
|
|
|
|
# post-adjust installation
|
|
|
|
%{l_shtool} subst \
|
|
|
|
-e 's;${activemq.base}/conf/credentials\.properties;%{l_prefix}/etc/activemq/activemq.properties;' \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/share/activemq/admin/WEB-INF/webconsole-embedded.xml
|
|
|
|
|
|
|
|
# install run-command script
|
|
|
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
|
%{SOURCE rc.activemq} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
|
|
|
|
|
# install default configuration
|
|
|
|
for name in `grep "^<file" %{SOURCE activemq.txt} | sed -e 's;^.*name=";;' -e 's;".*$;;'`; do
|
|
|
|
(echo ""; cat %{SOURCE activemq.txt}; echo "") |\
|
|
|
|
sed -e "1,/^<file name=\"$name\">/d" -e "/<\/file>/,\$d" >$name
|
|
|
|
if [ ".$name" = ".web.xml" ]; then
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
$name $RPM_BUILD_ROOT%{l_prefix}/share/activemq/service/WEB-INF/
|
|
|
|
elif [ ".$name" = ".activemq.conf" ]; then
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
$name $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
|
|
|
|
else
|
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
|
$name $RPM_BUILD_ROOT%{l_prefix}/etc/activemq/
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
|
conf/broker.ks $RPM_BUILD_ROOT%{l_prefix}/etc/activemq/activemq.broker.ks
|
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
|
conf/broker.ts $RPM_BUILD_ROOT%{l_prefix}/etc/activemq/activemq.broker.ts
|
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
|
%{SOURCE activemq-ajax.js} \
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/share/activemq/service/ajax.js
|
|
|
|
|
|
|
|
# determine installation files
|
|
|
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
|
%{l_files_std} \
|
|
|
|
'%config %{l_prefix}/etc/activemq/*' \
|
|
|
|
'%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/activemq/*'
|
|
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
|
|
|
%post
|
|
|
|
# after upgrade, restart service
|
|
|
|
if [ $1 -eq 2 ]; then
|
|
|
|
eval `%{l_rc} activemq status 2>/dev/null`
|
|
|
|
[ ".$activemq_active" = .yes ] && %{l_rc} activemq restart
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%preun
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
# before erase, stop service and remove log files
|
|
|
|
%{l_rc} activemq stop 2>/dev/null
|
|
|
|
rm -f $RPM_INSTALL_PREFIX/var/activemq/log/* >/dev/null 2>&1 || true
|
|
|
|
rm -f $RPM_INSTALL_PREFIX/var/activemq/run/* >/dev/null 2>&1 || true
|
|
|
|
rm -rf $RPM_INSTALL_PREFIX/var/activemq/data/* >/dev/null 2>&1 || true
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|