# HG changeset patch # User Christopher Rogers # Date 1329572259 18000 # Node ID d4bb4d4d8235b54c290c1285597cbe353501622e # Parent d46c7202fe2f5c2b41bac159476eb69f5b85fc81 Up: git to 1.7.9.1. Add git-daemon so the user can run a web daemon of git repos. diff -r d46c7202fe2f -r d4bb4d4d8235 git/receipt --- a/git/receipt Sat Feb 18 08:15:31 2012 -0500 +++ b/git/receipt Sat Feb 18 08:37:39 2012 -0500 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="git" -VERSION="1.7.9" +VERSION="1.7.9.1" CATEGORY="development" SHORT_DESC="Fast version control system" MAINTAINER="b1+slitaz@nagel.org" @@ -20,7 +20,7 @@ [ -L /bin/tar ] && tazpkg get-install tar --forced ./configure \ --prefix=/usr \ - --libexecdir=/usr/lib/git \ + --libexecdir=/usr/lib \ --without-tcltk \ --build=$HOST_SYSTEM \ --host=$HOST_SYSTEM && @@ -31,7 +31,21 @@ # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - mkdir -p $fs + mkdir -p $fs/etc/init.d + cp -a $stuff/git-daemon $fs/etc/init.d cp -a $install/usr $fs/ - strip -s $fs/usr/lib/git/git-core/* 2>/dev/null || true + strip -s $fs/usr/lib/git-core/* 2>/dev/null || true } + +# edit daemons.conf. +post_install() +{ + local root + root=$1 + if ! grep -q 'GIT_OPTIONS' $root/etc/daemons.conf; then + echo '# Git daemon options.' >> $root/etc/daemons.conf + echo 'GIT_REPO="/var/www/git/"' >> $root/etc/daemons.conf + echo 'GIT_OPTIONS="--detach --syslog --verbose --base-path=$GIT_REPO $GIT_REPO"' >> $root/etc/daemons.conf + echo '' >> $root/etc/daemons.conf + fi +} \ No newline at end of file diff -r d46c7202fe2f -r d4bb4d4d8235 git/stuff/git-daemon --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/git/stuff/git-daemon Sat Feb 18 08:37:39 2012 -0500 @@ -0,0 +1,55 @@ +#!/bin/sh +# /etc/init.d/git-daemon: Start, stop and restart git-daemon daemon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=git-daemon +DESC="git-daemon daemon" +DAEMON=/usr/lib/git-core/git-daemon +OPTIONS=$GIT_OPTIONS +PIDFILE=/var/run/git-daemon.pid + +case "$1" in + start) + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON --pid-file=$PIDFILE $OPTIONS + status + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0