Hi.

To whom it may concern...
The rc-Stuff is not fully tested, because i do not want to make experiments
until all results are sent - and especially the sending of results seems to
be difficult, currently. They are really adding up, here. If there where
not a few successful sends, i would expect the worst.


   (mk)

Attached: squeuer.spec
          rc.squeuer

-- 
Matthias Kurz; Fuldastr. 3; D-28199 Bremen; VOICE +49 421 53 600 47
  >> Im prämotorischen Cortex kann jeder ein Held sein. (bdw) <<
##
##  squeuer.spec -- OpenPKG RPM Specification
##  Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
##  Copyright (c) 2000-2005 Ralf S. Engelschall <[EMAIL PROTECTED]>
##  Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##

#   package information
Name:         squeuer
Summary:      Queue handling for SETI work units and results
URL:          http://www.eyesbeyond.com/squeuer/
Vendor:       Phil Kernick
Packager:     The OpenPKG Project
Distribution: OpenPKG
Class:        JUNK
Group:        Network
License:      BSD
Version:      2.0.2
Release:      20050303

#   list of sources
Source0:      http://www.eyesbeyond.com/squeuer/squeuer-2.0.2.tar.gz

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 2.2.0, perl
PreReq:       OpenPKG, openpkg >= 2.2.0
AutoReq:      no
AutoReqProv:  no

%description
    Squeuer is a queueing proxy for the [EMAIL PROTECTED] client. It provides a 
rich
    set of features to assist in using the [EMAIL PROTECTED] client.
    * Keeps a configurable sized queue of work units so that the client will
      always be able to get a new work unit immediately upon finishing one.
    * Queues results for uploading should the main [EMAIL PROTECTED] site be 
overloaded
      or down. Results are never lost and the client is never delayed waiting
      to upload a result.
    * Can handle multiple users running the [EMAIL PROTECTED] client on multiple
      machines all connecting to Squeuer

%track
    prog squeuer = {
        version   = %{version}
        url       = http://www.eyesbeyond.com/squeuer/
        regex     = squeuer-(__VER__)\.tar\.gz
    }

%prep
    %setup -q

%build
    # perl code

%install
    rm -rf $RPM_BUILD_ROOT
    %{l_shtool} mkdir -f -p -m 755 \
        $RPM_BUILD_ROOT%{l_prefix}/sbin \
        $RPM_BUILD_ROOT%{l_prefix}/etc/squeuer \
        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
        $RPM_BUILD_ROOT%{l_prefix}/var/squeuer \
        $RPM_BUILD_ROOT%{l_prefix}/share/squeuer/doc

    %{l_shtool} install -c -m 755 \
                        -e 's,#!/usr/bin/perl -T,#!%{prefix}/bin/perl -T,' \
                        bin/squeuer.pl \
                        $RPM_BUILD_ROOT%{l_prefix}/sbin/squeuer
    %{l_shtool} install -c -m 644 \
                        -e 's,/var/spool/squeuer,%{l_prefix}/var/squeuer,' \
                        etc/squeuer.conf.unix \
                        $RPM_BUILD_ROOT%{l_prefix}/etc/squeuer/squeuer.conf
    cp $RPM_BUILD_ROOT%{l_prefix}/etc/squeuer/squeuer.conf \
       $RPM_BUILD_ROOT%{l_prefix}/etc/squeuer/squeuer.conf.default
    %{l_shtool} install -c -m 755 \
                        -e 's,@l_prefix@,%{l_prefix},g' \
                        -e 's,@l_nusr@,%{l_nusr},g' \
                        -e 's,@l_ngrp@,%{l_ngrp},g' \
                        %{SOURCE rc.squeuer} \
                        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.squeuer
    #%{l_shtool} install -c -m 644 \
    #                    %{SOURCE README.OpenPKG} \
    #                    $RPM_BUILD_ROOT%{l_prefix}/share/squeuer/doc
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
                       %{l_files_std} \
                       '%attr(755,%{l_nusr},%{l_ngrp})%{l_prefix}/var/squeuer'\
                       '%config %{l_prefix}/etc/squeuer/squeuer.conf'

%files -f files

%clean
    rm -rf $RPM_BUILD_ROOT

%post
    #   after upgrade, restart service, provided there is no conf.rpmsave
    [ $1 -eq 2 ] || exit 0
    eval `%{l_rc} squeuer status 2>/dev/null`
    [ ".$squeuer_active" = .yes ] || exit 0
    if   [ -f {%l_prefix}/etc/squeuer/squeuer.rpmsave ]
    then %{l_rc} squeuer stop
    else %{l_rc} squeuer restart
    fi
    exit 0

%preun
    #   before erase, stop service and remove log files
    [ $1 -eq 0 ] || exit 0
    %{l_rc} squeuer stop 2>/dev/null
    rm -f $RPM_INSTALL_PREFIX/var/squeuer/* >/dev/null 2>&1 || true
    exit 0

[EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
##
##  rc.squeuer -- Run-Commands
##

%config
    #squeuer_enable="$openpkg_rc_def"
    suqueuer_enable="no"               # !!!
    squeuer_log_prolog="true"
    squeuer_log_epilog="true"
    squeuer_log_numfiles="10"
    squeuer_log_minsize="256K"
    squeuer_log_complevel="9"

%common
    squeuer_pidfile="@l_prefix@/var/squeuer/squeuer.pid"
    squeuer_logfile="@l_prefix@/var/squeuer/squeuer.log"
    squeuer_conffile="@l_prefix@/etc/squeuer/squeuer.conf"
    squeuer_usable () {
        rcService squeuer enable yes && [   -r $squeuer_conffile ] \
                                     && [ ! -r $squeuer_conffile.rpmsave ]
    }
    squeuer_signal () {
        [ -s $squeuer_pidfile ] && kill -$1 `cat $squeuer_pidfile`
    }

%status -u @l_nusr@ -o
    squeuer_usable="no"
    squeuer_active="no"
    squeuer_usable && squeuer_usable="yes"
    [ "$squeuer_usable" = "yes" ] && squeuer_signal 0 && squeuer_active="yes"
    echo "squeuer_enable=\"$squeuer_enable\""
    echo "squeuer_usable=\"$squeuer_usable\""
    echo "squeuer_active=\"$squeuer_active\""

%start -u @l_nusr@
    rcService squeuer enable yes || exit 0
    rcService squeuer active yes && exit 0
    if   [ -f "$conffile" ]
    then if   [ -f $conffile.rpmsave ]
         then echo "squeuer: no start with existing $conffile.rpmsave"
              exit 1
         fi
    else echo "squeuer: no config file '$conffile'"
         exit 1
    fi
    @l_prefix@/sbin/squeuer -f $squeuer_conffile >$squeuer_pidfile &

%stop -u @l_nusr@
    rcService squeuer enable yes || exit 0
    rcService squeuer active no  && exit 0
    squeuer_signal TERM
    rm -f $squeuer_pidfile 2>/dev/null || true

%restart -u @l_nusr@
    rc squeuer stop
    sleep 3
    rc squeuer start

%weekly -u @l_nusr@
    rcService squeuer enable yes || exit 0
    shtool rotate -f \
        -n ${squeuer_log_numfiles} -s ${squeuer_log_minsize} -d \
        -z ${squeuer_log_complevel} -o @l_nusr@ -g @l_ngrp@ -m 644 \
        -P "${squeuer_log_prolog}" \
        -E "${squeuer_log_epilog}; rc squeuer restart" \
        $squeuer_logfile

Reply via email to