diff --git a/Makefile b/Makefile index 72828e5..1c5685e 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,11 @@ all: install install: apt-get install pbuilder devscripts debhelper cowbuilder git dput fakeroot sudo if ! getent passwd eobuilder > /dev/null 2>&1; then useradd eobuilder --home-dir /var/lib/eobuilder --create-home; fi + python setup.py install su eobuilder -p -c "cp pbuilderrc /var/lib/eobuilder/.pbuilderrc" su eobuilder -p -c "cp dput.cf /var/lib/eobuilder/.dput.cf" su eobuilder -p -c "cp gitconfig /var/lib/eobuilder/.gitconfig" - cp eobuilder /usr/local/bin + cp eobuilder.sh /usr/local/bin cp eobuilder.cron /etc/cron.daily/eobuilder uninstall: diff --git a/eobuilder.sh b/eobuilder.sh new file mode 100755 index 0000000..1dddf15 --- /dev/null +++ b/eobuilder.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$(whoami)" != "eobuilder" ]; then + if which sudo; then + if sudo -v -u eobuilder; then + sudo -u eobuilder eobuilder "$@" + exit $? + fi + echo "You must run this script with eobuilder user" + exit 1 + fi +fi + +eobuilder-ctl $*