Sat, 31 Oct 2009 19:00:00 +0100
Import package vendor original specs for necessary manipulations.
jabberd/jabberd.patch | file | annotate | diff | comparison | revisions | |
jabberd/jabberd.spec | file | annotate | diff | comparison | revisions | |
jabberd/rc.jabberd | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/jabberd/jabberd.patch Sat Oct 31 19:00:00 2009 +0100 1.3 @@ -0,0 +1,183 @@ 1.4 +Index: etc/c2s.xml.dist.in 1.5 +--- etc/c2s.xml.dist.in.orig 2009-06-30 11:38:16 +0200 1.6 ++++ etc/c2s.xml.dist.in 2009-06-30 20:45:22 +0200 1.7 +@@ -50,18 +50,16 @@ 1.8 + </router> 1.9 + 1.10 + <!-- Log configuration - type is "syslog", "file" or "stdout" --> 1.11 +- <log type='syslog'> 1.12 ++ <log type='file'> 1.13 + <!-- If logging to syslog, this is the log ident --> 1.14 +- <ident>jabberd/c2s</ident> 1.15 ++ <!-- <ident>jabberd/c2s</ident> --> 1.16 + 1.17 + <!-- If logging to syslog, this is the log facility 1.18 + (local0 - local7) [default: local3] --> 1.19 +- <facility>local3</facility> 1.20 ++ <!-- <facility>local3</facility> --> 1.21 + 1.22 + <!-- If logging to file, this is the filename of the logfile --> 1.23 +- <!-- 1.24 + <file>@localstatedir@/jabberd/log/c2s.log</file> 1.25 +- --> 1.26 + </log> 1.27 + 1.28 + <!-- Local network configuration --> 1.29 +@@ -137,7 +135,7 @@ 1.30 + <id password-change='true' /> --> 1.31 + 1.32 + <!-- IP address to bind to (default: 0.0.0.0) --> 1.33 +- <ip>0.0.0.0</ip> 1.34 ++ <ip>127.0.0.1</ip> 1.35 + 1.36 + <!-- Port to bind to, or 0 to disable unencrypted access to the 1.37 + server (default: 5222) --> 1.38 +@@ -331,7 +329,7 @@ 1.39 + <path>@pkglibdir@</path> 1.40 + 1.41 + <!-- Backend module to use --> 1.42 +- <module>sqlite</module> 1.43 ++ <module>db</module> 1.44 + 1.45 + <!-- Available authentication mechanisms --> 1.46 + <mechanisms> 1.47 +Index: etc/router.xml.dist.in 1.48 +--- etc/router.xml.dist.in.orig 2009-06-30 11:38:16 +0200 1.49 ++++ etc/router.xml.dist.in 2009-06-30 20:45:06 +0200 1.50 +@@ -8,24 +8,22 @@ 1.51 + <pidfile>@localstatedir@/jabberd/pid/router.pid</pidfile> 1.52 + 1.53 + <!-- Log configuration - type is "syslog", "file" or "stdout" --> 1.54 +- <log type='syslog'> 1.55 ++ <log type='file'> 1.56 + <!-- If logging to syslog, this is the log ident --> 1.57 +- <ident>jabberd/router</ident> 1.58 ++ <!-- <ident>jabberd/router</ident> --> 1.59 + 1.60 + <!-- If logging to syslog, this is the log facility 1.61 + (local0 - local7) [default: local3] --> 1.62 +- <facility>local3</facility> 1.63 ++ <!-- <facility>local3</facility> --> 1.64 + 1.65 + <!-- If logging to file, this is the filename of the logfile --> 1.66 +- <!-- 1.67 + <file>@localstatedir@/jabberd/log/router.log</file> 1.68 +- --> 1.69 + </log> 1.70 + 1.71 + <!-- Local network configuration --> 1.72 + <local> 1.73 + <!-- IP address to bind to (default: 0.0.0.0) --> 1.74 +- <ip>0.0.0.0</ip> 1.75 ++ <ip>127.0.0.1</ip> 1.76 + 1.77 + <!-- Port to bind to (default: 5347) --> 1.78 + <port>5347</port> 1.79 +Index: etc/s2s.xml.dist.in 1.80 +--- etc/s2s.xml.dist.in.orig 2009-06-30 11:38:16 +0200 1.81 ++++ etc/s2s.xml.dist.in 2009-06-30 20:45:06 +0200 1.82 +@@ -60,25 +60,23 @@ 1.83 + </router> 1.84 + 1.85 + <!-- Log configuration - type is "syslog", "file" or "stdout" --> 1.86 +- <log type='syslog'> 1.87 ++ <log type='file'> 1.88 + <!-- If logging to syslog, this is the log ident --> 1.89 +- <ident>jabberd/s2s</ident> 1.90 ++ <!-- <ident>jabberd/s2s</ident> --> 1.91 + 1.92 + <!-- If logging to syslog, this is the log facility 1.93 + (local0 - local7) [default: local3] --> 1.94 +- <facility>local3</facility> 1.95 ++ <!-- <facility>local3</facility> --> 1.96 + 1.97 + <!-- if logging to file, this is the filename of the logfile --> 1.98 +- <!-- 1.99 + <file>@localstatedir@/jabberd/log/s2s.log</file> 1.100 +- --> 1.101 + </log> 1.102 + 1.103 + <!-- Local network configuration --> 1.104 + <local> 1.105 + <!-- IP and port to listen for incoming s2s connections on 1.106 + (default: 0.0.0.0, 5269) --> 1.107 +- <ip>0.0.0.0</ip> 1.108 ++ <ip>127.0.0.1</ip> 1.109 + <port>5269</port> 1.110 + 1.111 + <!-- Multihomed machines (with more than one interface and IP address) 1.112 +Index: etc/sm.xml.dist.in 1.113 +--- etc/sm.xml.dist.in.orig 2009-06-30 11:38:16 +0200 1.114 ++++ etc/sm.xml.dist.in 2009-06-30 20:45:36 +0200 1.115 +@@ -50,13 +50,13 @@ 1.116 + </router> 1.117 + 1.118 + <!-- Log configuration - type is "syslog", "file" or "stdout" --> 1.119 +- <log type='syslog'> 1.120 ++ <log type='file'> 1.121 + <!-- If logging to syslog, this is the log ident --> 1.122 +- <ident>jabberd/sm</ident> 1.123 ++ <!-- <ident>jabberd/sm</ident> --> 1.124 + 1.125 + <!-- If logging to syslog, this is the log facility 1.126 + (local0 - local7) [default: local3] --> 1.127 +- <facility>local3</facility> 1.128 ++ <!-- <facility>local3</facility> --> 1.129 + 1.130 + <!-- If logging to file, this is the filename of the logfile --> 1.131 + <!-- 1.132 +@@ -85,7 +85,7 @@ 1.133 + <path>@pkglibdir@</path> 1.134 + 1.135 + <!-- By default, we use the SQLite driver for all storage --> 1.136 +- <driver>sqlite</driver> 1.137 ++ <driver>db</driver> 1.138 + 1.139 + <!-- Its also possible to explicitly list alternate drivers for 1.140 + specific data types. --> 1.141 +Index: sm/mod_iq_time.c 1.142 +--- sm/mod_iq_time.c.orig 2009-06-30 11:38:15 +0200 1.143 ++++ sm/mod_iq_time.c 2009-06-30 20:45:06 +0200 1.144 +@@ -39,6 +39,7 @@ 1.145 + static mod_ret_t _iq_time_pkt_sm(mod_instance_t mi, pkt_t pkt) 1.146 + { 1.147 + time_t t; 1.148 ++ time_t tzone; 1.149 + struct tm *tm; 1.150 + char buf[64]; 1.151 + char *c; 1.152 +@@ -78,7 +79,8 @@ 1.153 + datetime_out(t, dt_DATETIME, buf, 64); 1.154 + nad_insert_elem(pkt->nad, 2, NAD_ENS(pkt->nad, 1), "utc", buf); 1.155 + #ifdef HAVE_TZSET 1.156 +- snprintf(buf, 64, "%+03d:%02d", -((int)timezone)/(60*60), -((int)timezone)%(60*60)); 1.157 ++ tzone = (time_t)((long)mktime(gmtime(&t)) - (long)t); 1.158 ++ snprintf(buf, 64, "%+03d:%02d", (int) -tzone/(60*60), (int) -tzone%(60*60)); 1.159 + #else 1.160 + snprintf(buf, 64, "%+03d:%02d", (int) tm->tm_gmtoff/(60*60), (int) tm->tm_gmtoff%(60*60)); 1.161 + #endif 1.162 +Index: sm/mod_roster.c 1.163 +--- sm/mod_roster.c.orig 2009-06-30 11:38:15 +0200 1.164 ++++ sm/mod_roster.c 2009-06-30 20:45:06 +0200 1.165 +@@ -635,6 +635,9 @@ 1.166 + if(user->sessions == NULL) 1.167 + return mod_PASS; 1.168 + 1.169 ++ /* We have to free old packet - Lemming's memory leak fix */ 1.170 ++ pkt_free(pkt); 1.171 ++ 1.172 + /* build a new packet to push out to everyone */ 1.173 + pkt = pkt_create(user->sm, "iq", "set", NULL, NULL); 1.174 + pkt_id_new(pkt); 1.175 +Index: util/util.h 1.176 +--- util/util.h.orig 2009-06-30 11:38:16 +0200 1.177 ++++ util/util.h 2009-06-30 20:45:06 +0200 1.178 +@@ -30,6 +30,8 @@ 1.179 + #include <time.h> 1.180 + #include <errno.h> 1.181 + #include <assert.h> 1.182 ++#include <sys/types.h> 1.183 ++#include <sys/socket.h> 1.184 + 1.185 + #include <expat.h> 1.186 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/jabberd/jabberd.spec Sat Oct 31 19:00:00 2009 +0100 2.3 @@ -0,0 +1,205 @@ 2.4 +## 2.5 +## jabberd.spec -- OpenPKG RPM Package Specification 2.6 +## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> 2.7 +## 2.8 +## Permission to use, copy, modify, and distribute this software for 2.9 +## any purpose with or without fee is hereby granted, provided that 2.10 +## the above copyright notice and this permission notice appear in all 2.11 +## copies. 2.12 +## 2.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 2.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 2.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2.24 +## SUCH DAMAGE. 2.25 +## 2.26 + 2.27 +# package version 2.28 +%define V_major 2.2 2.29 +%define V_minor 9 2.30 + 2.31 +# package information 2.32 +Name: jabberd 2.33 +Summary: Jabber Instant Messaging Daemon 2.34 +URL: http://jabberd2.xiaoka.com/ 2.35 +Vendor: Jabber Software Foundation 2.36 +Packager: OpenPKG Foundation e.V. 2.37 +Distribution: OpenPKG Community 2.38 +Class: PLUS 2.39 +Group: InstantMessaging 2.40 +License: JOSL/GPL 2.41 +Version: %{V_major}.%{V_minor} 2.42 +Release: 20090707 2.43 + 2.44 +# package options 2.45 +%option with_sqlite no 2.46 +%option with_mysql no 2.47 +%option with_pgsql no 2.48 +%option with_pam no 2.49 + 2.50 +# list of sources 2.51 +Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz 2.52 +Source1: rc.jabberd 2.53 +Patch0: jabberd.patch 2.54 + 2.55 +# build information 2.56 +Prefix: %{l_prefix} 2.57 +BuildRoot: %{l_buildroot} 2.58 +BuildPreReq: OpenPKG, openpkg >= 20060823, make 2.59 +PreReq: OpenPKG, openpkg >= 20060823, perl 2.60 +BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns 2.61 +PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns 2.62 +%if "%{with_sqlite}" == "yes" 2.63 +BuildPreReq: sqlite 2.64 +PreReq: sqlite 2.65 +%endif 2.66 +%if "%{with_mysql}" == "yes" 2.67 +BuildPreReq: mysql 2.68 +PreReq: mysql 2.69 +%endif 2.70 +%if "%{with_pgsql}" == "yes" 2.71 +BuildPreReq: postgresql 2.72 +PreReq: postgresql 2.73 +%endif 2.74 +%if "%{with_pam}" == "yes" 2.75 +BuildPreReq: PAM 2.76 +PreReq: PAM 2.77 +%endif 2.78 +AutoReq: no 2.79 +AutoReqProv: no 2.80 + 2.81 +%description 2.82 + JabberD is the original server implementation for the Jabber instant 2.83 + messaging platform. JabberD 2 is the next generation of the JabberD 2.84 + server. It has been rewritten from the ground up to be scalable, 2.85 + architecturally sound, and to support the latest protocol extensions 2.86 + coming out of the JSF. 2.87 + 2.88 +%track 2.89 + prog jabberd = { 2.90 + version = %{version} 2.91 + url = http://codex.xiaoka.com/pub/jabberd2/releases/ 2.92 + regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz 2.93 + } 2.94 + 2.95 +%prep 2.96 + %setup -q -n jabberd-%{version} 2.97 + %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b 2.98 + %{l_shtool} subst \ 2.99 + -e 's;exec perl;exec %{l_prefix}/bin/perl;' \ 2.100 + tools/jabberd.in 2.101 + 2.102 +%build 2.103 + # configure program 2.104 + export CC="%{l_cc}" 2.105 + export CFLAGS="%{l_cflags -O}" 2.106 + export CPPFLAGS="%{l_cppflags libidn}" 2.107 + export LDFLAGS="%{l_ldflags}" 2.108 + export LIBS="" 2.109 + case "%{l_platform -t}" in 2.110 + *-linux* ) LIBS="$LIBS -ldl" ;; 2.111 + *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;; 2.112 + esac 2.113 + export JHOME=%{l_prefix}/var/jabberd 2.114 +%if "%{with_mysql}" == "yes" 2.115 + CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}" 2.116 + LDFLAGS="$LDFLAGS %{l_ldflags mysql}" 2.117 + LIBS="$LIBS -lz -lm" 2.118 +%endif 2.119 +%if "%{with_pgsql}" == "yes" 2.120 + CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}" 2.121 +%endif 2.122 + ./configure \ 2.123 + --prefix=%{l_prefix} \ 2.124 + --sysconfdir=%{l_prefix}/etc/jabberd \ 2.125 + --mandir=%{l_prefix}/man \ 2.126 + --enable-db \ 2.127 + --enable-fs \ 2.128 + --enable-pipe \ 2.129 + --enable-ssl \ 2.130 + --with-sasl=gsasl \ 2.131 +%if "%{with_sqlite}" == "yes" 2.132 + --enable-sqlite \ 2.133 +%else 2.134 + --disable-sqlite \ 2.135 +%endif 2.136 +%if "%{with_mysql}" == "yes" 2.137 + --enable-mysql \ 2.138 +%else 2.139 + --disable-mysql \ 2.140 +%endif 2.141 +%if "%{with_pgsql}" == "yes" 2.142 + --enable-pgsql \ 2.143 +%else 2.144 + --disable-pgsql \ 2.145 +%endif 2.146 +%if "%{with_pam}" == "yes" 2.147 + --enable-pam \ 2.148 +%else 2.149 + --disable-pam \ 2.150 +%endif 2.151 + --disable-oracle \ 2.152 + --enable-static \ 2.153 + --enable-shared 2.154 + 2.155 + # build program 2.156 + %{l_make} %{l_mflags} 2.157 + 2.158 +%install 2.159 + # create installation filesystem structure 2.160 + rm -rf $RPM_BUILD_ROOT 2.161 + %{l_shtool} mkdir -f -p -m 755 \ 2.162 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 2.163 + $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \ 2.164 + $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \ 2.165 + $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \ 2.166 + $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \ 2.167 + $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \ 2.168 + $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log 2.169 + 2.170 + # install components 2.171 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 2.172 + 2.173 + # remove unnecessary files 2.174 + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist 2.175 + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist 2.176 + rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a 2.177 + 2.178 + # install run-command script 2.179 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 2.180 + %{SOURCE rc.jabberd} \ 2.181 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 2.182 + 2.183 + # determine installation files 2.184 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 2.185 + %{l_files_std} \ 2.186 + '%config %{l_prefix}/etc/jabberd/*' \ 2.187 + '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \ 2.188 + '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' 2.189 + 2.190 +%files -f files 2.191 + 2.192 +%clean 2.193 + rm -rf $RPM_BUILD_ROOT 2.194 + 2.195 +%post 2.196 + # after upgrade, restart service 2.197 + [ $1 -eq 2 ] || exit 0 2.198 + eval `%{l_rc} jabberd status 2>/dev/null` 2.199 + [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart 2.200 + exit 0 2.201 + 2.202 +%preun 2.203 + # before erase, stop service and remove log files 2.204 + [ $1 -eq 0 ] || exit 0 2.205 + %{l_rc} jabberd stop 2>/dev/null 2.206 + rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true 2.207 + exit 0 2.208 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/jabberd/rc.jabberd Sat Oct 31 19:00:00 2009 +0100 3.3 @@ -0,0 +1,71 @@ 3.4 +#!@l_prefix@/bin/openpkg rc 3.5 +## 3.6 +## rc.jabberd -- Run-Commands 3.7 +## 3.8 + 3.9 +%config 3.10 + jabberd_enable="$openpkg_rc_def" 3.11 + jabberd_hostname=`hostname` 3.12 + jabberd_daemons="c2s resolver router s2s sm" 3.13 + jabberd_cfgfile="@l_prefix@/etc/jabberd/jabberd.cfg" 3.14 + jabberd_log_prolog="true" 3.15 + jabberd_log_epilog="true" 3.16 + jabberd_log_numfiles="10" 3.17 + jabberd_log_minsize="1M" 3.18 + jabberd_log_complevel="9" 3.19 + 3.20 +%common 3.21 + jabberd_signal () { 3.22 + local retcode=0 3.23 + local daemons= 3.24 + for daemons in $jabberd_daemons; do 3.25 + [ -f @l_prefix@/var/jabberd/pid/${daemons}.pid ] \ 3.26 + && kill -$1 `cat @l_prefix@/var/jabberd/pid/${daemons}.pid` 3.27 + retcode=$(($retcode+$?)) 3.28 + done 3.29 + return $retcode 3.30 + } 3.31 + 3.32 +%status -u @l_nusr@ -o 3.33 + jabberd_usable="unknown" 3.34 + jabberd_active="no" 3.35 + rcService jabberd enable yes && \ 3.36 + jabberd_signal 0 && jabberd_active="yes" 3.37 + echo "jabberd_enable=\"$jabberd_enable\"" 3.38 + echo "jabberd_usable=\"$jabberd_usable\"" 3.39 + echo "jabberd_active=\"$jabberd_active\"" 3.40 + 3.41 +%start -u @l_nusr@ 3.42 + rcService jabberd enable yes || exit 0 3.43 + rcService jabberd active yes && exit 0 3.44 + @l_prefix@/bin/jabberd -b -c $jabberd_cfgfile 3.45 + 3.46 +%stop -u @l_nusr@ 3.47 + rcService jabberd enable yes || exit 0 3.48 + rcService jabberd active no && exit 0 3.49 + jabberd_signal TERM 3.50 + sleep 2 3.51 + for daemons in $jabberd_daemons; do 3.52 + rm -f @l_prefix@/var/jabberd/pid/${daemons}.pid 3.53 + done 3.54 + 3.55 +%restart -u @l_nusr@ 3.56 + rcService jabberd enable yes || exit 0 3.57 + rcService jabberd active no && exit 0 3.58 + rc jabberd stop 3.59 + sleep 2 3.60 + rc jabberd start 3.61 + 3.62 +%daily -u @l_susr@ 3.63 + rcService jabberd enable yes || exit 0 3.64 + logfiles= 3.65 + for daemons in $jabberd_daemons; do 3.66 + logfiles="$logfiles @l_prefix@/var/jabberd/log/$daemons.log" 3.67 + done 3.68 + shtool rotate -f \ 3.69 + -n ${jabberd_log_numfiles} -s ${jabberd_log_minsize} -d \ 3.70 + -z ${jabberd_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ 3.71 + -P "${jabberd_log_prolog}" \ 3.72 + -E "${jabberd_log_epilog}; rc jabberd restart" \ 3.73 + $logfiles 3.74 +