aboutsummaryrefslogtreecommitdiffstats
path: root/debian/plptools.postinst
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2014-07-06 23:54:25 +0100
committerReuben Thomas <rrt@sc3d.org>2014-07-06 23:54:25 +0100
commit07eb049b002f2144e9f5c73f08865831d7fb5c89 (patch)
treea4e1fc52f78ce5115db92fd4fe17c1660ff0d47d /debian/plptools.postinst
parentff0a91874d2fc99564eea29ff31f075296d69fb0 (diff)
downloadplptools-07eb049b002f2144e9f5c73f08865831d7fb5c89.tar.gz
plptools-07eb049b002f2144e9f5c73f08865831d7fb5c89.tar.bz2
plptools-07eb049b002f2144e9f5c73f08865831d7fb5c89.zip
Add Debianization files from Debian package 1.0.9-2.4
Diffstat (limited to 'debian/plptools.postinst')
-rw-r--r--debian/plptools.postinst113
1 files changed, 113 insertions, 0 deletions
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:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# 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
+
+