| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- ##
- ## activemq.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2009 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.2.0
- Release: 20091011
- # list of sources
- Source0: http://www.apache.org/dist/activemq/apache-activemq/%{version}/apache-activemq-%{version}-bin.tar.gz
- Source1: activemq.txt
- Source2: rc.activemq
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823
- PreReq: OpenPKG, openpkg >= 20060823, java
- AutoReq: no
- AutoReqProv: no
- %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+)\+Release
- }
- %prep
- %setup -q -n apache-activemq-%{version}
- %build
- %install
- rm -rf $RPM_BUILD_ROOT
- # 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
- # 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
- rm -rf $RPM_BUILD_ROOT
- %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
|