diff --git a/debian/changelog b/debian/changelog index f4e262c..0df0703 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +shellinabox (2.14-1) unstable; urgency=low + + * Revised install target of debian/rules. + * Revised postrm and prerm to fix dangling symlinks on + purge. (Closes: #668720.) + + -- Marc Singer Sat, 21 Apr 2012 10:26:21 -0700 + shellinabox (2.13-1) unstable; urgency=low * Typo in web address. (Closes: #668130.) diff --git a/debian/control b/debian/control index df0e1ec..081e01f 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Marc Singer Build-Depends: debhelper (>= 8.0.0), autotools-dev, binutils, libssl-dev, libpam0g-dev, zlib1g-dev -Standards-Version: 3.9.2 +Standards-Version: 3.9.3 Homepage: http://shellinabox.com Vcs-Git: https://code.google.com/p/shellinabox/ Vcs-Browser: https://code.google.com/p/shellinabox/source/browse/ diff --git a/debian/rules b/debian/rules index de952a3..c9b5776 100755 --- a/debian/rules +++ b/debian/rules @@ -22,34 +22,43 @@ override_dh_auto_configure: # elf-2012.03.24: This work should be done in the Makefile install # target instead of debian/rules. +DESTDIR=$(CURDIR)/debian/tmp override_dh_install: dh_testdir dh_testroot dh_prep dh_installdirs - @# Add here commands to install the package into debian/tmp - $(MAKE) install DESTDIR="$(CURDIR)/debian/tmp" +# We need to install some files for the benefit of Debian that aren't +# going into the program instal target. So, we install into +# debian/tmp the things that need to be included in the package. + $(MAKE) install DESTDIR=$(DESTDIR) # Set up system-wide user CSS style options - mkdir -p "$(CURDIR)/debian/tmp/etc/shellinabox/options-available" \ - "$(CURDIR)/debian/tmp/etc/shellinabox/options-enabled" - for i in "00+Black on White" "00_White On Black" \ - "01_Monochrome" "01+Color Terminal"; do \ - cp "$(CURDIR)/debian/tmp/usr/share/doc/shellinabox/$$(echo "$$i"| \ - sed -e 's/[0-9]*[_+]\([^ ]*\).*/\1/'| \ - tr A-Z a-z)"*.css \ - "$(CURDIR)/debian/tmp/etc/shellinabox/options-available/$$i.css";\ + mkdir -p "$(DESTDIR)/etc/shellinabox/options-available" + mkdir -p "$(DESTDIR)/etc/shellinabox/options-enabled" + for i in \ + "00+Black on White" \ + "00_White On Black" \ + "01_Monochrome" \ + "01+Color Terminal"; do \ + cp "$(DESTDIR)/usr/share/doc/shellinabox/$$(echo "$$i"| \ + sed -e 's/[0-9]*[_+]\([^ ]*\).*/\1/'| \ + tr A-Z a-z)"*.css \ + "$(DESTDIR)/etc/shellinabox/options-available/$$i.css"; \ done - cd "$(CURDIR)/debian/tmp/etc/shellinabox/options-enabled" && \ - ln -s ../options-available/*.css . + cd "$(DESTDIR)/etc/shellinabox/options-enabled" \ + && ln -s ../options-available/*.css . cp "$(CURDIR)/debian/README.available" \ - "$(CURDIR)/debian/tmp/etc/shellinabox/options-available/README" + "$(DESTDIR)/etc/shellinabox/options-available/README" cp "$(CURDIR)/debian/README.enabled" \ - "$(CURDIR)/debian/tmp/etc/shellinabox/options-enabled/README" + "$(DESTDIR)/etc/shellinabox/options-enabled/README" +# Shellinabox home directory +# mkdir -p "$(DESTDIR)/var/lib/shellinabox" # Add Lintian override. ShellInABox has an explicit exemption allowing # the linking its GPLv2 code with OpenSSL. - mkdir -p "$(CURDIR)/debian/tmp/usr/share/lintian/overrides/" + mkdir -p "$(DESTDIR)/usr/share/lintian/overrides/" { echo '# ShellInABox has an explicit exemption allowing the linking';\ echo '# of its GPLv2 code with OpenSSL'; \ echo 'shellinabox binary: possible-gpl-code-linked-with-openssl'; } \ - >"$(CURDIR)/debian/tmp/usr/share/lintian/overrides/shellinabox" + >"$(DESTDIR)/usr/share/lintian/overrides/shellinabox" +# Now perform the normal debhelper install. dh_install diff --git a/debian/shellinabox.postinst b/debian/shellinabox.postinst index c29c034..d94bbea 100755 --- a/debian/shellinabox.postinst +++ b/debian/shellinabox.postinst @@ -25,6 +25,10 @@ case "$1" in --home /var/lib/shellinabox --gecos "Shell In A Box" \ --group shellinabox fi + # Shellinabox must own the certificate directory so that it + # can write the certificate even when the daemon has given-up + # root privileges. +# chown shellinabox:shellinabox /var/lib/shellinabox ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/shellinabox.postrm b/debian/shellinabox.postrm index cde7498..6224669 100755 --- a/debian/shellinabox.postrm +++ b/debian/shellinabox.postrm @@ -18,26 +18,23 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +d=/var/lib/shellinabox case "$1" in remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; purge) - deluser --quiet --system --remove-home shellinabox > /dev/null || true + deluser --quiet --system shellinabox > /dev/null || true delgroup --quiet --system shellinabox > /dev/null || true + [ ! -d "$d" ] || rmdir "$d" || true # deluser can't do this for /var exit 0 ;; - - *) - 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/shellinabox.prerm b/debian/shellinabox.prerm new file mode 100644 index 0000000..abbdd2c --- /dev/null +++ b/debian/shellinabox.prerm @@ -0,0 +1,37 @@ +#!/bin/sh +# prerm script for shellinabox +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + [ ! -f /var/lib/shellinabox/certificate.pem ] \ + || rm /var/lib/shellinabox/certificate.pem + ;; + upgrade|deconfigure) + ;; + + failed-upgrade) + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0