OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   03-Oct-2004 18:51:07
  Branch: HEAD                             Handle: 2004100317510700

  Modified files:
    openpkg-src/jabberd     jabberd.patch jabberd.spec rc.jabberd

  Log:
    upgrade to JabberD 2.0 (hopefully this isn't totally broken ;-)

  Summary:
    Revision    Changes     Path
    1.2         +176 -36    openpkg-src/jabberd/jabberd.patch
    1.21        +95 -47     openpkg-src/jabberd/jabberd.spec
    1.11        +30 -39     openpkg-src/jabberd/rc.jabberd
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/jabberd/jabberd.patch
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 jabberd.patch
  --- openpkg-src/jabberd/jabberd.patch 17 Dec 2003 08:31:14 -0000      1.1
  +++ openpkg-src/jabberd/jabberd.patch 3 Oct 2004 16:51:07 -0000       1.2
  @@ -1,37 +1,177 @@
  -Index: jabberd/jabberd.h
  ---- jabberd/jabberd.h.orig   2003-11-13 12:22:42.000000000 +0100
  -+++ jabberd/jabberd.h        2003-12-17 09:29:41.000000000 +0100
  -@@ -30,7 +30,7 @@
  - #include "lib/lib.h"
  - #include <pth.h>
  - #ifdef HAVE_SSL
  --#include <ssl.h>
  -+#include <openssl/ssl.h>
  - #endif /* HAVE_SSL */
  - 
  - #define VERSION "1.4.3"
  -Index: jabberd/mio_ssl.c
  ---- jabberd/mio_ssl.c.orig   2003-11-08 01:09:50.000000000 +0100
  -+++ jabberd/mio_ssl.c        2003-12-17 09:29:28.000000000 +0100
  -@@ -1,6 +1,6 @@
  - #include "jabberd.h"
  - #ifdef HAVE_SSL
  --#include <err.h>
  -+#include <openssl/err.h>
  - 
  - HASHTABLE ssl__ctxs;
  - extern int mio__errno;
  -Index: jsm/modules/mod_auth_crypt.c
  ---- jsm/modules/mod_auth_crypt.c.orig        2003-10-27 20:16:50.000000000 +0100
  -+++ jsm/modules/mod_auth_crypt.c     2003-12-17 09:28:50.000000000 +0100
  -@@ -28,7 +28,9 @@
  -  * 
  -  * --------------------------------------------------------------------------*/
  - #include "jsm.h"
  --#include "crypt.h"
  -+#ifndef __FreeBSD__
  -+#include <crypt.h>
  -+#endif
  +Index: util/util.h
  +--- util/util.h.orig 2004-05-31 23:31:06 +0200
  ++++ util/util.h      2004-09-22 21:26:44 +0200
  +@@ -30,6 +30,8 @@
  + #include <time.h>
  + #include <errno.h>
  + #include <assert.h>
  ++#include <sys/types.h>
  ++#include <sys/socket.h>
    
  - #define HASH_CRYPT 1
  - #define HASH_SHA1  2
  + #ifdef HAVE_NETINET_IN_H
  + # include <netinet/in.h>
  +Index: etc/c2s.xml.dist.in
  +--- etc/c2s.xml.dist.in.orig 2004-04-26 07:42:53 +0200
  ++++ etc/c2s.xml.dist.in      2004-09-22 21:48:33 +0200
  +@@ -46,18 +46,16 @@
  +   </router>
  + 
  +   <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  +-  <log type='syslog'>
  ++  <log type='file'>
  +     <!-- If logging to syslog, this is the log ident -->
  +-    <ident>jabberd/c2s</ident>
  ++    <!-- <ident>jabberd/c2s</ident> -->
  + 
  +     <!-- If logging to syslog, this is the log facility
  +          (local0 - local7)                        [default: local3] -->
  +-    <facility>local3</facility>
  ++    <!-- <facility>local3</facility> -->
  +     
  +     <!-- If logging to file, this is the filename of the logfile -->
  +-    <!--
  +     <file>@localstatedir@/jabberd/log/c2s.log</file>
  +-    -->
  +   </log>
  + 
  +   <!-- Local network configuration -->
  +@@ -78,7 +76,7 @@
  +     <!-- <id realm='company'>localhost</id> -->
  + 
  +     <!-- IP address to bind to (default: 0.0.0.0) -->
  +-    <ip>0.0.0.0</ip>
  ++    <ip>127.0.0.1</ip>
  + 
  +     <!-- Port to bind to, or 0 to disable unencrypted access to the
  +          server (default: 5222) -->
  +@@ -206,7 +204,7 @@
  +   <!-- Authentication/registration database configuration -->
  +   <authreg>
  +     <!-- Backend module to use -->
  +-    <module>mysql</module>
  ++    <module>db</module>
  + 
  +     <!-- Registration configuration -->
  +     <register>
  +Index: etc/resolver.xml.dist.in
  +--- etc/resolver.xml.dist.in.orig    2004-04-01 06:56:55 +0200
  ++++ etc/resolver.xml.dist.in 2004-09-22 21:48:58 +0200
  +@@ -46,18 +46,16 @@
  +   </router>
  + 
  +   <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  +-  <log type='syslog'>
  ++  <log type='file'>
  +     <!-- If logging to syslog, this is the log ident -->
  +-    <ident>jabberd/resolver</ident>
  ++    <!-- <ident>jabberd/resolver</ident> -->
  + 
  +     <!-- If logging to syslog, this is the log facility
  +          (local0 - local7)                        [default: local3] -->
  +-    <facility>local3</facility>
  ++    <!-- <facility>local3</facility> -->
  + 
  +     <!-- If logging to file, this is the filename of the logfile -->
  +-    <!--
  +     <file>@localstatedir@/jabberd/log/resolver.log</file>
  +-    -->
  +   </log>
  + 
  +   <!-- SRV records will be resolved in the following order. The first
  +Index: etc/router.xml.dist.in
  +--- etc/router.xml.dist.in.orig      2004-04-01 06:56:55 +0200
  ++++ etc/router.xml.dist.in   2004-09-22 21:49:28 +0200
  +@@ -9,24 +9,22 @@
  +   <pidfile>@localstatedir@/jabberd/pid/router.pid</pidfile>
  + 
  +   <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  +-  <log type='syslog'>
  ++  <log type='file'>
  +     <!-- If logging to syslog, this is the log ident -->
  +-    <ident>jabberd/router</ident>
  ++    <!-- <ident>jabberd/router</ident> -->
  + 
  +     <!-- If logging to syslog, this is the log facility
  +          (local0 - local7)                        [default: local3] -->
  +-    <facility>local3</facility>
  ++    <!-- <facility>local3</facility> -->
  + 
  +     <!-- If logging to file, this is the filename of the logfile -->
  +-    <!--
  +     <file>@localstatedir@/jabberd/log/router.log</file>
  +-    -->
  +   </log>
  + 
  +   <!-- Local network configuration -->
  +   <local>
  +     <!-- IP address to bind to (default: 0.0.0.0) -->
  +-    <ip>0.0.0.0</ip>
  ++    <ip>127.0.0.1</ip>
  + 
  +     <!-- Port to bind to (default: 5347) -->
  +     <port>5347</port>
  +Index: etc/s2s.xml.dist.in
  +--- etc/s2s.xml.dist.in.orig 2004-04-21 15:29:27 +0200
  ++++ etc/s2s.xml.dist.in      2004-09-22 21:50:02 +0200
  +@@ -56,25 +56,23 @@
  +   </router>
  + 
  +   <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  +-  <log type='syslog'>
  ++  <log type='file'>
  +     <!-- If logging to syslog, this is the log ident -->
  +-    <ident>jabberd/s2s</ident>
  ++    <!-- <ident>jabberd/s2s</ident> -->
  + 
  +     <!-- If logging to syslog, this is the log facility
  +          (local0 - local7)                        [default: local3] -->
  +-    <facility>local3</facility>
  ++    <!-- <facility>local3</facility> -->
  + 
  +     <!-- if logging to file, this is the filename of the logfile -->
  +-    <!--
  +     <file>@localstatedir@/jabberd/log/s2s.log</file>
  +-    -->
  +   </log>
  + 
  +   <!-- Local network configuration -->
  +   <local>
  +     <!-- IP and port to listen for incoming s2s connections on
  +                                            (default: 0.0.0.0, 5269) -->
  +-    <ip>0.0.0.0</ip>
  ++    <ip>127.0.0.1</ip>
  +     <port>5269</port>
  + 
  +     <!-- Helper DNS resolver component - if this component is not
  +Index: etc/sm.xml.dist.in
  +--- etc/sm.xml.dist.in.orig  2004-04-02 06:32:31 +0200
  ++++ etc/sm.xml.dist.in       2004-09-22 21:50:56 +0200
  +@@ -49,24 +49,22 @@
  +   </router>
  + 
  +   <!-- Log configuration - type is "syslog", "file" or "stdout" -->
  +-  <log type='syslog'>
  ++  <log type='file'>
  +     <!-- If logging to syslog, this is the log ident -->
  +-    <ident>jabberd/sm</ident>
  ++    <!-- <ident>jabberd/sm</ident> -->
  + 
  +     <!-- If logging to syslog, this is the log facility
  +          (local0 - local7)                        [default: local3] -->
  +-    <facility>local3</facility>
  ++    <!-- <facility>local3</facility> -->
  + 
  +     <!-- If logging to file, this is the filename of the logfile -->
  +-    <!--
  +     <file>@localstatedir@/jabberd/log/sm.log</file>
  +-    -->
  +   </log>
  + 
  +   <!-- Storage database configuration -->
  +   <storage>
  +     <!-- By default, we use the MySQL driver for all storage -->
  +-    <driver>mysql</driver>
  ++    <driver>db</driver>
  + 
  +     <!-- Its also possible to explicitly list alternate drivers for
  +          specific data types. -->
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/jabberd/jabberd.spec
  ============================================================================
  $ cvs diff -u -r1.20 -r1.21 jabberd.spec
  --- openpkg-src/jabberd/jabberd.spec  30 Jul 2004 14:03:09 -0000      1.20
  +++ openpkg-src/jabberd/jabberd.spec  3 Oct 2004 16:51:07 -0000       1.21
  @@ -24,24 +24,29 @@
   ##
   
   #   package version
  -%define       V_major 1.4
  -%define       V_minor 3
  +%define       V_major 2.0
  +%define       V_minor s3
   
   #   package information
   Name:         jabberd
  -Summary:      Jabber Daemon
  -URL:          http://jabberd.jabberstudio.org/
  +Summary:      Jabber Instant Messaging Daemon
  +URL:          http://jabberd.jabberstudio.org/2/
   Vendor:       Jabber Software Foundation
   Packager:     The OpenPKG Project
   Distribution: OpenPKG
   Class:        EVAL
   Group:        Network
   License:      JOSL/GPL
  -Version:      %{V_major}.%{V_minor}
  -Release:      20040730
  +Version:      %{V_major}%{V_minor}
  +Release:      20041003
  +
  +#   package options
  +%option       with_mysql  no
  +%option       with_pgsql  no
  +%option       with_pam    no
   
   #   list of sources
  -Source0:      
http://jabberd.jabberstudio.org/%{V_major}/dist/jabberd-%{version}.tar.gz
  +Source0:      http://www.jabberstudio.org/files/jabberd2/jabberd-%{version}.tar.gz
   Source1:      rc.jabberd
   Patch0:       jabberd.patch
   
  @@ -49,75 +54,118 @@
   Prefix:       %{l_prefix}
   BuildRoot:    %{l_buildroot}
   BuildPreReq:  OpenPKG, openpkg >= 20040130, make
  -PreReq:       OpenPKG, openpkg >= 20040130
  -BuildPreReq:  pth, openssl
  -PreReq:       pth, openssl
  +PreReq:       OpenPKG, openpkg >= 20040130, perl
  +BuildPreReq:  pth, openssl, libidn
  +PreReq:       pth, openssl, libidn
  +BuildPreReq:  db
  +PreReq:       db
  +%if "%{with_mysql}" == "yes"
  +BuildPreReq:  mysql
  +PreReq:       mysql
  +%endif
  +%if "%{with_pgsql}" == "yes"
  +BuildPreReq:  postgresql
  +PreReq:       postgresql
  +%endif
  +%if "%{with_pam}" == "yes"
  +BuildPreReq:  PAM
  +PreReq:       PAM
  +%endif
   AutoReq:      no
   AutoReqProv:  no
   
   %description
       JabberD is the original server implementation for the Jabber instant
  -    messaging platform.
  +    messaging platform. JabberD 2 is the next generation of the JabberD
  +    server. It has been rewritten from the ground up to be scalable,
  +    architecturally sound, and to support the latest protocol extensions
  +    coming out of the JSF.
   
   %track
  -    prog jabberd:jabber = {
  +    prog jabberd = {
           version   = %{version}
  -        url       = http://jabberd.jabberstudio.org/1.4/
  +        url       = http://jabberd.jabberstudio.org/2/
           regex     = jabberd-(__VER__)\.tar\.gz
       }
   
   %prep
  -    %setup -q
  +    %setup -q -n jabberd-%{version}
       %patch -p0
       %{l_shtool} subst \
  -        -e 's;^\(JHOME=`pwd`\);#\1;' \
  -        -e 's;\(-I\$ssldir/include\)/openssl;\1;' \
  -        configure
  +        -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
  +        tools/jabberd.in
   
   %build
  -    CC="%{l_cc}" \
  -    CFLAGS="%{l_cflags -O}" \
  -    CPPFLAGS="%{l_cppflags pth}" \
  -    LDFLAGS="%{l_ldflags pth}" \
  -    prefix=%{l_prefix} \
  -    JHOME=%{l_prefix}/var/jabberd \
  +    #   configure program
  +    export CC="%{l_cc}"
  +    export CFLAGS="%{l_cflags -O}"
  +    export CPPFLAGS="%{l_cppflags pth libidn}"
  +    export LDFLAGS="%{l_ldflags pth}"
  +    export JHOME=%{l_prefix}/var/jabberd
  +%if "%{with_mysql}" == "yes"
  +    CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}"
  +    LDFLAGS="$LDFLAGS %{l_ldflags mysql}"
  +%endif
  +%if "%{with_pgsql}" == "yes"
  +    CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}"
  +%endif
       ./configure \
  -        --enable-ssl
  -    %{l_make} %{l_mflags -O}
  +        --prefix=%{l_prefix} \
  +        --enable-ssl \
  +        --enable-idn \
  +        --enable-fs \
  +        --enable-db \
  +%if "%{with_mysql}" == "yes"
  +        --enable-mysql \
  +%else
  +        --disable-mysql \
  +%endif
  +%if "%{with_pgsql}" == "yes"
  +        --enable-pgsql \
  +%else
  +        --disable-pgsql \
  +%endif
  +%if "%{with_pam}" == "yes"
  +        --enable-pam \
  +%else
  +        --disable-pam \
  +%endif
  +        --enable-static \
  +        --disable-shared
  +
  +    #   build program
  +    %{l_make} %{l_mflags}
   
   %install
  +    #   create installation filesystem structure
       rm -rf $RPM_BUILD_ROOT
       %{l_shtool} mkdir -f -p -m 755 \
  -        $RPM_BUILD_ROOT%{l_prefix}/sbin \
           $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
           $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \
  -        $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd \
  -        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd
  -    %{l_shtool} install -c -s -m 755 \
  -        jabberd/jabberd \
  -        $RPM_BUILD_ROOT%{l_prefix}/sbin/
  -    %{l_shtool} install -c -m 644 \
  -        -e 's;\./jsm/jsm\.so;%{l_prefix}/lib/jabberd/jsm.so;g' \
  -        -e 's;\./xdb_file/xdb_file\.so;%{l_prefix}/lib/jabberd/xdb_file.so;g' \
  -        -e 
's;\./pthsock/pthsock_client\.so;%{l_prefix}/lib/jabberd/pthsock_client.so;g' \
  -        -e 's;\./dnsrv/dnsrv\.so;%{l_prefix}/lib/jabberd/dnsrv.so;g' \
  -        -e 's;\./dialback/dialback\.so;%{l_prefix}/lib/jabberd/dialback.so;g' \
  -        -e 's;\./jabber\.pid;%{l_prefix}/var/jabberd/jabberd.pid;g' \
  -        jabber.xml $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/
  -    %{l_shtool} install -c -m 755 \
  -        jsm/jsm.so \
  -        xdb_file/xdb_file.so \
  -        pthsock/pthsock_client.so \
  -        dnsrv/dnsrv.so \
  -        dialback/dialback.so \
  -        $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
  +
  +    #   install components
  +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  +
  +    #   remove unnecessary files
  +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*dist
  +    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*dist
  +
  +    #   install run-command script
       %{l_shtool} install -c -m 755 %{l_value -s -a} \
           %{SOURCE rc.jabberd} \
           $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +
  +    #   determine installation files
       %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
           %{l_files_std} \
           '%config %{l_prefix}/etc/jabberd/*' \
  -        '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd'
  +        '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \
  +        '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'
   
   %files -f files
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/jabberd/rc.jabberd
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 rc.jabberd
  --- openpkg-src/jabberd/rc.jabberd    30 Jul 2004 14:03:09 -0000      1.10
  +++ openpkg-src/jabberd/rc.jabberd    3 Oct 2004 16:51:07 -0000       1.11
  @@ -6,32 +6,30 @@
   %config
       jabberd_enable="$openpkg_rc_def"
       jabberd_hostname=`hostname`
  -    jabberd_error_prolog="true"
  -    jabberd_error_epilog="true"
  -    jabberd_error_numfiles="10"
  -    jabberd_error_minsize="1M"
  -    jabberd_error_complevel="9"
  -    jabberd_error_file="@l_prefix@/var/jabberd/error.log"
  -    jabberd_record_prolog="true"
  -    jabberd_record_epilog="true"
  -    jabberd_record_numfiles="10"
  -    jabberd_record_minsize="1M"
  -    jabberd_record_complevel="9"
  -    jabberd_record_file="@l_prefix@/var/jabberd/record.log"
  +    jabberd_daemons="c2s resolver router s2s sm"
  +    jabberd_cfgfile="@l_prefix@/etc/jabberd/jabberd.cfg"
  +    jabberd_log_prolog="true"
  +    jabberd_log_epilog="true"
  +    jabberd_log_numfiles="10"
  +    jabberd_log_minsize="1M"
  +    jabberd_log_complevel="9"
   
   %common
  -    jabberd_pidfile="@l_prefix@/var/jabberd/jabberd.pid"
  -    jabberd_cfgfile="@l_prefix@/etc/jabberd/jabber.xml"
       jabberd_signal () {
  -        [ -f $jabberd_pidfile ] && kill -$1 `cat $jabberd_pidfile`
  +        local retcode=0
  +        local daemons=
  +        for daemons in $jabberd_daemons; do
  +            [ -f @l_prefix@/var/jabberd/pid/${daemons}.pid ] \
  +            && kill -$1 `cat @l_prefix@/var/jabberd/pid/${daemons}.pid`
  +            retcode=$(($retcode+$?))
  +        done
  +        return $retcode
       }
   
   %status -u @l_nusr@ -o
  -    jabberd_usable="no"
  +    jabberd_usable="unknown"
       jabberd_active="no"
       rcService jabberd enable yes && \
  -        jabberd_chroot && jabberd_usable="yes"
  -    rcService jabberd enable yes && \
           jabberd_signal 0 && jabberd_active="yes"
       echo "jabberd_enable=\"$jabberd_enable\""
       echo "jabberd_usable=\"$jabberd_usable\""
  @@ -40,13 +38,16 @@
   %start -u @l_nusr@
       rcService jabberd enable yes || exit 0
       rcService jabberd active yes && exit 0
  -    @l_prefix@/sbin/jabberd -B -h $jabberd_hostname -c $jabberd_cfgfile
  +    @l_prefix@/bin/jabberd -c $jabberd_cfgfile &
   
   %stop -u @l_nusr@
       rcService jabberd enable yes || exit 0
       rcService jabberd active no && exit 0
       jabberd_signal TERM
  -    rm -f $jabberd_pidfile 2>/dev/null || true
  +    sleep 2
  +    for daemons in $jabberd_daemons; do
  +        rm -f @l_prefix@/var/jabberd/pid/${daemons}.pid
  +    done
   
   %restart -u @l_nusr@
       rcService jabberd enable yes || exit 0
  @@ -57,24 +58,14 @@
   
   %daily -u @l_susr@
       rcService jabberd enable yes || exit 0
  -
  -    #   rotate logfiles
  -    rcTmp -i
  -    hintfile=`rcTmp -f -n hint`
  -    shtool rotate -f \
  -        -n ${jabberd_error_numfiles} -s ${jabberd_error_minsize} -d \
  -        -z ${jabberd_error_complevel} -o @l_nusr@ -g @l_ngrp@ -m 644 \
  -        -P "${jabberd_error_prolog}" \
  -        -E "${jabberd_error_epilog}; echo 1 >$hintfile" \
  -        ${jabberd_error_file}
  +    logfiles=
  +    for daemons in $jabberd_daemons; do
  +        logfiles="$logfiles @l_prefix@/var/jabberd/log/$daemons.log"
  +    done
       shtool rotate -f \
  -        -n ${jabberd_record_numfiles} -s ${jabberd_record_minsize} -d \
  -        -z ${jabberd_record_complevel} -o @l_nusr@ -g @l_ngrp@ -m 644 \
  -        -P "${jabberd_record_prolog}" \
  -        -E "${jabberd_record_epilog}; echo 1 >$hintfile" \
  -        ${jabberd_record_file}
  -    if [ -s $hintfile ]; then
  -        rc jabberd restart
  -    fi
  -    rcTmp -k
  +        -n ${jabberd_log_numfiles} -s ${jabberd_log_minsize} -d \
  +        -z ${jabberd_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
  +        -P "${jabberd_log_prolog}" \
  +        -E "${jabberd_log_epilog}; rc jabberd restart" \
  +        $logfiles
   
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to