jabberd/jabberd.spec

changeset 225
a01e65d97743
parent 224
29b273d63835
child 231
dc6d3ff779e4
     1.1 --- a/jabberd/jabberd.spec	Sat Oct 31 19:00:00 2009 +0100
     1.2 +++ b/jabberd/jabberd.spec	Sat Oct 31 19:03:03 2009 +0100
     1.3 @@ -24,6 +24,7 @@
     1.4  #   package version
     1.5  %define       V_major 2.2
     1.6  %define       V_minor 9
     1.7 +%define       V_mucon 0.8
     1.8  
     1.9  #   package information
    1.10  Name:         jabberd
    1.11 @@ -36,17 +37,19 @@
    1.12  Group:        InstantMessaging
    1.13  License:      JOSL/GPL
    1.14  Version:      %{V_major}.%{V_minor}
    1.15 -Release:      20090707
    1.16 +Release:      20091028
    1.17  
    1.18  #   package options
    1.19 -%option       with_sqlite no
    1.20 +%option       with_mucon  yes
    1.21 +%option       with_sqlite yes
    1.22  %option       with_mysql  no
    1.23  %option       with_pgsql  no
    1.24  %option       with_pam    no
    1.25  
    1.26  #   list of sources
    1.27  Source0:      http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz
    1.28 -Source1:      rc.jabberd
    1.29 +Source1:      http://download.gna.org/mu-conference/mu-conference_%{V_mucon}.tar.gz
    1.30 +Source2:      rc.jabberd
    1.31  Patch0:       jabberd.patch
    1.32  
    1.33  #   build information
    1.34 @@ -56,6 +59,10 @@
    1.35  PreReq:       OpenPKG, openpkg >= 20060823, perl
    1.36  BuildPreReq:  db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
    1.37  PreReq:       db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
    1.38 +%if "%{with_mucon}" == "yes"
    1.39 +BuildPreReq:  glib2
    1.40 +PreReq:       glib2
    1.41 +%endif
    1.42  %if "%{with_sqlite}" == "yes"
    1.43  BuildPreReq:  sqlite
    1.44  PreReq:       sqlite
    1.45 @@ -88,13 +95,40 @@
    1.46          url       = http://codex.xiaoka.com/pub/jabberd2/releases/
    1.47          regex     = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz
    1.48      }
    1.49 +    prog jabberd:mucon = {
    1.50 +        version   = %{V_mucon}
    1.51 +        url       = http://download.gna.org/mu-conference/
    1.52 +        regex     = mu-conference_(__VER__)\.tar\.gz
    1.53 +    }
    1.54  
    1.55  %prep
    1.56      %setup -q -n jabberd-%{version}
    1.57 +    %setup -q -D -T -a 1
    1.58      %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
    1.59      %{l_shtool} subst \
    1.60          -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
    1.61          tools/jabberd.in
    1.62 +%if "%{with_mucon}" == "yes"
    1.63 +    %{l_shtool} subst \
    1.64 +        -e 's;^\(CFLAGS\ *:=.*pkg-config --cflags glib-2.0\);\1 libidn;' \
    1.65 +        -e 's;^\(LIBS\ *:=.*\);\1 $(LOCLIBS);' \
    1.66 +        mu-conference_%{V_mucon}/src/Makefile
    1.67 +    %{l_shtool} subst \
    1.68 +        -e 's;mu-conference.log;muc.log;g' \
    1.69 +        mu-conference_%{V_mucon}/src/jcomp/jcr_log.c
    1.70 +    %{l_shtool} subst \
    1.71 +        -e 's;<port>[0-9][0-9]*</port>;<port>5347</port>;' \
    1.72 +        -e 's;<spool>.*</spool>;<spool>%{l_prefix}/var/jabberd/spool/rooms</spool>;' \
    1.73 +        -e 's;<logdir>\./syslogs</logdir>;<logdir>%{l_prefix}/var/jabberd/log</logdir>;' \
    1.74 +        -e 's;<logdir>\./logs/</logdir>;<logdir>%{l_prefix}/var/jabberd/spool/logs</logdir>;' \
    1.75 +        -e 's;<pidfile>.*</pidfile>;<pidfile>%{l_prefix}/var/jabberd/pid/muc.pid</pidfile>;' \
    1.76 +        -e 's;<URL>.*</URL>;<URL>http://name.host.tld/</URL>;' \
    1.77 +        -e 's;<stylesheet>.*</stylesheet>;<stylesheet>%{l_prefix}/share/jabberd/style.css</stylesheet>;' \
    1.78 +        mu-conference_%{V_mucon}/muc-default.xml
    1.79 +    echo \
    1.80 +        'muc         @sysconfdir@/muc.xml' \
    1.81 +        >>etc/jabberd.cfg.dist.in
    1.82 +%endif
    1.83  
    1.84  %build
    1.85      #   configure program
    1.86 @@ -124,6 +158,7 @@
    1.87          --enable-fs \
    1.88          --enable-pipe \
    1.89          --enable-ssl \
    1.90 +        --enable-debug \
    1.91          --with-sasl=gsasl \
    1.92  %if "%{with_sqlite}" == "yes"
    1.93          --enable-sqlite \
    1.94 @@ -150,7 +185,19 @@
    1.95          --enable-shared
    1.96  
    1.97      #   build program
    1.98 -    %{l_make} %{l_mflags}
    1.99 +    %{l_make} %{l_mflags -O}
   1.100 +
   1.101 +%if "%{with_mucon}" == "yes"
   1.102 +    loclibs=''
   1.103 +    case "%{l_platform -t}" in
   1.104 +        *-sunos* )
   1.105 +            loclibs='-lsocket -lnsl'
   1.106 +            ;;
   1.107 +    esac
   1.108 +    ( cd mu-conference_%{V_mucon}
   1.109 +      %{l_make} %{l_mflags -O} LOCLIBS=$loclibs
   1.110 +    ) || exit $?
   1.111 +%endif
   1.112  
   1.113  %install
   1.114      #   create installation filesystem structure
   1.115 @@ -164,9 +211,29 @@
   1.116          $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
   1.117          $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
   1.118  
   1.119 -    #   install components
   1.120 +    #   install required components
   1.121      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.122  
   1.123 +    #   install optional components
   1.124 +%if "%{with_mucon}" == "yes"
   1.125 +    %{l_shtool} mkdir -f -p -m 755 \
   1.126 +        $RPM_BUILD_ROOT%{l_prefix}/share/jabberd \
   1.127 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/logs \
   1.128 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/rooms
   1.129 +    %{l_shtool} install -c -m 644 \
   1.130 +        mu-conference_%{V_mucon}/muc-default.xml \
   1.131 +        $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/muc.xml
   1.132 +    %{l_shtool} install -c \
   1.133 +        mu-conference_%{V_mucon}/src/mu-conference \
   1.134 +        $RPM_BUILD_ROOT%{l_prefix}/bin/
   1.135 +    %{l_shtool} install -c \
   1.136 +        mu-conference_%{V_mucon}/style.css \
   1.137 +        $RPM_BUILD_ROOT%{l_prefix}/share/jabberd
   1.138 +%endif
   1.139 +
   1.140 +    #   strip installation
   1.141 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.142 +
   1.143      #   remove unnecessary files
   1.144      rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
   1.145      rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
   1.146 @@ -174,6 +241,9 @@
   1.147  
   1.148      #   install run-command script
   1.149      %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.150 +%if "%{with_mucon}" == "yes"
   1.151 +        -e 's;\(jabberd_daemons\s*=.*\)\s\s*\(\w\w*\);\1 mucon\2;' \
   1.152 +%endif
   1.153          %{SOURCE rc.jabberd} \
   1.154          $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.155  
   1.156 @@ -181,6 +251,7 @@
   1.157      %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.158          %{l_files_std} \
   1.159          '%config %{l_prefix}/etc/jabberd/*' \
   1.160 +        '%config %{l_prefix}/var/jabberd/db/*' \
   1.161          '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \
   1.162          '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'
   1.163  

mercurial