diff -r 29b273d63835 -r a01e65d97743 jabberd/jabberd.spec --- a/jabberd/jabberd.spec Sat Oct 31 19:00:00 2009 +0100 +++ b/jabberd/jabberd.spec Sat Oct 31 19:03:03 2009 +0100 @@ -24,6 +24,7 @@ # package version %define V_major 2.2 %define V_minor 9 +%define V_mucon 0.8 # package information Name: jabberd @@ -36,17 +37,19 @@ Group: InstantMessaging License: JOSL/GPL Version: %{V_major}.%{V_minor} -Release: 20090707 +Release: 20091028 # package options -%option with_sqlite no +%option with_mucon yes +%option with_sqlite yes %option with_mysql no %option with_pgsql no %option with_pam no # list of sources Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz -Source1: rc.jabberd +Source1: http://download.gna.org/mu-conference/mu-conference_%{V_mucon}.tar.gz +Source2: rc.jabberd Patch0: jabberd.patch # build information @@ -56,6 +59,10 @@ PreReq: OpenPKG, openpkg >= 20060823, perl BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns +%if "%{with_mucon}" == "yes" +BuildPreReq: glib2 +PreReq: glib2 +%endif %if "%{with_sqlite}" == "yes" BuildPreReq: sqlite PreReq: sqlite @@ -88,13 +95,40 @@ url = http://codex.xiaoka.com/pub/jabberd2/releases/ regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz } + prog jabberd:mucon = { + version = %{V_mucon} + url = http://download.gna.org/mu-conference/ + regex = mu-conference_(__VER__)\.tar\.gz + } %prep %setup -q -n jabberd-%{version} + %setup -q -D -T -a 1 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b %{l_shtool} subst \ -e 's;exec perl;exec %{l_prefix}/bin/perl;' \ tools/jabberd.in +%if "%{with_mucon}" == "yes" + %{l_shtool} subst \ + -e 's;^\(CFLAGS\ *:=.*pkg-config --cflags glib-2.0\);\1 libidn;' \ + -e 's;^\(LIBS\ *:=.*\);\1 $(LOCLIBS);' \ + mu-conference_%{V_mucon}/src/Makefile + %{l_shtool} subst \ + -e 's;mu-conference.log;muc.log;g' \ + mu-conference_%{V_mucon}/src/jcomp/jcr_log.c + %{l_shtool} subst \ + -e 's;[0-9][0-9]*;5347;' \ + -e 's;.*;%{l_prefix}/var/jabberd/spool/rooms;' \ + -e 's;\./syslogs;%{l_prefix}/var/jabberd/log;' \ + -e 's;\./logs/;%{l_prefix}/var/jabberd/spool/logs;' \ + -e 's;.*;%{l_prefix}/var/jabberd/pid/muc.pid;' \ + -e 's;.*;http://name.host.tld/;' \ + -e 's;.*;%{l_prefix}/share/jabberd/style.css;' \ + mu-conference_%{V_mucon}/muc-default.xml + echo \ + 'muc @sysconfdir@/muc.xml' \ + >>etc/jabberd.cfg.dist.in +%endif %build # configure program @@ -124,6 +158,7 @@ --enable-fs \ --enable-pipe \ --enable-ssl \ + --enable-debug \ --with-sasl=gsasl \ %if "%{with_sqlite}" == "yes" --enable-sqlite \ @@ -150,7 +185,19 @@ --enable-shared # build program - %{l_make} %{l_mflags} + %{l_make} %{l_mflags -O} + +%if "%{with_mucon}" == "yes" + loclibs='' + case "%{l_platform -t}" in + *-sunos* ) + loclibs='-lsocket -lnsl' + ;; + esac + ( cd mu-conference_%{V_mucon} + %{l_make} %{l_mflags -O} LOCLIBS=$loclibs + ) || exit $? +%endif %install # create installation filesystem structure @@ -164,9 +211,29 @@ $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \ $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log - # install components + # install required components %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT + # install optional components +%if "%{with_mucon}" == "yes" + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/share/jabberd \ + $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/logs \ + $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/rooms + %{l_shtool} install -c -m 644 \ + mu-conference_%{V_mucon}/muc-default.xml \ + $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/muc.xml + %{l_shtool} install -c \ + mu-conference_%{V_mucon}/src/mu-conference \ + $RPM_BUILD_ROOT%{l_prefix}/bin/ + %{l_shtool} install -c \ + mu-conference_%{V_mucon}/style.css \ + $RPM_BUILD_ROOT%{l_prefix}/share/jabberd +%endif + + # strip installation + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true + # remove unnecessary files rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist @@ -174,6 +241,9 @@ # install run-command script %{l_shtool} install -c -m 755 %{l_value -s -a} \ +%if "%{with_mucon}" == "yes" + -e 's;\(jabberd_daemons\s*=.*\)\s\s*\(\w\w*\);\1 mucon\2;' \ +%endif %{SOURCE rc.jabberd} \ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ @@ -181,6 +251,7 @@ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ '%config %{l_prefix}/etc/jabberd/*' \ + '%config %{l_prefix}/var/jabberd/db/*' \ '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \ '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'