jabberd/jabberd.spec

changeset 224
29b273d63835
child 225
a01e65d97743
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/jabberd/jabberd.spec	Sat Oct 31 19:00:00 2009 +0100
     1.3 @@ -0,0 +1,205 @@
     1.4 +##
     1.5 +##  jabberd.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_major 2.2
    1.29 +%define       V_minor 9
    1.30 +
    1.31 +#   package information
    1.32 +Name:         jabberd
    1.33 +Summary:      Jabber Instant Messaging Daemon
    1.34 +URL:          http://jabberd2.xiaoka.com/
    1.35 +Vendor:       Jabber Software Foundation
    1.36 +Packager:     OpenPKG Foundation e.V.
    1.37 +Distribution: OpenPKG Community
    1.38 +Class:        PLUS
    1.39 +Group:        InstantMessaging
    1.40 +License:      JOSL/GPL
    1.41 +Version:      %{V_major}.%{V_minor}
    1.42 +Release:      20090707
    1.43 +
    1.44 +#   package options
    1.45 +%option       with_sqlite no
    1.46 +%option       with_mysql  no
    1.47 +%option       with_pgsql  no
    1.48 +%option       with_pam    no
    1.49 +
    1.50 +#   list of sources
    1.51 +Source0:      http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz
    1.52 +Source1:      rc.jabberd
    1.53 +Patch0:       jabberd.patch
    1.54 +
    1.55 +#   build information
    1.56 +Prefix:       %{l_prefix}
    1.57 +BuildRoot:    %{l_buildroot}
    1.58 +BuildPreReq:  OpenPKG, openpkg >= 20060823, make
    1.59 +PreReq:       OpenPKG, openpkg >= 20060823, perl
    1.60 +BuildPreReq:  db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
    1.61 +PreReq:       db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
    1.62 +%if "%{with_sqlite}" == "yes"
    1.63 +BuildPreReq:  sqlite
    1.64 +PreReq:       sqlite
    1.65 +%endif
    1.66 +%if "%{with_mysql}" == "yes"
    1.67 +BuildPreReq:  mysql
    1.68 +PreReq:       mysql
    1.69 +%endif
    1.70 +%if "%{with_pgsql}" == "yes"
    1.71 +BuildPreReq:  postgresql
    1.72 +PreReq:       postgresql
    1.73 +%endif
    1.74 +%if "%{with_pam}" == "yes"
    1.75 +BuildPreReq:  PAM
    1.76 +PreReq:       PAM
    1.77 +%endif
    1.78 +AutoReq:      no
    1.79 +AutoReqProv:  no
    1.80 +
    1.81 +%description
    1.82 +    JabberD is the original server implementation for the Jabber instant
    1.83 +    messaging platform. JabberD 2 is the next generation of the JabberD
    1.84 +    server. It has been rewritten from the ground up to be scalable,
    1.85 +    architecturally sound, and to support the latest protocol extensions
    1.86 +    coming out of the JSF.
    1.87 +
    1.88 +%track
    1.89 +    prog jabberd = {
    1.90 +        version   = %{version}
    1.91 +        url       = http://codex.xiaoka.com/pub/jabberd2/releases/
    1.92 +        regex     = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz
    1.93 +    }
    1.94 +
    1.95 +%prep
    1.96 +    %setup -q -n jabberd-%{version}
    1.97 +    %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
    1.98 +    %{l_shtool} subst \
    1.99 +        -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
   1.100 +        tools/jabberd.in
   1.101 +
   1.102 +%build
   1.103 +    #   configure program
   1.104 +    export CC="%{l_cc}"
   1.105 +    export CFLAGS="%{l_cflags -O}"
   1.106 +    export CPPFLAGS="%{l_cppflags libidn}"
   1.107 +    export LDFLAGS="%{l_ldflags}"
   1.108 +    export LIBS=""
   1.109 +    case "%{l_platform -t}" in
   1.110 +        *-linux* ) LIBS="$LIBS -ldl"                ;;
   1.111 +        *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;;
   1.112 +    esac
   1.113 +    export JHOME=%{l_prefix}/var/jabberd
   1.114 +%if "%{with_mysql}" == "yes"
   1.115 +    CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}"
   1.116 +    LDFLAGS="$LDFLAGS %{l_ldflags mysql}"
   1.117 +    LIBS="$LIBS -lz -lm"
   1.118 +%endif
   1.119 +%if "%{with_pgsql}" == "yes"
   1.120 +    CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}"
   1.121 +%endif
   1.122 +    ./configure \
   1.123 +        --prefix=%{l_prefix} \
   1.124 +        --sysconfdir=%{l_prefix}/etc/jabberd \
   1.125 +        --mandir=%{l_prefix}/man \
   1.126 +        --enable-db \
   1.127 +        --enable-fs \
   1.128 +        --enable-pipe \
   1.129 +        --enable-ssl \
   1.130 +        --with-sasl=gsasl \
   1.131 +%if "%{with_sqlite}" == "yes"
   1.132 +        --enable-sqlite \
   1.133 +%else
   1.134 +        --disable-sqlite \
   1.135 +%endif
   1.136 +%if "%{with_mysql}" == "yes"
   1.137 +        --enable-mysql \
   1.138 +%else
   1.139 +        --disable-mysql \
   1.140 +%endif
   1.141 +%if "%{with_pgsql}" == "yes"
   1.142 +        --enable-pgsql \
   1.143 +%else
   1.144 +        --disable-pgsql \
   1.145 +%endif
   1.146 +%if "%{with_pam}" == "yes"
   1.147 +        --enable-pam \
   1.148 +%else
   1.149 +        --disable-pam \
   1.150 +%endif
   1.151 +        --disable-oracle \
   1.152 +        --enable-static \
   1.153 +        --enable-shared
   1.154 +
   1.155 +    #   build program
   1.156 +    %{l_make} %{l_mflags}
   1.157 +
   1.158 +%install
   1.159 +    #   create installation filesystem structure
   1.160 +    rm -rf $RPM_BUILD_ROOT
   1.161 +    %{l_shtool} mkdir -f -p -m 755 \
   1.162 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
   1.163 +        $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \
   1.164 +        $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \
   1.165 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \
   1.166 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \
   1.167 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
   1.168 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
   1.169 +
   1.170 +    #   install components
   1.171 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.172 +
   1.173 +    #   remove unnecessary files
   1.174 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
   1.175 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
   1.176 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a
   1.177 +
   1.178 +    #   install run-command script
   1.179 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.180 +        %{SOURCE rc.jabberd} \
   1.181 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.182 +
   1.183 +    #   determine installation files
   1.184 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.185 +        %{l_files_std} \
   1.186 +        '%config %{l_prefix}/etc/jabberd/*' \
   1.187 +        '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \
   1.188 +        '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'
   1.189 +
   1.190 +%files -f files
   1.191 +
   1.192 +%clean
   1.193 +    rm -rf $RPM_BUILD_ROOT
   1.194 +
   1.195 +%post
   1.196 +    #   after upgrade, restart service
   1.197 +    [ $1 -eq 2 ] || exit 0
   1.198 +    eval `%{l_rc} jabberd status 2>/dev/null`
   1.199 +    [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart
   1.200 +    exit 0
   1.201 +
   1.202 +%preun
   1.203 +    #   before erase, stop service and remove log files
   1.204 +    [ $1 -eq 0 ] || exit 0
   1.205 +    %{l_rc} jabberd stop 2>/dev/null
   1.206 +    rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true
   1.207 +    exit 0
   1.208 +

mercurial