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.

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

mercurial