postinst is in hplip 3.14.3-0ubuntu3.4.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | #! /bin/sh
# postinst script for hplip
# $Id: hplip.postinst,v 1.1 2005/10/15 21:39:04 hmh Exp $
#
# see: dh_installdeb(1)
set -e
# 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 http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
# 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)
# add hplip system user (requires adduser >= 3.34)
# don't muck around with this unless you KNOW what you're doing
echo "Creating/updating hplip user account..."
adduser --system --ingroup lp --home /var/run/hplip \
--gecos "HPLIP system user" --shell /bin/false \
--quiet --disabled-password hplip || {
# adduser failed. Why?
if getent passwd hplip >/dev/null ; then
echo "Non-system user hplip found. I will not overwrite a non-system" >&2
echo "user. Remove the user and reinstall hplip." >&2
exit 1
fi
# unknown adduser error, simply exit
exit 1
}
for i in /var/run/hplip
do
if ! dpkg-statoverride --list $i > /dev/null
then
dpkg-statoverride --update --add hplip root 755 $i
fi
done
# Adjust permissions and ownerships of the /var/log/hp/tmp (fax spool)
# directory (https://bugs.launchpad.net/bugs/1187132)
for i in /var/log/hp/tmp
do
if ! dpkg-statoverride --list $i > /dev/null
then
dpkg-statoverride --update --add root lp 775 $i
fi
done
# Remove shutdown and reboot links; this init script does not need them.
if dpkg --compare-versions "$2" lt "1.7.3-0ubuntu4"; then
update-rc.d -f hplip remove
fi
# Fix PPD file paths in /etc/hp/hplip.conf to make sure that hp-setup
# finds the fax PPDs
perl -p -i -e 's:^(\s*ppd=).*$:\1/usr/share/ppd/hplip/HP:' /etc/hp/hplip.conf
perl -p -i -e 's:^(\s*ppdbase=).*$:\1/usr/share/ppd/hplip:' /etc/hp/hplip.conf
;;
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.
exit 0
|