jabberd/jabberd.spec

Tue, 28 Aug 2012 18:30:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:30:35 +0200
changeset 540
6becb64fe77d
parent 363
641cacc76b02
child 541
869d6847b13e
permissions
-rw-r--r--

Resynchronize with upstream package maintainer version.

michael@224 1 ##
michael@224 2 ## jabberd.spec -- OpenPKG RPM Package Specification
michael@540 3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@224 4 ##
michael@224 5 ## Permission to use, copy, modify, and distribute this software for
michael@224 6 ## any purpose with or without fee is hereby granted, provided that
michael@224 7 ## the above copyright notice and this permission notice appear in all
michael@224 8 ## copies.
michael@224 9 ##
michael@224 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@224 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@224 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@224 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@224 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@224 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@224 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@224 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@224 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@224 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@224 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@224 21 ## SUCH DAMAGE.
michael@224 22 ##
michael@224 23
michael@224 24 # package version
michael@224 25 %define V_major 2.2
michael@363 26 %define V_minor 14
michael@224 27
michael@224 28 # package information
michael@224 29 Name: jabberd
michael@224 30 Summary: Jabber Instant Messaging Daemon
michael@224 31 URL: http://jabberd2.xiaoka.com/
michael@224 32 Vendor: Jabber Software Foundation
michael@224 33 Packager: OpenPKG Foundation e.V.
michael@224 34 Distribution: OpenPKG Community
michael@224 35 Class: PLUS
michael@224 36 Group: InstantMessaging
michael@224 37 License: JOSL/GPL
michael@224 38 Version: %{V_major}.%{V_minor}
michael@540 39 Release: 20110602
michael@224 40
michael@224 41 # package options
michael@540 42 %option with_sqlite no
michael@224 43 %option with_mysql no
michael@224 44 %option with_pgsql no
michael@224 45 %option with_pam no
michael@224 46
michael@224 47 # list of sources
michael@224 48 Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz
michael@540 49 Source1: rc.jabberd
michael@224 50 Patch0: jabberd.patch
michael@224 51
michael@224 52 # build information
michael@540 53 BuildPreReq: OpenPKG, openpkg >= 20100101, make
michael@540 54 PreReq: OpenPKG, openpkg >= 20100101, perl
michael@224 55 BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
michael@224 56 PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
michael@224 57 %if "%{with_sqlite}" == "yes"
michael@224 58 BuildPreReq: sqlite
michael@224 59 PreReq: sqlite
michael@224 60 %endif
michael@224 61 %if "%{with_mysql}" == "yes"
michael@224 62 BuildPreReq: mysql
michael@224 63 PreReq: mysql
michael@224 64 %endif
michael@224 65 %if "%{with_pgsql}" == "yes"
michael@224 66 BuildPreReq: postgresql
michael@224 67 PreReq: postgresql
michael@224 68 %endif
michael@224 69 %if "%{with_pam}" == "yes"
michael@224 70 BuildPreReq: PAM
michael@224 71 PreReq: PAM
michael@224 72 %endif
michael@224 73
michael@224 74 %description
michael@224 75 JabberD is the original server implementation for the Jabber instant
michael@224 76 messaging platform. JabberD 2 is the next generation of the JabberD
michael@224 77 server. It has been rewritten from the ground up to be scalable,
michael@224 78 architecturally sound, and to support the latest protocol extensions
michael@224 79 coming out of the JSF.
michael@224 80
michael@224 81 %track
michael@224 82 prog jabberd = {
michael@224 83 version = %{version}
michael@224 84 url = http://codex.xiaoka.com/pub/jabberd2/releases/
michael@224 85 regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz
michael@224 86 }
michael@224 87
michael@224 88 %prep
michael@224 89 %setup -q -n jabberd-%{version}
michael@224 90 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
michael@224 91 %{l_shtool} subst \
michael@224 92 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
michael@224 93 tools/jabberd.in
michael@224 94
michael@224 95 %build
michael@224 96 # configure program
michael@540 97 ( echo "ac_cv_func_kqueue=no"
michael@540 98 ) >config.cache
michael@224 99 export CC="%{l_cc}"
michael@224 100 export CFLAGS="%{l_cflags -O}"
michael@224 101 export CPPFLAGS="%{l_cppflags libidn}"
michael@224 102 export LDFLAGS="%{l_ldflags}"
michael@224 103 export LIBS=""
michael@224 104 case "%{l_platform -t}" in
michael@224 105 *-linux* ) LIBS="$LIBS -ldl" ;;
michael@224 106 *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;;
michael@224 107 esac
michael@224 108 export JHOME=%{l_prefix}/var/jabberd
michael@224 109 %if "%{with_mysql}" == "yes"
michael@224 110 CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}"
michael@224 111 LDFLAGS="$LDFLAGS %{l_ldflags mysql}"
michael@224 112 LIBS="$LIBS -lz -lm"
michael@224 113 %endif
michael@224 114 %if "%{with_pgsql}" == "yes"
michael@224 115 CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}"
michael@224 116 %endif
michael@224 117 ./configure \
michael@540 118 --cache-file=./config.cache \
michael@224 119 --prefix=%{l_prefix} \
michael@224 120 --sysconfdir=%{l_prefix}/etc/jabberd \
michael@224 121 --mandir=%{l_prefix}/man \
michael@224 122 --enable-db \
michael@224 123 --enable-fs \
michael@224 124 --enable-pipe \
michael@224 125 --enable-ssl \
michael@224 126 --with-sasl=gsasl \
michael@224 127 %if "%{with_sqlite}" == "yes"
michael@224 128 --enable-sqlite \
michael@224 129 %else
michael@224 130 --disable-sqlite \
michael@224 131 %endif
michael@224 132 %if "%{with_mysql}" == "yes"
michael@224 133 --enable-mysql \
michael@224 134 %else
michael@224 135 --disable-mysql \
michael@224 136 %endif
michael@224 137 %if "%{with_pgsql}" == "yes"
michael@224 138 --enable-pgsql \
michael@224 139 %else
michael@224 140 --disable-pgsql \
michael@224 141 %endif
michael@224 142 %if "%{with_pam}" == "yes"
michael@224 143 --enable-pam \
michael@224 144 %else
michael@224 145 --disable-pam \
michael@224 146 %endif
michael@224 147 --disable-oracle \
michael@224 148 --enable-static \
michael@224 149 --enable-shared
michael@224 150
michael@224 151 # build program
michael@540 152 %{l_make} %{l_mflags}
michael@224 153
michael@224 154 %install
michael@224 155 # create installation filesystem structure
michael@224 156 %{l_shtool} mkdir -f -p -m 755 \
michael@224 157 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@224 158 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \
michael@224 159 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \
michael@224 160 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \
michael@224 161 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \
michael@224 162 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
michael@224 163 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
michael@224 164
michael@540 165 # install components
michael@224 166 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@224 167
michael@224 168 # remove unnecessary files
michael@224 169 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
michael@224 170 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
michael@224 171 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a
michael@224 172
michael@224 173 # install run-command script
michael@224 174 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@224 175 %{SOURCE rc.jabberd} \
michael@224 176 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@224 177
michael@224 178 # determine installation files
michael@224 179 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@224 180 %{l_files_std} \
michael@224 181 '%config %{l_prefix}/etc/jabberd/*' \
michael@224 182 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \
michael@224 183 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'
michael@224 184
michael@224 185 %files -f files
michael@224 186
michael@224 187 %clean
michael@224 188
michael@224 189 %post
michael@224 190 # after upgrade, restart service
michael@224 191 [ $1 -eq 2 ] || exit 0
michael@224 192 eval `%{l_rc} jabberd status 2>/dev/null`
michael@224 193 [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart
michael@224 194 exit 0
michael@224 195
michael@224 196 %preun
michael@224 197 # before erase, stop service and remove log files
michael@224 198 [ $1 -eq 0 ] || exit 0
michael@224 199 %{l_rc} jabberd stop 2>/dev/null
michael@224 200 rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true
michael@224 201 exit 0
michael@224 202

mercurial