jabberd/jabberd.spec

changeset 541
869d6847b13e
parent 540
6becb64fe77d
child 693
165d980aa5f1
     1.1 --- a/jabberd/jabberd.spec	Tue Aug 28 18:30:35 2012 +0200
     1.2 +++ b/jabberd/jabberd.spec	Tue Aug 28 18:30:40 2012 +0200
     1.3 @@ -23,7 +23,8 @@
     1.4  
     1.5  #   package version
     1.6  %define       V_major 2.2
     1.7 -%define       V_minor 14
     1.8 +%define       V_minor 17
     1.9 +%define       V_mucon 0.8
    1.10  
    1.11  #   package information
    1.12  Name:         jabberd
    1.13 @@ -36,16 +37,18 @@
    1.14  Group:        InstantMessaging
    1.15  License:      JOSL/GPL
    1.16  Version:      %{V_major}.%{V_minor}
    1.17 -Release:      20110602
    1.18 +Release:      20120800
    1.19  
    1.20  #   package options
    1.21  %option       with_sqlite no
    1.22  %option       with_mysql  no
    1.23  %option       with_pgsql  no
    1.24  %option       with_pam    no
    1.25 +%option       with_mucon  yes
    1.26  
    1.27  #   list of sources
    1.28 -Source0:      http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz
    1.29 +Source0:      http://www.github.com/downloads/Jabberd2/jabberd2/jabberd-%{version}.tar.xz
    1.30 +Source1:      http://download.gna.org/mu-conference/mu-conference_%{V_mucon}.tar.gz
    1.31  Source1:      rc.jabberd
    1.32  Patch0:       jabberd.patch
    1.33  
    1.34 @@ -70,6 +73,10 @@
    1.35  BuildPreReq:  PAM
    1.36  PreReq:       PAM
    1.37  %endif
    1.38 +%if "%{with_mucon}" == "yes"
    1.39 +BuildPreReq:  glib, pkgconfig
    1.40 +PreReq:       glib
    1.41 +%endif
    1.42  
    1.43  %description
    1.44      JabberD is the original server implementation for the Jabber instant
    1.45 @@ -81,16 +88,45 @@
    1.46  %track
    1.47      prog jabberd = {
    1.48          version   = %{version}
    1.49 -        url       = http://codex.xiaoka.com/pub/jabberd2/releases/
    1.50 -        regex     = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz
    1.51 +        url       = http://www.github.com/downloads/Jabberd2/jabberd2/
    1.52 +        regex     = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.xz
    1.53 +    }
    1.54 +    prog jabberd:mucon = {
    1.55 +        version   = %{V_mucon}
    1.56 +        url       = http://download.gna.org/mu-conference/
    1.57 +        regex     = mu-conference_(__VER__)\.tar\.gz
    1.58      }
    1.59  
    1.60  %prep
    1.61      %setup -q -n jabberd-%{version}
    1.62 -    %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
    1.63 +    %setup -q -D -T -a 1
    1.64      %{l_shtool} subst \
    1.65          -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
    1.66          tools/jabberd.in
    1.67 +    %{l_shtool} subst \
    1.68 +        -e 's;\$(initdir);;g' \
    1.69 +        etc/Makefile.in
    1.70 +%if "%{with_mucon}" == "yes"
    1.71 +    %{l_shtool} subst \
    1.72 +        -e 's;^\(CFLAGS\ *:=.*pkg-config --cflags glib-2.0\);\1 libidn;' \
    1.73 +        -e 's;^\(LIBS\ *:=.*\);\1 $(LOCLIBS);' \
    1.74 +        mu-conference_%{V_mucon}/src/Makefile
    1.75 +    %{l_shtool} subst \
    1.76 +        -e 's;mu-conference.log;muc.log;g' \
    1.77 +        mu-conference_%{V_mucon}/src/jcomp/jcr_log.c
    1.78 +    %{l_shtool} subst \
    1.79 +        -e 's;<port>[0-9][0-9]*</port>;<port>5347</port>;' \
    1.80 +        -e 's;<spool>.*</spool>;<spool>%{l_prefix}/var/jabberd/spool/rooms</spool>;' \
    1.81 +        -e 's;<logdir>\./syslogs</logdir>;<logdir>%{l_prefix}/var/jabberd/log</logdir>;' \
    1.82 +        -e 's;<logdir>\./logs/</logdir>;<logdir>%{l_prefix}/var/jabberd/spool/logs</logdir>;' \
    1.83 +        -e 's;<pidfile>.*</pidfile>;<pidfile>%{l_prefix}/var/jabberd/pid/muc.pid</pidfile>;' \
    1.84 +        -e 's;<URL>.*</URL>;<URL>http://name.host.tld/</URL>;' \
    1.85 +        -e 's;<stylesheet>.*</stylesheet>;<stylesheet>%{l_prefix}/share/jabberd/style.css</stylesheet>;' \
    1.86 +        mu-conference_%{V_mucon}/muc-default.xml
    1.87 +    echo \
    1.88 +        'muc         @sysconfdir@/muc.xml' \
    1.89 +        >>etc/jabberd.cfg.dist.in
    1.90 +%endif
    1.91  
    1.92  %build
    1.93      #   configure program
    1.94 @@ -149,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 @@ -165,13 +213,36 @@
   1.116      #   install components
   1.117      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.118  
   1.119 +    #   install optional components
   1.120 +%if "%{with_mucon}" == "yes"
   1.121 +    %{l_shtool} mkdir -f -p -m 755 \
   1.122 +        $RPM_BUILD_ROOT%{l_prefix}/share/jabberd \
   1.123 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/logs \
   1.124 +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/rooms
   1.125 +    %{l_shtool} install -c -m 644 \
   1.126 +        mu-conference_%{V_mucon}/muc-default.xml \
   1.127 +        $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/muc.xml
   1.128 +    %{l_shtool} install -c \
   1.129 +        mu-conference_%{V_mucon}/src/mu-conference \
   1.130 +        $RPM_BUILD_ROOT%{l_prefix}/bin/
   1.131 +    %{l_shtool} install -c \
   1.132 +        mu-conference_%{V_mucon}/style.css \
   1.133 +        $RPM_BUILD_ROOT%{l_prefix}/share/jabberd
   1.134 +%endif
   1.135 +
   1.136 +    #   strip installation
   1.137 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.138 +
   1.139      #   remove unnecessary files
   1.140      rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
   1.141      rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
   1.142      rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a
   1.143  
   1.144 -    #   install run-command script
   1.145 +    #   install runcommand script
   1.146      %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.147 +%if "%{with_mucon}" == "yes"
   1.148 +        -e 's;\(jabberd_daemons\s*=.*\)\s\s*\(\w\w*\);\1 mucon\2;' \
   1.149 +%endif
   1.150          %{SOURCE rc.jabberd} \
   1.151          $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.152  

mercurial