#!/bin/sh
# From MirOS: contrib/hosted/tg/deb/jupp/debian/jupp.postinst,v 1.11 2011/10/06 08:59:57 tg Exp $

set -e

# This maintainer script can be called the following ways:
#
# * new-postinst "configure" [$most_recently_configured_version]
# The package is unpacked; all dependencies are unpacked and, when there
# are no circular dependencies, configured.
#
# * old-postinst "abort-upgrade" $new_version
# * conflictors-postinst "abort-remove" "in-favour" $package
#	$new_version
# * postinst "abort-remove"
# * deconfigureds-postinst "abort-deconfigure" "in-favour"
#	$failed_install_package $fip_version ["removing"
#	$conflicting_package $cp_version]
# The package is unpacked; all dependencies are at least Half-Installed,
# previously been configured, and not removed. In some error situations,
# dependencies may not be even fully unpacked.
#
# * postinst "triggered" "${triggers[*]}"
# For trigger-only calls, i.e. if "configure" is not called.

case $1 in
configure|triggered)
	for n in cpio pax tar; do
		dn=/usr/share/man/man1/mir${n}.1
		case $n in
		(pax) sn=/usr/share/man/man1/pax.1 ;;
		(*) sn=/usr/share/man/man1/pax${n}.1 ;;
		esac
		if ! gzip -d <$sn.gz >$dn.$$ || ! test -s $dn.$$; then
			rm -f $dn.$$
			continue
		fi
		sed 1s/2/1/ <$dn.$$ | gzip -n9 >$dn.gz
		rm -f $dn.$$
	done
	;;

abort-upgrade|abort-remove|abort-deconfigure)
	;;

*)
	echo >&2 "postinst called with unknown subcommand '$1'"
	exit 1
	;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
