From 07eb049b002f2144e9f5c73f08865831d7fb5c89 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Sun, 6 Jul 2014 23:54:25 +0100 Subject: Add Debianization files from Debian package 1.0.9-2.4 --- debian/plptools.postinst | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 debian/plptools.postinst (limited to 'debian/plptools.postinst') diff --git a/debian/plptools.postinst b/debian/plptools.postinst new file mode 100644 index 0000000..1a7d9f2 --- /dev/null +++ b/debian/plptools.postinst @@ -0,0 +1,113 @@ +#! /bin/sh +# postinst script for plptools +# +# see: dh_installdeb(1) + +set -e +. /usr/share/debconf/confmodule + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + START_NCPD=no + START_PLPFUSE=no + START_PLPPRINTD=no + NCPD_ARGS= + PLPFUSE_ARGS= + PLPPRINTD_ARGS= + FREM= + db_get plptools/ncpd/start + if [ "$RET" = "true" ] ; then + START_NCPD=yes + db_get plptools/ncpd/serial + if [ "$RET" != "/dev/ttyS0" ] ; then + NCPD_ARGS="$NCPD_ARGS -s $RET" + fi + db_get plptools/ncpd/listenat + case "$RET" in + 127.0.0.1) + ;; + 127.0.0.1:7501) + ;; + *) + NCPD_ARGS="$NCPD_ARGS -p $RET" + ;; + esac + else + db_get plptools/frontends/remoteaddr + case "$RET" in + 127.0.0.1) + ;; + 127.0.0.1:7501) + ;; + *) + FREM="-p $RET" + ;; + esac + fi + db_get plptools/plpfuse/start + if [ "$RET" = "true" ] ; then + START_PLPFUSE=yes + PLPFUSE_ARGS="$FREM" + fi + db_get plptools/plpprintd/start + if [ "$RET" = "true" ] ; then + START_PLPPRINTD=yes + PLPPRINTD_ARGS="$FREM" + db_get plptools/plpprintd/printqueue + if [ "$RET" != "psion" ] ; then + PLPPRINTD_ARGS="$PLPPRINTD_ARGS -s \"lpr -P$RET\"" + fi + fi +# Move /etc/plptools.conf to /etc/default/plptools if it exists + if test -f /etc/plptools.conf; then + mv /etc/plptools.conf /etc/default/plptools + fi + cp /etc/default/plptools /etc/default/plptools.$$ + cat /etc/default/plptools.$$ | sed \ + -e "s@START_NCPD=.*@START_NCPD=$START_NCPD@" \ + -e "s@START_PLPFUSE=.*@START_PLPFUSE=$START_PLPFUSE@" \ + -e "s@START_PLPPRINTD=.*@START_PLPPRINTD=$START_PLPPRINTD@" \ + -e "s@NCPD_ARGS=.*@NCPD_ARGS=\"$NCPD_ARGS\"@" \ + -e "s@PLPFUSE_ARGS=.*@PLPFUSE_ARGS=\"$PLPFUSE_ARGS\"@" \ + -e "s@PLPPRINTD_ARGS=.*@PLPPRINTD_ARGS=\"$PLPPRINTD_ARGS\"@" \ + > /etc/default/plptools \ + && rm -f /etc/default/plptools.$$ \ + || mv /etc/default/plptools.$$ /etc/default/plptools || : + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +db_stop + +exit 0 + + -- cgit v1.2.3