Actually create a git user.
[invirt/packages/invirt-dev.git] / debian / invirt-dev.postinst
1 #!/bin/sh
2 set -e
3
4 #DEBHELPER#
5
6 case "$1" in
7     configure)
8         if ! getent passwd repository >/dev/null 2>&1; then
9             adduser --system repository
10         fi
11         if ! getent group repo >/dev/null 2>&1; then
12             addgroup --system repo
13         fi
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
18             
19         cat >>/etc/sudoers <<EOF
20 ### BEGIN invirt-dev
21 %repo   ALL=(repository)        ALWAYS_SET_HOME,NOPASSWD: /usr/bin/reprepro
22 ### END invirt-dev
23 EOF
24         echo "-----"
25         echo "invirt-dev: run"
26         echo "  adduser --disabled-password \$user"
27         echo "  adduser \$user repo"
28         echo "  adduser \$user sbuild"
29         echo "to make individual users that will build packages."
30         echo "-----"
31     ;;
32
33     abort-upgrade|abort-remove|abort-deconfigure)
34     ;;
35
36     *)
37         echo "postinst called with unknown argument \`$1'" >&2
38         exit 1
39     ;;
40 esac