jabberd/jabberd.spec

Sat, 31 Oct 2009 19:00:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 31 Oct 2009 19:00:00 +0100
changeset 224
29b273d63835
child 225
a01e65d97743
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@224 1 ##
michael@224 2 ## jabberd.spec -- OpenPKG RPM Package Specification
michael@224 3 ## Copyright (c) 2000-2009 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@224 26 %define V_minor 9
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@224 39 Release: 20090707
michael@224 40
michael@224 41 # package options
michael@224 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@224 49 Source1: rc.jabberd
michael@224 50 Patch0: jabberd.patch
michael@224 51
michael@224 52 # build information
michael@224 53 Prefix: %{l_prefix}
michael@224 54 BuildRoot: %{l_buildroot}
michael@224 55 BuildPreReq: OpenPKG, openpkg >= 20060823, make
michael@224 56 PreReq: OpenPKG, openpkg >= 20060823, perl
michael@224 57 BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
michael@224 58 PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
michael@224 59 %if "%{with_sqlite}" == "yes"
michael@224 60 BuildPreReq: sqlite
michael@224 61 PreReq: sqlite
michael@224 62 %endif
michael@224 63 %if "%{with_mysql}" == "yes"
michael@224 64 BuildPreReq: mysql
michael@224 65 PreReq: mysql
michael@224 66 %endif
michael@224 67 %if "%{with_pgsql}" == "yes"
michael@224 68 BuildPreReq: postgresql
michael@224 69 PreReq: postgresql
michael@224 70 %endif
michael@224 71 %if "%{with_pam}" == "yes"
michael@224 72 BuildPreReq: PAM
michael@224 73 PreReq: PAM
michael@224 74 %endif
michael@224 75 AutoReq: no
michael@224 76 AutoReqProv: no
michael@224 77
michael@224 78 %description
michael@224 79 JabberD is the original server implementation for the Jabber instant
michael@224 80 messaging platform. JabberD 2 is the next generation of the JabberD
michael@224 81 server. It has been rewritten from the ground up to be scalable,
michael@224 82 architecturally sound, and to support the latest protocol extensions
michael@224 83 coming out of the JSF.
michael@224 84
michael@224 85 %track
michael@224 86 prog jabberd = {
michael@224 87 version = %{version}
michael@224 88 url = http://codex.xiaoka.com/pub/jabberd2/releases/
michael@224 89 regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz
michael@224 90 }
michael@224 91
michael@224 92 %prep
michael@224 93 %setup -q -n jabberd-%{version}
michael@224 94 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
michael@224 95 %{l_shtool} subst \
michael@224 96 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
michael@224 97 tools/jabberd.in
michael@224 98
michael@224 99 %build
michael@224 100 # configure program
michael@224 101 export CC="%{l_cc}"
michael@224 102 export CFLAGS="%{l_cflags -O}"
michael@224 103 export CPPFLAGS="%{l_cppflags libidn}"
michael@224 104 export LDFLAGS="%{l_ldflags}"
michael@224 105 export LIBS=""
michael@224 106 case "%{l_platform -t}" in
michael@224 107 *-linux* ) LIBS="$LIBS -ldl" ;;
michael@224 108 *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;;
michael@224 109 esac
michael@224 110 export JHOME=%{l_prefix}/var/jabberd
michael@224 111 %if "%{with_mysql}" == "yes"
michael@224 112 CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}"
michael@224 113 LDFLAGS="$LDFLAGS %{l_ldflags mysql}"
michael@224 114 LIBS="$LIBS -lz -lm"
michael@224 115 %endif
michael@224 116 %if "%{with_pgsql}" == "yes"
michael@224 117 CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}"
michael@224 118 %endif
michael@224 119 ./configure \
michael@224 120 --prefix=%{l_prefix} \
michael@224 121 --sysconfdir=%{l_prefix}/etc/jabberd \
michael@224 122 --mandir=%{l_prefix}/man \
michael@224 123 --enable-db \
michael@224 124 --enable-fs \
michael@224 125 --enable-pipe \
michael@224 126 --enable-ssl \
michael@224 127 --with-sasl=gsasl \
michael@224 128 %if "%{with_sqlite}" == "yes"
michael@224 129 --enable-sqlite \
michael@224 130 %else
michael@224 131 --disable-sqlite \
michael@224 132 %endif
michael@224 133 %if "%{with_mysql}" == "yes"
michael@224 134 --enable-mysql \
michael@224 135 %else
michael@224 136 --disable-mysql \
michael@224 137 %endif
michael@224 138 %if "%{with_pgsql}" == "yes"
michael@224 139 --enable-pgsql \
michael@224 140 %else
michael@224 141 --disable-pgsql \
michael@224 142 %endif
michael@224 143 %if "%{with_pam}" == "yes"
michael@224 144 --enable-pam \
michael@224 145 %else
michael@224 146 --disable-pam \
michael@224 147 %endif
michael@224 148 --disable-oracle \
michael@224 149 --enable-static \
michael@224 150 --enable-shared
michael@224 151
michael@224 152 # build program
michael@224 153 %{l_make} %{l_mflags}
michael@224 154
michael@224 155 %install
michael@224 156 # create installation filesystem structure
michael@224 157 rm -rf $RPM_BUILD_ROOT
michael@224 158 %{l_shtool} mkdir -f -p -m 755 \
michael@224 159 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@224 160 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \
michael@224 161 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \
michael@224 162 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \
michael@224 163 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \
michael@224 164 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
michael@224 165 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
michael@224 166
michael@224 167 # install components
michael@224 168 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@224 169
michael@224 170 # remove unnecessary files
michael@224 171 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
michael@224 172 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
michael@224 173 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a
michael@224 174
michael@224 175 # install run-command script
michael@224 176 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@224 177 %{SOURCE rc.jabberd} \
michael@224 178 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@224 179
michael@224 180 # determine installation files
michael@224 181 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@224 182 %{l_files_std} \
michael@224 183 '%config %{l_prefix}/etc/jabberd/*' \
michael@224 184 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \
michael@224 185 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'
michael@224 186
michael@224 187 %files -f files
michael@224 188
michael@224 189 %clean
michael@224 190 rm -rf $RPM_BUILD_ROOT
michael@224 191
michael@224 192 %post
michael@224 193 # after upgrade, restart service
michael@224 194 [ $1 -eq 2 ] || exit 0
michael@224 195 eval `%{l_rc} jabberd status 2>/dev/null`
michael@224 196 [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart
michael@224 197 exit 0
michael@224 198
michael@224 199 %preun
michael@224 200 # before erase, stop service and remove log files
michael@224 201 [ $1 -eq 0 ] || exit 0
michael@224 202 %{l_rc} jabberd stop 2>/dev/null
michael@224 203 rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true
michael@224 204 exit 0
michael@224 205

mercurial