diff --git a/debian/copyright b/debian/copyright index 7de0eca..b72ec5b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,20 +1,22 @@ -Format: http://dep.debian.net/deps/dep5 +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Zuul Upstream-Contact: OpenStack Continuous Integration Administrators Source: http://launchpad.net/zuul Files: * -Copyright: 2011-2013 OpenStack, LLC. - 2012 Hewlett-Packard Development Company, L.P. - 2013 Antoine "hashar" Musso - 2013 OpenStack Foundation - 2013 Timo Tijhof - 2013 Wikimedia Foundation +Copyright: 2011-2013, OpenStack, LLC. + 2012, Hewlett-Packard Development Company, L.P. + 2013, Antoine "hashar" Musso + 2013, OpenStack Foundation + 2013, Timo Tijhof + 2013, Wikimedia Foundation License: Apache Files: debian/* Copyright: 2012 Paul Belanger -License: Apache 2.0 +License: Apache + +License: Apache Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/debian/init b/debian/init index 568dddd..436ac91 100644 --- a/debian/init +++ b/debian/init @@ -18,7 +18,7 @@ NAME=zuul DAEMON=/usr/bin/zuul-server PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -USER=jenkins +USER=zuul # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..dd68bd5 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +debian/etc/zuul/* etc/zuul/ diff --git a/debian/postinst b/debian/postinst index d92381a..e4fd1bc 100644 --- a/debian/postinst +++ b/debian/postinst @@ -20,13 +20,20 @@ set -e case "$1" in configure) - chown -R jenkins:jenkins /etc/zuul - chown -R jenkins:jenkins /var/lib/zuul - chown -R jenkins:adm /var/log/zuul + # add zuul user + if ! getent passwd zuul > /dev/null ; then + echo 'Adding system user for Zuul' 1>&2 + adduser --system --group --quiet \ + --home /var/lib/zuul \ + --no-create-home --disabled-login \ + --gecos "Zuul trunk gating daemon" \ + zuul + fi + chown -R zuul:zuul /etc/zuul + chown -R zuul:zuul /var/lib/zuul + chown -R zuul:adm /var/log/zuul - chmod 0640 /etc/zuul/layout.yaml - chmod 0640 /etc/zuul/logging.conf - chmod 0640 /etc/zuul/zuul.conf + chmod 0640 -R /etc/zuul/* chmod 0750 /etc/zuul chmod 0750 /var/lib/zuul diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..2ac4fcc --- /dev/null +++ b/debian/postrm @@ -0,0 +1,40 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + userdel -r zuul 2>/dev/null || true + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 666facf..40c4daa 100755 --- a/debian/rules +++ b/debian/rules @@ -14,6 +14,12 @@ override_dh_auto_clean: dh_auto_clean rm -rf *.egg* +override_dh_auto_install: + dh_auto_install + install -D -m 0644 $(CURDIR)/etc/layout.yaml-sample $(CURDIR)/debian/etc/zuul/layout.yaml + install -D -m 0644 $(CURDIR)/etc/logging.conf-sample $(CURDIR)/debian/etc/zuul/logging.conf + install -D -m 0644 $(CURDIR)/etc/zuul.conf-sample $(CURDIR)/debian/etc/zuul/zuul.conf + override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) nosetests