wok-current rev 11682

Up: git to 1.7.9.1. Add git-daemon so the user can run a web daemon of git repos.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Feb 18 08:37:39 2012 -0500 (2012-02-18)
parents d46c7202fe2f
children 09d7c7137fc9
files git/receipt git/stuff/git-daemon
line diff
     1.1 --- a/git/receipt	Sat Feb 18 08:15:31 2012 -0500
     1.2 +++ b/git/receipt	Sat Feb 18 08:37:39 2012 -0500
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="git"
     1.7 -VERSION="1.7.9"
     1.8 +VERSION="1.7.9.1"
     1.9  CATEGORY="development"
    1.10  SHORT_DESC="Fast version control system"
    1.11  MAINTAINER="b1+slitaz@nagel.org"
    1.12 @@ -20,7 +20,7 @@
    1.13  	[ -L /bin/tar ] && tazpkg get-install tar --forced
    1.14  	./configure \
    1.15  		--prefix=/usr \
    1.16 -		--libexecdir=/usr/lib/git \
    1.17 +		--libexecdir=/usr/lib \
    1.18  		--without-tcltk \
    1.19  		--build=$HOST_SYSTEM \
    1.20  		--host=$HOST_SYSTEM &&
    1.21 @@ -31,7 +31,21 @@
    1.22  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.23  genpkg_rules()
    1.24  {
    1.25 -	mkdir -p $fs
    1.26 +	mkdir -p $fs/etc/init.d
    1.27 +	cp -a $stuff/git-daemon $fs/etc/init.d
    1.28  	cp -a $install/usr $fs/
    1.29 -	strip -s $fs/usr/lib/git/git-core/* 2>/dev/null || true
    1.30 +	strip -s $fs/usr/lib/git-core/* 2>/dev/null || true
    1.31  }
    1.32 +
    1.33 +# edit daemons.conf.
    1.34 +post_install()
    1.35 +{
    1.36 +	local root
    1.37 +	root=$1
    1.38 +	if ! grep -q 'GIT_OPTIONS' $root/etc/daemons.conf; then
    1.39 +		echo '# Git daemon options.' >> $root/etc/daemons.conf
    1.40 +		echo 'GIT_REPO="/var/www/git/"' >> $root/etc/daemons.conf
    1.41 +		echo 'GIT_OPTIONS="--detach --syslog --verbose --base-path=$GIT_REPO $GIT_REPO"' >> $root/etc/daemons.conf
    1.42 +		echo '' >> $root/etc/daemons.conf
    1.43 +	fi
    1.44 +}
    1.45 \ No newline at end of file
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/git/stuff/git-daemon	Sat Feb 18 08:37:39 2012 -0500
     2.3 @@ -0,0 +1,55 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/git-daemon: Start, stop and restart git-daemon daemon on SliTaz, at boot
     2.6 +# time or with the command line.
     2.7 +#
     2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    2.10 +#
    2.11 +. /etc/init.d/rc.functions
    2.12 +. /etc/daemons.conf
    2.13 +
    2.14 +NAME=git-daemon
    2.15 +DESC="git-daemon daemon"
    2.16 +DAEMON=/usr/lib/git-core/git-daemon
    2.17 +OPTIONS=$GIT_OPTIONS
    2.18 +PIDFILE=/var/run/git-daemon.pid
    2.19 +
    2.20 +case "$1" in
    2.21 +  start)
    2.22 +    if [ -f $PIDFILE ] ; then
    2.23 +      echo "$NAME already running."
    2.24 +      exit 1
    2.25 +    fi
    2.26 +    echo -n "Starting $DESC: $NAME... "
    2.27 +    $DAEMON --pid-file=$PIDFILE $OPTIONS
    2.28 +    status
    2.29 +    ;;
    2.30 +  stop)
    2.31 +    if [ ! -f $PIDFILE ] ; then
    2.32 +      echo "$NAME is not running."
    2.33 +      exit 1
    2.34 +    fi
    2.35 +    echo -n "Stopping $DESC: $NAME... "
    2.36 +    kill `cat $PIDFILE`
    2.37 +    status
    2.38 +    ;;
    2.39 +  restart)
    2.40 +    if [ ! -f $PIDFILE ] ; then
    2.41 +      echo "$NAME is not running."
    2.42 +      exit 1
    2.43 +    fi
    2.44 +    echo -n "Restarting $DESC: $NAME... "
    2.45 +    kill `cat $PIDFILE`
    2.46 +    sleep 2
    2.47 +    $DAEMON $OPTIONS
    2.48 +    status
    2.49 +    ;;
    2.50 +  *)
    2.51 +    echo ""
    2.52 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.53 +    echo ""
    2.54 +    exit 1
    2.55 +    ;;
    2.56 +esac
    2.57 +
    2.58 +exit 0