|
|
@@ -0,0 +1,148 @@
|
|
|
+##
|
|
|
+## avis.spec -- OpenPKG RPM Package Specification
|
|
|
+## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
|
|
|
+## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
|
|
|
+##
|
|
|
+## 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 versions
|
|
|
+%define V_avis_server 1.1.0
|
|
|
+%define V_avis_client 1.0.1
|
|
|
+
|
|
|
+# package information
|
|
|
+Name: avis
|
|
|
+Summary: Event Router
|
|
|
+URL: http://avis.sourceforge.net/
|
|
|
+Vendor: Matthew Phillip
|
|
|
+Packager: OpenPKG Foundation e.V.
|
|
|
+Distribution: OpenPKG Community
|
|
|
+Class: EVAL
|
|
|
+Group: InstantMessaging
|
|
|
+License: GPL
|
|
|
+Version: %{V_avis_server}
|
|
|
+Release: 20070827
|
|
|
+
|
|
|
+# list of sources
|
|
|
+Source0: http://switch.dl.sourceforge.net/avis/avis-src-%{V_avis_server}.zip
|
|
|
+Source1: http://switch.dl.sourceforge.net/avis/avis-client-%{V_avis_client}.zip
|
|
|
+Source2: rc.avis
|
|
|
+
|
|
|
+# build information
|
|
|
+Prefix: %{l_prefix}
|
|
|
+BuildRoot: %{l_buildroot}
|
|
|
+BuildPreReq: OpenPKG, openpkg >= 20060823
|
|
|
+PreReq: OpenPKG, openpkg >= 20060823, java, JAVA-JDK
|
|
|
+AutoReq: no
|
|
|
+AutoReqProv: no
|
|
|
+
|
|
|
+%description
|
|
|
+ Avis is a multicast event bus. It provides a fast, publish/subscribe
|
|
|
+ event routing service compatible with the commercial Elvin
|
|
|
+ implementation developed by Mantara Software. Elvin routers can be
|
|
|
+ federated together to form wide-area event notification networks.
|
|
|
+ Clients can exchange events with other clients anywhere on the bus,
|
|
|
+ subscribing to messages using pattern-matching expressions that
|
|
|
+ select messages based on their content.
|
|
|
+
|
|
|
+%track
|
|
|
+ prog avis:server = {
|
|
|
+ version = %{V_avis_server}
|
|
|
+ url = http://prdownloads.sourceforge.net/avis/
|
|
|
+ regex = avis-src-(__VER__)\.zip
|
|
|
+ }
|
|
|
+ prog avis:client = {
|
|
|
+ version = %{V_avis_client}
|
|
|
+ url = http://prdownloads.sourceforge.net/avis/
|
|
|
+ regex = avis-client-(__VER__)\.zip
|
|
|
+ }
|
|
|
+
|
|
|
+%prep
|
|
|
+ %setup -q -T -c
|
|
|
+ %{l_prefix}/bin/unzip -q -x %{SOURCE0}
|
|
|
+ %{l_prefix}/bin/unzip -q -x %{SOURCE1}
|
|
|
+
|
|
|
+%build
|
|
|
+
|
|
|
+%install
|
|
|
+ # create installation hierarchy
|
|
|
+ rm -rf $RPM_BUILD_ROOT
|
|
|
+ %{l_shtool} mkdir -f -p -m 755 \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/bin \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/avis \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/libexec/avis \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/var/avis
|
|
|
+
|
|
|
+ # install Java program
|
|
|
+ %{l_shtool} install -c -m 644 \
|
|
|
+ avis-%{V_avis_server}/server/lib/avisd.jar \
|
|
|
+ avis-client-%{V_avis_client}/client/lib/avis-client.jar \
|
|
|
+ avis-client-%{V_avis_client}/client/lib/avis-tools.jar \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/libexec/avis/
|
|
|
+
|
|
|
+ # install default server configuration
|
|
|
+ %{l_shtool} install -c -m 644 \
|
|
|
+ -e 's;# Listen=elvin://0\.0\.0\.0;Listen=elvin://127.0.0.1:2917;' \
|
|
|
+ avis-%{V_avis_server}/server/etc/avisd.config \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/avis/avisd.config
|
|
|
+
|
|
|
+ # install client wrapper scripts
|
|
|
+ ( echo "#!/bin/sh"
|
|
|
+ echo "exec %{l_prefix}/bin/java -Vsun-jdk -Xverify:none \\%{l_nil}"
|
|
|
+ echo " -cp %{l_prefix}/libexec/avis/avis-tools.jar \\%{l_nil}"
|
|
|
+ echo " org.avis.tools.Ec \${1+\"\$@\"}"
|
|
|
+ ) >ec
|
|
|
+ ( echo "#!/bin/sh"
|
|
|
+ echo "exec %{l_prefix}/bin/java -Vsun-jdk -Xverify:none \\%{l_nil}"
|
|
|
+ echo " -cp %{l_prefix}/libexec/avis/avis-tools.jar \\%{l_nil}"
|
|
|
+ echo " org.avis.tools.Ep \${1+\"\$@\"}"
|
|
|
+ ) >ep
|
|
|
+ %{l_shtool} install -c -m 755 \
|
|
|
+ ec ep $RPM_BUILD_ROOT%{l_prefix}/bin/
|
|
|
+
|
|
|
+ # install run-command script
|
|
|
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
+ %{SOURCE rc.avis} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
+
|
|
|
+ # determine installation files
|
|
|
+ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
+ %{l_files_std} \
|
|
|
+ '%config %{l_prefix}/etc/avis/avisd.config' \
|
|
|
+ '%dir %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/avis'
|
|
|
+
|
|
|
+%files -f files
|
|
|
+
|
|
|
+%clean
|
|
|
+ rm -rf $RPM_BUILD_ROOT
|
|
|
+
|
|
|
+%post
|
|
|
+ # after upgrade, restart service
|
|
|
+ [ $1 -eq 2 ] || exit 0
|
|
|
+ eval `%{l_rc} avis status 2>/dev/null`
|
|
|
+ [ ".$avis_active" = .yes ] && %{l_rc} avis restart
|
|
|
+ exit 0
|
|
|
+
|
|
|
+%preun
|
|
|
+ # before erase, stop service and remove log files
|
|
|
+ [ $1 -eq 0 ] || exit 0
|
|
|
+ %{l_rc} avis stop 2>/dev/null
|
|
|
+ rm -f $RPM_INSTALL_PREFIX/var/avis/avis.log* >/dev/null 2>&1 || true
|
|
|
+ exit 0
|
|
|
+
|