diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-08-29 07:26:24 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-11-20 16:16:15 +0100 |
commit | bef04aed0b38f2e40438b7670d743e5e1ffcd844 (patch) | |
tree | 770f5508b895cb5e48f4988acdf329bee789371a | |
parent | ef6e4115e7182e9b2581b5805e136c22cae02aa0 (diff) |
Add Debian packaging
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 15 | ||||
-rw-r--r-- | debian/copyright | 23 | ||||
-rw-r--r-- | debian/dirs | 3 | ||||
-rw-r--r-- | debian/install | 4 | ||||
-rw-r--r-- | debian/links | 4 | ||||
-rw-r--r-- | debian/postinst | 67 | ||||
-rw-r--r-- | debian/postrm | 51 | ||||
-rwxr-xr-x | debian/rules | 23 | ||||
-rw-r--r-- | debian/source/format | 1 |
11 files changed, 197 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..7737bfe --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +ldapsp (0.0.1-1) unstable; urgency=medium + + * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP> + + -- Guido Günther <agx@sigxcpu.org> Mon, 29 Aug 2016 07:17:04 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a6dffc2 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: ldapsp +Section: admin +Priority: optional +Maintainer: Guido Günther <agx@sigxcpu.org> +Build-Depends: debhelper (>=9), + dh-systemd, + erlang, +Standards-Version: 3.9.8 + +Package: ldapsp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: LDAP Realm smartproxy for Foreman + This smartproxy can be used to create/remove ldap + entries on host creation/removal. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..9425fc8 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,23 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ldapsp +Source: <url://example.com> + +Files: * +Copyright: 2016 Guido Günther <agx@sigxcpu.org> +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/> + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..936216d --- /dev/null +++ b/debian/dirs @@ -0,0 +1,3 @@ +/etc/ldapsp +# Until we move everything to journald +/var/log/ldapsp diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..616385f --- /dev/null +++ b/debian/install @@ -0,0 +1,4 @@ +_build/prod/rel/ldapsp/ opt/ +priv/policy.erl etc/ldapsp +priv/ldapsp.conf etc/ldapsp +priv/policy.conf etc/ldapsp diff --git a/debian/links b/debian/links new file mode 100644 index 0000000..763ef31 --- /dev/null +++ b/debian/links @@ -0,0 +1,4 @@ +etc/ldapsp opt/ldapsp/lib/ldapsp-1/priv +etc/ldapsp opt/ldapsp/priv +var/log/ldapsp etc/ldapsp/log +var/log/ldapsp opt/ldapsp/log diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..9c6175c --- /dev/null +++ b/debian/postinst @@ -0,0 +1,67 @@ +#!/bin/sh +# postinst script for ldapsp +# +# see: dh_installdeb(1) + +set -e + +add_users_groups() +{ + if ! getent group ldapsp >/dev/null; then + addgroup --system ldapsp + fi + + if ! getent passwd ldapsp >/dev/null; then + adduser --ingroup=ldapsp --quiet --system --home=/opt/ldapsp ldapsp + fi +} + +add_statoverrides() +{ + OVERRIDES="\ + /etc/ldapsp/ \ + /etc/ldapsp/ldapsp.conf \ + /etc/ldapsp/policy.erl \ + /var/log/ldapsp \ + /opt/ldapsp + " + + for f in ${OVERRIDES}; do + if ! dpkg-statoverride --list "${f}" >/dev/null 2>&1; then + [ ! -e "${f}" ] || chown ldapsp "${f}" + fi + done + + f=/etc/ldapsp/ldapsp.conf + if ! dpkg-statoverride --list "${f}" >/dev/null 2>&1; then + [ ! -e "${f}" ] || chmod 0640 "${f}" + fi + + f=/var/log/ldapsp + if ! dpkg-statoverride --list "${f}" >/dev/null 2>&1; then + [ ! -e "${f}" ] || chgrp adm "${f}" + fi +} + + +case "$1" in + configure) + add_users_groups + add_statoverrides + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst 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/postrm b/debian/postrm new file mode 100644 index 0000000..15c3af0 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,51 @@ +#!/bin/sh +# postrm script for ldapsp +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +del_users_groups() { + if getent group ldapsp >/dev/null; then + delgroup ldapsp || true + fi + + if getent passwd ldapsp >/dev/null; then + deluser ldapsp || true + fi +} + + +case "$1" in + purge) + del_users_groups + ;; + + 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 new file mode 100755 index 0000000..7d97588 --- /dev/null +++ b/debian/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +%: + dh $@ + +override_dh_auto_build: + ./rebar3 as prod release + cp priv/ldapsp.service debian/ + +override_dh_install: + dh_install + rm -r debian/ldapsp/opt/ldapsp/lib/ldapsp-1/priv/ + +override_dh_installinit: + dh_systemd_enable + dh_systemd_start --restart-after-upgrade ldapsp.service + +override_dh_auto_clean: + dh_auto_clean + rm -f debian/ldapsp.service diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) |