From dddb6471530f655acd7361920d2924261487b701 Mon Sep 17 00:00:00 2001 From: Kim Holviala Date: Sun, 13 Nov 2016 12:54:53 +0200 Subject: [PATCH] Fix Debian package building for inetd systems --- ChangeLog | 4 ++++ Makefile | 5 +---- debian/changelog | 6 ++++++ debian/control | 6 +++--- debian/gophernicus.default | 6 +++--- debian/postinst | 9 ++++++++- debian/postrm | 6 +----- debian/prerm | 8 +++++++- 8 files changed, 33 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index dce1e9e..2d57cc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ [ Automatically generated from git log ] +2016-11-13 Kim Holviala + + * Added systemd entries to Debian logcheck ignore file + 2016-10-18 Kim Holviala * Fixed a potentially uninitialized char in strcut() diff --git a/Makefile b/Makefile index 455d501..7b4cd92 100644 --- a/Makefile +++ b/Makefile @@ -69,10 +69,7 @@ withwrap: # Special targets # deb: ChangeLog - @echo - @echo "Debian package building can haz borken, plz wait some moar..." - @echo - @#dpkg-buildpackage -rfakeroot -uc -us + dpkg-buildpackage -rfakeroot -uc -us ChangeLog: if [ -d .git ]; then \ diff --git a/debian/changelog b/debian/changelog index 1fd4c13..59b1a75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +gophernicus (2.1) unstable; urgency=low + + * New upstream release + + -- Kim Holviala Sun, 13 Nov 2016 11:11:11 +0200 + gophernicus (1.8.1) unstable; urgency=low * New upstream release diff --git a/debian/control b/debian/control index caa768a..04b72ca 100644 --- a/debian/control +++ b/debian/control @@ -2,15 +2,15 @@ Source: gophernicus Section: net Priority: extra Maintainer: Kim Holviala -Build-Depends: debhelper (>= 5) +Build-Depends: debhelper (>= 5), libwrap0-dev Standards-Version: 3.7.3 Homepage: gopher://gophernicus.org/1/software/gophernicus/server/ Package: gophernicus Architecture: any -Depends: ${shlibs:Depends}, debconf, netbase, openbsd-inetd | inet-superserver | systemd +Depends: ${shlibs:Depends}, debconf, netbase, update-inetd, libwrap0, openbsd-inetd | inet-superserver | systemd Recommends: lsb-release -Suggests: lynx, php5-cli +Suggests: php5-cli Description: Modern full-featured gopher server Gophernicus is a modern full-featured (and hopefully) secure gopher daemon. diff --git a/debian/gophernicus.default b/debian/gophernicus.default index cb077cf..bbe4e10 100644 --- a/debian/gophernicus.default +++ b/debian/gophernicus.default @@ -1,4 +1,4 @@ -# Options for Gophernicus +# Options for Gophernicus for use with systemd # # See README or run "in.gophernicus -?" to see a full list of # configuration options. @@ -6,5 +6,5 @@ # Example: # OPTIONS="-h full.hostname -D \"I find your lack of gopher disturbing.\"" # -# Uncomment and add your options here: -OPTIONS="-h $HOSTNAME -l $LOGDIR/server.log -f /usr/lib/$PACKAGE/filters" +# Add your options here: +OPTIONS="-h __HOSTNAME__ -l __LOGDIR__/server.log -f /usr/lib/__PACKAGE__/filters" diff --git a/debian/postinst b/debian/postinst index b982087..2eed2e4 100644 --- a/debian/postinst +++ b/debian/postinst @@ -12,6 +12,7 @@ PACKAGE=gophernicus LOGDIR=/var/log/$PACKAGE LIBDIR=/usr/lib/$PACKAGE BINARY=in.gophernicus +DEFAULT=/etc/default/$PACKAGE USER=nobody # Get hostname from debconf @@ -29,6 +30,12 @@ if [ "$1" = "configure" ]; then chown $USER.adm $LOGDIR chmod 0750 $LOGDIR - #update-inetd --add "gopher\t\tstream\ttcp\tnowait\t$USER\t/usr/sbin/$BINARY\t$BINARY -h $HOSTNAME -l $LOGDIR/server.log -f /usr/lib/$PACKAGE/filters" + sed -i -e "s|-h [^ ]* |-h $HOSTNAME |" $DEFAULT + sed -i -e "s|__PACKAGE__|$PACKAGE|g" $DEFAULT + sed -i -e "s|__LOGDIR__|$LOGDIR|g" $DEFAULT + + if [ -f /etc/inetd.conf ]; then + /usr/sbin/update-inetd --add "gopher\t\tstream\ttcp\tnowait\t$USER\t/usr/sbin/$BINARY\t$BINARY -h $HOSTNAME -l $LOGDIR/server.log -f /usr/lib/$PACKAGE/filters" + fi fi diff --git a/debian/postrm b/debian/postrm index ea97443..08dcd1c 100644 --- a/debian/postrm +++ b/debian/postrm @@ -1,6 +1,6 @@ #!/bin/sh -if [ "$1" = "purge" -a -x "/usr/sbin/update-inetd" ]; then +if [ "$1" = "purge" -a -f "/etc/inetd.conf" ]; then /usr/sbin/update-inetd --remove "## gopher" fi @@ -8,8 +8,4 @@ if [ -d "/run/systemd/system" ]; then systemctl --system daemon-reload >/dev/null || true fi -if [ -x "/usr/bin/deb-systemd-helper" ]; then - /usr/bin/deb-systemd-helper disable gophernicus.socket >/dev/null -fi - #DEBHELPER# diff --git a/debian/prerm b/debian/prerm index 77d621c..52c1625 100644 --- a/debian/prerm +++ b/debian/prerm @@ -1,6 +1,12 @@ #!/bin/sh -#update-inetd --disable gopher +if [ -f "/etc/inetd.conf" ]; then + /usr/sbin/update-inetd --disable gopher +fi + +if [ -x "/usr/bin/deb-systemd-helper" ]; then + /usr/bin/deb-systemd-helper disable gophernicus.socket >/dev/null +fi #DEBHELPER#