From fb7b535bdeefac9ed7b7dca91efcafc2f4d89ae3 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Sat, 23 Apr 2011 17:42:59 -0600 Subject: [PATCH 1/1] initial commit --- debian/README.Debian | 31 +++++++++ debian/changelog | 5 ++ debian/compat | 1 + debian/control | 29 ++++++++ debian/copyright | 23 +++++++ debian/gbp.conf | 46 +++++++++++++ debian/git-daemon.install | 1 + debian/git-daemon.postinst | 9 +++ debian/git-daemon/default | 14 ++++ debian/git-daemon/sysv | 132 +++++++++++++++++++++++++++++++++++++ debian/rules | 13 ++++ debian/source/format | 1 + 12 files changed, 305 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/gbp.conf create mode 100644 debian/git-daemon.install create mode 100644 debian/git-daemon.postinst create mode 100644 debian/git-daemon/default create mode 100644 debian/git-daemon/sysv create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..03f0646 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,31 @@ +git-daemon-sysv for Debian +-------------------------- + +This package enables a git-daemon service. This allows people to use a +git:// URL to access your repositories. + +After installing this package, the daemon needs to be enabled in +/etc/default/git-daemon by setting: + + GIT_DAEMON_ENABLE=false + +to: + + GIT_DAEMON_ENABLE=true + +After that, the git daemon can be started with: + + # /etc/init.d/git-daemon start + +The git daemon by default looks into the directory /var/cache/git/ for +repositories (this is configured in /etc/default/git-daemon). It expects +the repositories' .git subdirectories in that directory, symlinks +pointing to the corresponding subdirectories in the repositories are just +fine, e.g.: + + ln -s ~daniel/git/foo/.git /var/cache/git/foo.git + +This makes 'git-clone git://git.example.org/git/foo' to clone the foo +repository on remote machines work. + + -- Daniel Baumann Tue, 19 Oct 2010 00:54:58 +0200 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a446ab0 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +git-daemon (0.1) unstable; urgency=low + + * Initial Release. + + -- Bdale Garbee Sat, 23 Apr 2011 17:10:00 -0600 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8006233 --- /dev/null +++ b/debian/control @@ -0,0 +1,29 @@ +Source: git-daemon +Section: unknown +Priority: extra +Maintainer: Bdale Garbee +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.9.1 +Homepage: +#Vcs-Git: git://git.debian.org/collab-maint/git-daemon.git +#Vcs-Browser: http://git.debian.org/?p=collab-maint/git-daemon.git;a=summary + +Package: git-daemon +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, git, adduser +Conflicts: git-daemon-run +Description: fast, scalable, distributed revision control system (git-daemon service) + Git is popular version control system designed to handle very large + projects with speed and efficiency; it is used for many high profile + open source projects, most notably the Linux kernel. + . + Git falls in the category of distributed source code management tools. + Every Git working directory is a full-fledged repository with full + revision tracking capabilities, not dependent on network access or a + central server. + . + The git-daemon binary provided by the git package is a simple server for git + repositories, ideally suited for read-only updates, i.e. pulling from git + repositories through the network. This package provides a sysvinit service + for running git-daemon permanently. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..cedd756 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,23 @@ +Format: http://dep.debian.net/deps/dep5 + +Files: * +Copyright: 2011 Bdale Garbee +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..7dde981 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,46 @@ +# Configuration file for git-buildpackage and friends + +[DEFAULT] +# the default build command: +#builder = debuild -i\.git/ -I.git +# the default clean command: +#cleaner = debuild clean +# the default branch for upstream sources: +upstream-branch = upstream +# the default branch for the debian patch: +debian-branch = master +# the default tag formats used: +#upstream-tag = upstream/%(version)s +#debian-tag = debian/%(version)s +# use pristine-tar: +pristine-tar = True + +# Options only affecting git-buildpackage +[git-buildpackage] +#upstream-branch = dfsgclean +# uncomment this to automatically GPG sign tags +#sign-tags = True +# keyid to GPG sign tags with +#keyid = 0xdeadbeef +# push to a remote repository after a successful tag: +posttag = git push --mirror +# use this for more svn-buildpackage like behaviour: +export-dir = ../build-area/git-daemon/ +#tarball-dir = ../tarballs/ + +# Options only affecting git-import-orig +[git-import-orig] +#upstream-branch = newupstream +#debian-branch = dfsgclean +#filter = .svn + +# Options only affecting git-import-dsc +[git-import-dsc] +#upstream-branch = svn-upstream +#filter = [ 'CVS', '.cvsignore' ] + +# Options only affecting git-dch +[git-dch] +#git-log = --no-merges +#snapshot-number = snapshot + 1 + diff --git a/debian/git-daemon.install b/debian/git-daemon.install new file mode 100644 index 0000000..307cadc --- /dev/null +++ b/debian/git-daemon.install @@ -0,0 +1 @@ +debian/git-daemon/sysv etc/init.d/git-daemon diff --git a/debian/git-daemon.postinst b/debian/git-daemon.postinst new file mode 100644 index 0000000..29aa52a --- /dev/null +++ b/debian/git-daemon.postinst @@ -0,0 +1,9 @@ +#!/bin/sh +set -e + +test "$1" = 'configure' || exit 0 + +getent passwd gitdaemon >/dev/null || \ + adduser --system --home /nonexistent --no-create-home gitdaemon + +#DEBHELPER# diff --git a/debian/git-daemon/default b/debian/git-daemon/default new file mode 100644 index 0000000..2020805 --- /dev/null +++ b/debian/git-daemon/default @@ -0,0 +1,14 @@ +# Defaults for git-daemon initscript +# sourced by /etc/init.d/git-daemon +# installed at /etc/default/git-daemon by the maintainer scripts + +# +# This is a POSIX shell fragment +# + +GIT_DAEMON_ENABLE=false +GIT_DAEMON_USER=gitdaemon +GIT_DAEMON_DIRECTORY=/var/cache/git + +# Additional options that are passed to the Daemon. +GIT_DAEMON_OPTIONS="" diff --git a/debian/git-daemon/sysv b/debian/git-daemon/sysv new file mode 100644 index 0000000..031faaf --- /dev/null +++ b/debian/git-daemon/sysv @@ -0,0 +1,132 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: git-daemon +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: git-daemon service +# Description: git-daemon is a simple server for git repositories, +# ideally suited for read-only updates, i.e. pulling from +# git repositories through the network. +### END INIT INFO + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/git-core +DESC="git-daemon service" +NAME=git-daemon +DAEMON=/usr/lib/git-core/$NAME +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x $DAEMON ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +GIT_DAEMON_USER=${GIT_DAEMON_USER:-gitdaemon} +GIT_DAEMON_DIRECTORY=${GIT_DAEMON_DIRECTORY:-/var/cache/git} + +DAEMON_ARGS="--user=$GIT_DAEMON_USER --reuseaddr --syslog --verbose $GIT_DAEMON_OPTIONS --base-path=$GIT_DAEMON_DIRECTORY $GIT_DAEMON_DIRECTORY" + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background --make-pidfile -- \ + $DAEMON_ARGS \ + || return 2 +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + if [ $GIT_DAEMON_ENABLE = true ]; then + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" + else + [ "$VERBOSE" != no ] && log_warning_msg "$NAME not enabled in /etc/default/$NAME, not starting..." + exit 0 + fi + + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b760bee --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) -- 2.47.2