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

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   03-Dec-2008 22:14:04
  Branch: HEAD                             Handle: 2008120321140400

  Added files:
    openpkg-src/git         rc.git
  Modified files:
    openpkg-src/git         git.spec

  Log:
    provide Git run-command script

  Summary:
    Revision    Changes     Path
    1.124       +15 -2      openpkg-src/git/git.spec
    1.1         +78 -0      openpkg-src/git/rc.git
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/git/git.spec
  ============================================================================
  $ cvs diff -u -r1.123 -r1.124 git.spec
  --- openpkg-src/git/git.spec  10 Nov 2008 21:22:59 -0000      1.123
  +++ openpkg-src/git/git.spec  3 Dec 2008 21:14:04 -0000       1.124
  @@ -40,7 +40,7 @@
   Group:        SCM
   License:      GPL
   Version:      %{V_git}
  -Release:      20081110
  +Release:      20081203
   
   #   package options
   %option       with_cogito  no
  @@ -57,6 +57,7 @@
   Source3:      
http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/guilt-%{V_guilt}.tar.gz
   Source4:      http://jonas.nitro.dk/tig/releases/tig-%{V_tig}.tar.gz
   Source5:      
http://switch.dl.sourceforge.net/gcutils/gcutils-v%{V_gcutils}.tar.gz
  +Source6:      rc.git
   Patch0:       git.patch
   
   #   build information
  @@ -283,15 +284,27 @@
       ) || exit $?
   %endif
   
  +    #   install run-command script
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE rc.git} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  +
       #   strip down installation
       strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
       rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
   
  +    #   create additional directories
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/git/run \
  +        $RPM_BUILD_ROOT%{l_prefix}/var/git/db
  +
       #   determine installation files
       %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
       %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
           %{l_files_std} `cat perl-openpkg-files` \
  -        '%config %{l_prefix}/etc/git/*'
  +        '%config %{l_prefix}/etc/git/*' \
  +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/git/*'
   
   %files -f files
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/git/rc.git
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rc.git
  --- /dev/null 2008-12-03 22:13:32 +0100
  +++ rc.git    2008-12-03 22:14:04 +0100
  @@ -0,0 +1,78 @@
  [EMAIL PROTECTED]@/bin/openpkg rc
  +##
  +##  rc.git -- Run-Commands
  +##
  +
  +%config
  +    git_enable="$openpkg_rc_def"
  +    git_daemon="no"
  +    git_daemon_flags=""
  +    git_daemon_host="127.0.0.1"
  +    git_daemon_port="9418"
  +    git_daemon_user="@l_rusr@"
  +    git_daemon_group="@l_rgrp@"
  +    git_daemon_basedir="@l_prefix@/var/git/db"
  +    git_log_prolog="true"
  +    git_log_epilog="true"
  +    git_log_numfiles="10"
  +    git_log_minsize="1M"
  +    git_log_complevel="9"
  +
  +%common
  +    git_daemon_pidfile="@l_prefix@/var/git/run/git-daemon.pid"
  +    git_daemon_logfile="@l_prefix@/var/git/run/git-daemon.log"
  +    git_daemon_signal () {
  +        [ -f $git_daemon_pidfile ] && kill -$1 `cat $git_daemon_pidfile`
  +    }
  +
  +%status -u @l_susr@ -o
  +    git_usable="unknown"
  +    git_active="no"
  +    rcService git enable yes && \
  +        rcVarIsYes git_daemon && \
  +        git_daemon_signal 0 && \
  +        git_active="yes"
  +    echo "git_enable=\"$git_enable\""
  +    echo "git_usable=\"$git_usable\""
  +    echo "git_active=\"$git_active\""
  +
  +%start -u @l_susr@
  +    rcService git enable yes || exit 0
  +    rcService git active yes && exit 0
  +    if rcVarIsYes git_daemon; then
  +        (   nohup @l_prefix@/bin/git daemon \
  +                --reuseaddr \
  +                --listen="$git_daemon_host" \
  +                --port="$git_daemon_port" \
  +                --user="$git_daemon_user" \
  +                --group="$git_daemon_group" \
  +                --base-path="$git_daemon_basedir" \
  +                $git_daemon_flags \
  +                </dev/null >>$git_daemon_logfile 2>&1 &
  +            echo $! >$git_daemon_pidfile
  +        ) </dev/null >/dev/null 2>&1
  +    fi
  +
  +%stop -u @l_susr@
  +    rcService git enable yes || exit 0
  +    rcService git active no  && exit 0
  +    if rcVarIsYes git_daemon; then
  +        git_daemon_signal TERM
  +        sleep 1
  +        rm -f $git_daemon_pidfile 2>/dev/null || true
  +    fi
  +
  +%restart -u @l_susr@
  +    rcService git enable yes || exit 0
  +    rcService git active no  && exit 0
  +    rc git stop start
  +
  +%daily -u @l_susr@
  +    rcService git enable yes || exit 0
  +    shtool rotate -f \
  +        -n ${git_log_numfiles} -s ${git_log_minsize} -d \
  +        -z ${git_log_complevel} -m 644 -o @l_rusr@ -g @l_rusr@ \
  +        -P "${git_log_prolog}" \
  +        -E "${git_log_epilog}" \
  +        $git_daemon_logfile
  +
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to