[Lunar-commits] <moonbase> git repo hosting package.

Auke Kok sofar at foo-projects.org
Sat Feb 23 00:47:02 CET 2008


commit 747be20876147b2c70c7d53728d79efd46f48140
Author: Brian Tarricone <kelnos at xfce.org>
Date:   Sat Feb 23 00:47:02 2008 +0100

    git repo hosting package.
---
 zbeta/gitosis-git/BUILD           |    5 +++++
 zbeta/gitosis-git/DEPENDS         |    1 +
 zbeta/gitosis-git/DETAILS         |   17 +++++++++++++++++
 zbeta/gitosis-git/POST_INSTALL    |    4 ++++
 zbeta/gitosis-git/PRE_REMOVE      |    3 +++
 zbeta/gitosis-git/gitosis-anongit |   32 ++++++++++++++++++++++++++++++++
 6 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/zbeta/gitosis-git/BUILD b/zbeta/gitosis-git/BUILD
new file mode 100644
index 0000000..5ea6c21
--- /dev/null
+++ b/zbeta/gitosis-git/BUILD
@@ -0,0 +1,5 @@
+(
+    prepare_install &&
+    python setup.py install &&
+    cp  $SCRIPT_DIRECTORY/gitosis-anongit /etc/init.d
+) > $C_FIFO 2>&1
diff --git a/zbeta/gitosis-git/DEPENDS b/zbeta/gitosis-git/DEPENDS
new file mode 100644
index 0000000..54f5789
--- /dev/null
+++ b/zbeta/gitosis-git/DEPENDS
@@ -0,0 +1 @@
+depends setuptools
diff --git a/zbeta/gitosis-git/DETAILS b/zbeta/gitosis-git/DETAILS
new file mode 100644
index 0000000..19ebe75
--- /dev/null
+++ b/zbeta/gitosis-git/DETAILS
@@ -0,0 +1,17 @@
+          MODULE=gitosis-git
+             MOD=gitosis
+         VERSION="git-`date +%U`"
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/$MOD
+          SOURCE=$MOD.tar.bz2
+      SOURCE_URL=git://eagain.net/$MOD.git
+        WEB_SITE=http://eagain.net/gitweb/?p=$MOD.git;a=summary
+         ENTERED=20080222
+         UPDATED=20080222
+           SHORT="Easy git hosting package that doesn't require shell accounts"
+
+cat << EOF
+Gitosis is an easy-to-use solution for hosting public git repositories.  Users
+with commit access don't need shell accounts on the server, and communication
+is done over ssh.  Gitweb and git-daemon (for read-only anon access) support
+is also included.
+EOF
diff --git a/zbeta/gitosis-git/POST_INSTALL b/zbeta/gitosis-git/POST_INSTALL
new file mode 100644
index 0000000..2be6dc0
--- /dev/null
+++ b/zbeta/gitosis-git/POST_INSTALL
@@ -0,0 +1,4 @@
+# user needs a shell otherwise ssh won't work.  we won't enable a password,
+# and ssh logins will only be allowed via ssh pubkey with a restricted
+# COMMAND= line in autorized_keys
+add_priv_user git:git -d /var/spool/gitosis -s /bin/sh -m
diff --git a/zbeta/gitosis-git/PRE_REMOVE b/zbeta/gitosis-git/PRE_REMOVE
new file mode 100644
index 0000000..611aab9
--- /dev/null
+++ b/zbeta/gitosis-git/PRE_REMOVE
@@ -0,0 +1,3 @@
+if [ -x /etc/init.d/gitosis-anongit ]; then
+    /etc/init.d/gitosis-anongit stop
+fi
diff --git a/zbeta/gitosis-git/gitosis-anongit b/zbeta/gitosis-git/gitosis-anongit
new file mode 100644
index 0000000..0572019
--- /dev/null
+++ b/zbeta/gitosis-git/gitosis-anongit
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# chkconfig: 345 85 15
+# description: git-daemon anon access for a gitosis-served git repositoriy
+#
+
+start() {
+    echo -n "Starting git-daemon (for gitosis): "
+    /usr/bin/git-daemon --syslog --base-path=/var/spool/gitosis/repositories \
+        --user-path=git-public --reuseaddr --detach \
+        --pid-file=/var/run/git-daemon-gitosis.pid --user=git --group=git
+}
+
+stop() {
+    echo -n "Stopping git-daemon (for gitosis): "
+    if [ -f /var/run/git-daemon-gitosis.pid ]; then
+        kill -TERM `cat /var/run/git-daemon-gitosis.pid`
+        rm -f /var/run/git-daemon-gitosis.pid
+    fi
+}
+
+restart() {
+   stop
+   start
+}
+
+case $1 in
+   start|stop|restart) ;;
+   *)     echo "Usage: $0 {start|stop|restart}"; exit 1  ;;
+esac
+
+. /lib/lsb/init-functions


More information about the Lunar-commits mailing list