source: trunk/packages/invirt-dev/debian/invirt-dev.postinst @ 3047

Last change on this file since 3047 was 3038, checked in by gdb, 14 years ago

Added git hooks to invirt-dev package

  • Property svn:executable set to *
File size: 1.6 KB
RevLine 
[956]1#!/bin/sh
2set -e
3
4#DEBHELPER#
5
6case "$1" in
7    configure)
[2556]8        if ! getent passwd repository >/dev/null 2>&1; then
[956]9            adduser --system repository
[2556]10        fi
11        if ! getent group repo >/dev/null 2>&1; then
[956]12            addgroup --system repo
[2556]13        fi
[2580]14
15        if ! getent passwd git >/dev/null 2>&1; then
16            adduser --system --home /srv/git --shell /usr/bin/git-shell git
17        fi
[2581]18
[2588]19        if ! [ -d /srv/git ]; then
20            mkdir -p /srv/git
21        fi
22
[2556]23        cat >>/etc/sudoers <<EOF
[1770]24### BEGIN invirt-dev
25%repo   ALL=(repository)        ALWAYS_SET_HOME,NOPASSWD: /usr/bin/reprepro
26### END invirt-dev
27EOF
[2630]28
[2636]29        update-inetd --add \
30            'git\tstream\ttcp\tnowait\tgit\t/usr/bin/git\tgit daemon --inetd --syslog --verbose --export-all --base-path=/srv/git /srv/git'
31
[2556]32        echo "-----"
33        echo "invirt-dev: run"
34        echo "  adduser --disabled-password \$user"
35        echo "  adduser \$user repo"
36        echo "  adduser \$user sbuild"
37        echo "to make individual users that will build packages."
38        echo "-----"
[3038]39
40        invirt-configure-git-hooks || {
41            echo "-----"
42            echo "invirt-dev: Could not configure git hooks."
43            echo "Run 'invirt-configure-git-hooks'once you"
44            echo "have configured your repositories appropriately."
45            echo "-----"
46        }
[956]47    ;;
48
49    abort-upgrade|abort-remove|abort-deconfigure)
50    ;;
51
52    *)
53        echo "postinst called with unknown argument \`$1'" >&2
54        exit 1
55    ;;
56esac
[2630]57
[3034]58if [ -x /etc/init.d/invirtibuilder ]; then
[2630]59    if hash invoke-rc.d 2>/dev/null; then
[3034]60        invoke-rc.d invirtibuilder start
[2630]61    else
[3034]62        /etc/init.d/invirtibuilder start
[2630]63    fi
64fi
Note: See TracBrowser for help on using the repository browser.