jabberd/jabberd.spec

Fri, 21 Sep 2012 22:41:30 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 21 Sep 2012 22:41:30 +0200
changeset 701
86ba9e0b19e2
parent 541
869d6847b13e
child 704
0a3af3462343
permissions
-rw-r--r--

Modify manpage path from /usr/share to /usr/man.

     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 17
    27 %define       V_mucon 0.8
    29 #   package information
    30 Name:         jabberd
    31 Summary:      Jabber Instant Messaging Daemon
    32 URL:          http://jabberd2.xiaoka.com/
    33 Vendor:       Jabber Software Foundation
    34 Packager:     OpenPKG Foundation e.V.
    35 Distribution: OpenPKG Community
    36 Class:        PLUS
    37 Group:        InstantMessaging
    38 License:      JOSL/GPL
    39 Version:      %{V_major}.%{V_minor}
    40 Release:      20120800
    42 #   package options
    43 %option       with_sqlite yes
    44 %option       with_mysql  no
    45 %option       with_pgsql  no
    46 %option       with_pam    no
    47 %option       with_mucon  yes
    49 #   list of sources
    50 Source0:      http://www.github.com/downloads/Jabberd2/jabberd2/jabberd-%{version}.tar.xz
    51 Source1:      http://download.gna.org/mu-conference/mu-conference_%{V_mucon}.tar.gz
    52 Source1:      rc.jabberd
    53 Patch0:       jabberd.patch
    55 #   build information
    56 BuildPreReq:  OpenPKG, openpkg >= 20100101, make
    57 PreReq:       OpenPKG, openpkg >= 20100101, perl
    58 BuildPreReq:  db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
    59 PreReq:       db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
    60 %if "%{with_sqlite}" == "yes"
    61 BuildPreReq:  sqlite
    62 PreReq:       sqlite
    63 %endif
    64 %if "%{with_mysql}" == "yes"
    65 BuildPreReq:  mysql
    66 PreReq:       mysql
    67 %endif
    68 %if "%{with_pgsql}" == "yes"
    69 BuildPreReq:  postgresql
    70 PreReq:       postgresql
    71 %endif
    72 %if "%{with_pam}" == "yes"
    73 BuildPreReq:  PAM
    74 PreReq:       PAM
    75 %endif
    76 %if "%{with_mucon}" == "yes"
    77 BuildPreReq:  glib, pkgconfig
    78 PreReq:       glib
    79 %endif
    81 %description
    82     JabberD is the original server implementation for the Jabber instant
    83     messaging platform. JabberD 2 is the next generation of the JabberD
    84     server. It has been rewritten from the ground up to be scalable,
    85     architecturally sound, and to support the latest protocol extensions
    86     coming out of the JSF.
    88 %track
    89     prog jabberd = {
    90         version   = %{version}
    91         url       = http://www.github.com/downloads/Jabberd2/jabberd2/
    92         regex     = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.xz
    93     }
    94     prog jabberd:mucon = {
    95         version   = %{V_mucon}
    96         url       = http://download.gna.org/mu-conference/
    97         regex     = mu-conference_(__VER__)\.tar\.gz
    98     }
   100 %prep
   101     %setup -q -n jabberd-%{version}
   102     %setup -q -D -T -a 1
   103     %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
   104     %{l_shtool} subst \
   105         -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
   106         tools/jabberd.in
   107     %{l_shtool} subst \
   108         -e 's;\$(initdir);;g' \
   109         etc/Makefile.in
   110 %if "%{with_mucon}" == "yes"
   111     %{l_shtool} subst \
   112         -e 's;^\(CFLAGS\ *:=.*pkg-config --cflags glib-2.0\);\1 libidn;' \
   113         -e 's;^\(LIBS\ *:=.*\);\1 $(LOCLIBS);' \
   114         mu-conference_%{V_mucon}/src/Makefile
   115     %{l_shtool} subst \
   116         -e 's;mu-conference.log;muc.log;g' \
   117         mu-conference_%{V_mucon}/src/jcomp/jcr_log.c
   118     %{l_shtool} subst \
   119         -e 's;<port>[0-9][0-9]*</port>;<port>5347</port>;' \
   120         -e 's;<spool>.*</spool>;<spool>%{l_prefix}/var/jabberd/spool/rooms</spool>;' \
   121         -e 's;<logdir>\./syslogs</logdir>;<logdir>%{l_prefix}/var/jabberd/log</logdir>;' \
   122         -e 's;<logdir>\./logs/</logdir>;<logdir>%{l_prefix}/var/jabberd/spool/logs</logdir>;' \
   123         -e 's;<pidfile>.*</pidfile>;<pidfile>%{l_prefix}/var/jabberd/pid/muc.pid</pidfile>;' \
   124         -e 's;<URL>.*</URL>;<URL>http://name.host.tld/</URL>;' \
   125         -e 's;<stylesheet>.*</stylesheet>;<stylesheet>%{l_prefix}/share/jabberd/style.css</stylesheet>;' \
   126         mu-conference_%{V_mucon}/muc-default.xml
   127     echo \
   128         'muc         @sysconfdir@/muc.xml' \
   129         >>etc/jabberd.cfg.dist.in
   130 %endif
   132 %build
   133     #   configure program
   134     ( echo "ac_cv_func_kqueue=no"
   135     ) >config.cache
   136     export CC="%{l_cc}"
   137     export CFLAGS="%{l_cflags -O}"
   138     export CPPFLAGS="%{l_cppflags libidn}"
   139     export LDFLAGS="%{l_ldflags}"
   140     export LIBS=""
   141     case "%{l_platform -t}" in
   142         *-linux* ) LIBS="$LIBS -ldl"                ;;
   143         *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;;
   144     esac
   145     export JHOME=%{l_prefix}/var/jabberd
   146 %if "%{with_mysql}" == "yes"
   147     CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}"
   148     LDFLAGS="$LDFLAGS %{l_ldflags mysql}"
   149     LIBS="$LIBS -lz -lm"
   150 %endif
   151 %if "%{with_pgsql}" == "yes"
   152     CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}"
   153 %endif
   154     ./configure \
   155         --cache-file=./config.cache \
   156         --prefix=%{l_prefix} \
   157         --sysconfdir=%{l_prefix}/etc/jabberd \
   158         --mandir=%{l_prefix}/man \
   159         --enable-db \
   160         --enable-fs \
   161         --enable-pipe \
   162         --enable-ssl \
   163         --with-sasl=gsasl \
   164 %if "%{with_sqlite}" == "yes"
   165         --enable-sqlite \
   166 %else
   167         --disable-sqlite \
   168 %endif
   169 %if "%{with_mysql}" == "yes"
   170         --enable-mysql \
   171 %else
   172         --disable-mysql \
   173 %endif
   174 %if "%{with_pgsql}" == "yes"
   175         --enable-pgsql \
   176 %else
   177         --disable-pgsql \
   178 %endif
   179 %if "%{with_pam}" == "yes"
   180         --enable-pam \
   181 %else
   182         --disable-pam \
   183 %endif
   184         --disable-oracle \
   185         --enable-static \
   186         --enable-shared
   188     #   build program
   189     %{l_make} %{l_mflags -O}
   191 %if "%{with_mucon}" == "yes"
   192     loclibs=''
   193     case "%{l_platform -t}" in
   194         *-sunos* )
   195             loclibs='-lsocket -lnsl'
   196             ;;
   197     esac
   198     ( cd mu-conference_%{V_mucon}
   199       %{l_make} %{l_mflags -O} LOCLIBS=$loclibs
   200     ) || exit $?
   201 %endif
   203 %install
   204     #   create installation filesystem structure
   205     %{l_shtool} mkdir -f -p -m 755 \
   206         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
   207         $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \
   208         $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \
   209         $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \
   210         $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \
   211         $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
   212         $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
   214     #   install components
   215     %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   217     #   install optional components
   218 %if "%{with_mucon}" == "yes"
   219     %{l_shtool} mkdir -f -p -m 755 \
   220         $RPM_BUILD_ROOT%{l_prefix}/share/jabberd \
   221         $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/logs \
   222         $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/rooms
   223     %{l_shtool} install -c -m 644 \
   224         mu-conference_%{V_mucon}/muc-default.xml \
   225         $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/muc.xml
   226     %{l_shtool} install -c \
   227         mu-conference_%{V_mucon}/src/mu-conference \
   228         $RPM_BUILD_ROOT%{l_prefix}/bin/
   229     %{l_shtool} install -c \
   230         mu-conference_%{V_mucon}/style.css \
   231         $RPM_BUILD_ROOT%{l_prefix}/share/jabberd
   232 %endif
   234     #   strip installation
   235     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   237     #   remove unnecessary files
   238     rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
   239     rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
   240     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a
   242     #   install runcommand script
   243     %{l_shtool} install -c -m 755 %{l_value -s -a} \
   244 %if "%{with_mucon}" == "yes"
   245         -e 's;\(jabberd_daemons\s*=.*\)\s\s*\(\w\w*\);\1 mucon\2;' \
   246 %endif
   247         %{SOURCE rc.jabberd} \
   248         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   250     #   determine installation files
   251     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   252         %{l_files_std} \
   253         '%config %{l_prefix}/etc/jabberd/*' \
   254         '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \
   255         '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'
   257 %files -f files
   259 %clean
   261 %post
   262     #   after upgrade, restart service
   263     [ $1 -eq 2 ] || exit 0
   264     eval `%{l_rc} jabberd status 2>/dev/null`
   265     [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart
   266     exit 0
   268 %preun
   269     #   before erase, stop service and remove log files
   270     [ $1 -eq 0 ] || exit 0
   271     %{l_rc} jabberd stop 2>/dev/null
   272     rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true
   273     exit 0

mercurial