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 openpkg-web          Date:   28-Jul-2003 16:21:16
  Branch: OPENPKG_1_STABLE HEAD            Handle: 2003072815211303

  Added files:              (Branch: OPENPKG_1_STABLE)
    openpkg-src/nntpcache   nntpcache.patch
  Modified files:
    openpkg-web             news.txt
  Modified files:           (Branch: OPENPKG_1_STABLE)
    openpkg-src/ksh         ksh.spec
    openpkg-src/nntpcache   nntpcache.spec rc.nntpcache
    openpkg-src/samhain     samhain.spec

  Log:
    MFC: merge latest changes

  Summary:
    Revision    Changes     Path
    1.15.2.5    +15 -0      openpkg-src/ksh/ksh.spec
    1.1.2.1     +54 -0      openpkg-src/nntpcache/nntpcache.patch
    1.26.2.3    +41 -5      openpkg-src/nntpcache/nntpcache.spec
    1.6.2.2     +42 -2      openpkg-src/nntpcache/rc.nntpcache
    1.33.2.3    +2  -2      openpkg-src/samhain/samhain.spec
    1.5872      +2  -0      openpkg-web/news.txt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/ksh/ksh.spec
  ============================================================================
  $ cvs diff -u -r1.15.2.4 -r1.15.2.5 ksh.spec
  --- openpkg-src/ksh/ksh.spec  28 Jul 2003 11:38:37 -0000      1.15.2.4
  +++ openpkg-src/ksh/ksh.spec  28 Jul 2003 14:21:14 -0000      1.15.2.5
  @@ -68,6 +68,21 @@
       %setup1 -q -T -D -a 1
   
   %build
  +    #   the supplied Mamfiles work only for standard UNIX environment
  +    #   because they are no regenerated by us (no "nmake" available)
  +    case "%{l_target}" in
  +        *solaris2.6*) ;;
  +        *solaris*)
  +            %{l_shtool} subst \
  +                -e '/^exec.*-o ksh/s/\(\${mam_libm}\)/\1 -lsecdb/' \
  +                src/cmd/ksh93/Mamfile
  +            ;;
  +        sparc*-linux*)
  +            %{l_shtool} subst \
  +                -e '/^exec.*-o ksh/s/\(\${mam_libm}\)/\1 -ldll/' \
  +                src/cmd/ksh93/Mamfile
  +            ;;
  +    esac
       ./bin/package "read" || true
       ./bin/package "make" CC="%{l_cc}"
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/nntpcache/nntpcache.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1.2.1 nntpcache.patch
  --- /dev/null 2003-07-28 16:21:15.000000000 +0200
  +++ nntpcache.patch   2003-07-28 16:21:15.000000000 +0200
  @@ -0,0 +1,54 @@
  +--- src/nntpcache.c.orig     2002-04-05 20:29:58.000000000 +0200
  ++++ src/nntpcache.c  2003-07-28 14:02:21.000000000 +0200
  +@@ -1247,7 +1247,12 @@
  +             Task = task_info_new (nc_master, "master");
  +             watchInit();
  +             drop_priv(ncUID, ncGID);
  +-            sprintf (PidFile, "%.127s.%.164s", con->pidFile, con->bindAddr);
  ++
  ++        if (strchr(con->pidFile, (int)'/') != NULL)
  ++            sprintf (PidFile, "%.127s", con->pidFile);
  ++        else
  ++            sprintf (PidFile, "%.127s.%.164s", con->pidFile, con->bindAddr);
  ++
  +             if (!(fh = fopen (PidFile, "w")))
  +                     logw (("couldn't open pid file '%s'", PidFile));
  +             else
  +@@ -1436,6 +1441,7 @@
  +     char *config_file = con->configFile;
  +     char *access_file = con->accessFile;
  +     char *bindAddr = NULL;
  ++    char *pidFile = NULL;
  +     struct hostent *hp;
  +     enum task_state task;
  +     char *p = NULL;
  +@@ -1456,7 +1462,7 @@
  +      assert(task_desc[nc_last] == NULL);
  +      task = nc_master;
  + 
  +-     while ((c = getopt (argc, argv, "ef:hnb:rc:s")) != -1)
  ++     while ((c = getopt (argc, argv, "ef:hnb:p:rc:s")) != -1)
  +             switch (c)
  +             {
  +             case 'a':
  +@@ -1496,6 +1502,9 @@
  +             case 'b':
  +                     bindAddr = Sstrdup(optarg);
  +                     break;
  ++            case 'p':
  ++                    pidFile = Sstrdup(optarg);
  ++                    break;
  +             case 's':
  +                     SwapWithChild = TRUE;
  +                     break;
  +@@ -1563,6 +1572,10 @@
  +             if (con->bindAddr) free(con->bindAddr);
  +             con->bindAddr = Sstrdup(bindAddr);
  +     }
  ++    if (pidFile) {
  ++            if (con->pidFile) free(con->pidFile);
  ++            con->pidFile = Sstrdup(pidFile);
  ++    }
  +     if (chdir (con->configDir) == -1)
  +     {
  +             loge (("couldn't set cwd to %s", con->configDir));
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/nntpcache/nntpcache.spec
  ============================================================================
  $ cvs diff -u -r1.26.2.2 -r1.26.2.3 nntpcache.spec
  --- openpkg-src/nntpcache/nntpcache.spec      24 Jul 2003 20:44:38 -0000      
1.26.2.2
  +++ openpkg-src/nntpcache/nntpcache.spec      28 Jul 2003 14:21:15 -0000      
1.26.2.3
  @@ -33,7 +33,7 @@
   Group:        News
   License:      BSD
   Version:      3.0.1
  -Release:      1.20030724
  +Release:      1.20030728
   
   #   package options
   %option       with_fsl  yes
  @@ -42,6 +42,7 @@
   Source0:      ftp://ftp.nntpcache.org/pub/nntpcache/nntpcache-%{version}.tar.gz
   Source1:      rc.nntpcache
   Source2:      fsl.nntpcache
  +Patch0:       nntpcache.patch
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -68,24 +69,42 @@
   
   %prep
       %setup -q
  +    %patch -p0
   
   %build
       #   configure package
  +%if "%{with_fsl}" == "yes"
  +    %{l_shtool} subst \
  +        -e 's;\(openlog.*\)LOG_NEWS\(.*\);\1LOG_USER\2;' \
  +        src/nntpcache.c
  +%endif
       %{l_shtool} subst \
           -e 's;test -e;test -f;g' \
           Makefile* */Makefile*
       %{l_shtool} subst \
           -e 's;/etc/nntpcache/\(newshound\.conf\);%{l_prefix}/etc/nntpcache/\1;' \
           contrib/newshound/getconf.c
  +    %{l_shtool} subst -s \
  +        -e 's;^\(pidFile .*\);#\1 ;' \
  +        -e 's;^\(adminEmail \).*;\1 [EMAIL PROTECTED];' \
  +        -e 's;^/usr/local/\(etc|var.*\);%{l_prefix}/\1;' \
  +        cf/nntpcache.config-dist
  +    %{l_shtool} subst -s \
  +        -e 's;$libexecDir/nntpcache-gdb\.sh;true;' \
  +        configure
  +    ( echo "nc_cv_UID=%{l_musr}"
  +      echo "nc_cv_GID=%{l_rgrp}"
  +    ) >config.cache
       CC="%{l_cc}" \
       CFLAGS="%{l_cflags -O}" \
       LDFLAGS="%{l_fsl_ldflags}" \
       LIBS="%{l_fsl_libs}" \
       ./configure \
  +        --cache-file=./config.cache \
           --prefix=%{l_prefix} \
  -        --sysconfdir=%{l_prefix}/etc/nntpcache \
  -        --libexecdir=%{l_prefix}/libexec/nntpcache \
  -        --localstatedir=%{l_prefix}/var/nntpcache
  +        --sysconfdir=%{l_prefix}/etc \
  +        --libexecdir=%{l_prefix}/libexec \
  +        --localstatedir=%{l_prefix}/var
   
       #   build package
       %{l_make} %{l_mflags}
  @@ -103,7 +122,7 @@
           prefix=$RPM_BUILD_ROOT%{l_prefix} \
           exec_prefix=$RPM_BUILD_ROOT%{l_prefix} \
           sysconfdir=$RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache \
  -        libexecdir=$RPM_BUILD_ROOT%{l_prefix}/libexecdir/nntpcache \
  +        libexecdir=$RPM_BUILD_ROOT%{l_prefix}/libexec/nntpcache \
           configDir=$RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache \
           localstatedir=$RPM_BUILD_ROOT%{l_prefix}/var/nntpcache \
           cacheDir=$RPM_BUILD_ROOT%{l_prefix}/var/nntpcache
  @@ -116,6 +135,9 @@
       rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/newshound.pl
       rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache/pubring*
       rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/nntpcache/innreport*
  +    rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/nntpcache/nntpcache-gdb.sh
  +    rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/nntpcache/nntpcache.gdb
  +    rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/nntpcache/nntpcached.debug
       strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
       find $RPM_BUILD_ROOT%{l_prefix} -type d -print | xargs chmod 755
       find $RPM_BUILD_ROOT%{l_prefix} -type f -print | grep -v /sbin | xargs chmod 644
  @@ -142,6 +164,7 @@
       #   determine installation files
       %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
           %{l_files_std} \
  +        '%config %{l_prefix}/etc/nntpcache/*' \
           '%not %dir %{l_prefix}/etc/fsl' \
           '%config %{l_prefix}/etc/fsl/fsl.nntpcache'
   
  @@ -149,4 +172,17 @@
   
   %clean
       rm -rf $RPM_BUILD_ROOT
  +
  +%post
  +    #   after upgrade, restart service
  +    [ $1 -eq 2 ] || exit 0
  +    eval `%{l_rc} nntpcache status 2>/dev/null`
  +    [ ".$nntpcache_active" = .yes ] && %{l_rc} nntpcache restart
  +    exit 0
  +
  +%preun
  +    #   before erase, stop service
  +    [ $1 -eq 0 ] || exit 0
  +    %{l_rc} nntpcache stop 2>/dev/null
  +    exit 0
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/nntpcache/rc.nntpcache
  ============================================================================
  $ cvs diff -u -r1.6.2.1 -r1.6.2.2 rc.nntpcache
  --- openpkg-src/nntpcache/rc.nntpcache        24 Jul 2003 20:44:38 -0000      1.6.2.1
  +++ openpkg-src/nntpcache/rc.nntpcache        28 Jul 2003 14:21:15 -0000      1.6.2.2
  @@ -5,20 +5,60 @@
   
   %config
       nntpcache_enable="$openpkg_rc_def"
  +    nntpcache_bind="127.0.0.1"
  +    nntpcache_port="119"
       nntpcache_log_prolog="true"
       nntpcache_log_epilog="true"
       nntpcache_log_numfiles="10"
       nntpcache_log_minsize="1M"
       nntpcache_log_complevel="9"
   
  +%common
  +    nntpcache_pidfile="@l_prefix@/var/nntpcache/nntpcache.pid"
  +    nntpcache_signal () {
  +        [ -f $nntpcache_pidfile ] && kill -$1 `cat $nntpcache_pidfile`
  +    }
  +    nntpcache_start () {
  +        @l_prefix@/sbin/nntpcached \
  +            -b ${nntpcache_bind:-DEFAULT}:${nntpcache_port:-nntp} \
  +            -p $nntpcache_pidfile
  +    }
  +    nntpcache_stop () {
  +        nntpcache_signal TERM
  +    }
  +
  +%status -u root -o
  +    nntpcache_usable="unknown"
  +    nntpcache_active="no"
  +    rcService nntpcache enable yes && \
  +        nntpcache_signal 0 && nntpcache_active="yes"
  +    echo "nntpcache_enable=\"$nntpcache_enable\""
  +    echo "nntpcache_usable=\"$nntpcache_usable\""
  +    echo "nntpcache_active=\"$nntpcache_active\""
  +
  +%start -u @l_susr@
  +    rcService nntpcache enable yes || exit 0
  +    rcService nntpcache active yes && exit 0
  +    nntpcache_start
  +
  +%stop -u @l_susr@
  +    rcService nntpcache enable yes || exit 0
  +    rcService nntpcache active no  && exit 0
  +    nntpcache_stop
  +
  +%restart -u @l_susr@
  +    rcService nntpcache enable yes || exit 0
  +    rcService nntpcache active no  && exit 0
  +    rc nntpcache stop start
  +
   %daily -u @l_susr@
       rcService nntpcache enable yes || exit 0
   
       #   rotate logfile
       shtool rotate -f \
           -n ${nntpcache_log_numfiles} -s ${nntpcache_log_minsize} -d \
  -        -z ${nntpcache_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
  +        -z ${nntpcache_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
           -P "${nntpcache_log_prolog}" \
  -        -E "${nntpcache_log_epilog}" \
  +        -E "${nntpcache_log_epilog} && rc nntpcache restart" \
           @l_prefix@/var/nntpcache/nntpcache.log
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/samhain/samhain.spec
  ============================================================================
  $ cvs diff -u -r1.33.2.2 -r1.33.2.3 samhain.spec
  --- openpkg-src/samhain/samhain.spec  24 Jul 2003 20:50:32 -0000      1.33.2.2
  +++ openpkg-src/samhain/samhain.spec  28 Jul 2003 14:21:16 -0000      1.33.2.3
  @@ -32,8 +32,8 @@
   Distribution: OpenPKG [PLUS]
   Group:        System
   License:      GPL
  -Version:      1.7.9
  -Release:      1.20030724
  +Version:      1.7.10
  +Release:      1.20030728
   
   #   package options
   %option       with_fsl  yes
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/news.txt
  ============================================================================
  $ cvs diff -u -r1.5871 -r1.5872 news.txt
  --- openpkg-web/news.txt      28 Jul 2003 14:17:47 -0000      1.5871
  +++ openpkg-web/news.txt      28 Jul 2003 14:21:13 -0000      1.5872
  @@ -1,3 +1,5 @@
  +28-Jul-2003: Upgraded package: P<samhain-1.7.10-1.20030728>
  +28-Jul-2003: Upgraded package: P<nntpcache-3.0.1-1.20030728>
   28-Jul-2003: Upgraded package: P<x11-1.20030728-1.20030728>
   28-Jul-2003: Upgraded package: P<x11-20030728-20030728>
   28-Jul-2003: Upgraded package: P<nntpcache-3.0.1-20030728>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to