[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SVN texlive (new) commit: r2484 - in texlive-new/trunk: all/debian texlive-base/debian texlive-bin/debian texlive-extra/debian texlive-lang/debian



On Mon, 19 Feb 2007, Norbert Preining wrote:
> I have already implemented the dh_installtex switch in telive-new and two new flavors
> 	format:build_all
> 	format:add_one:fmtname
> in dh_installtex. I hope I can send you the diffs soon. I cannot submit currently because my linux wlan does not cooperate with the ap here.


Ok, attached is the patch. It is longer thennecessary because it ceates
tpm2deb-bin.pl.old for security and comparion.

Damned, I didn't inlcude the patfch for dh_installtex/tex-commn,will try
to send it tonight. But I always have to copy it to windows, boot
windows, copy it to my university server, and send  email from there.
Fucking ipw3945, why does it not connec ...

Now severetesting done

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at>                    Università di Siena
Debian Developer <preining@debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
FAIRYMOUNT (vb.n.)
Polite word for buggery.
			--- Douglas Adams, The Meaning of Liff
Index: all/debian/common.functions.preinst
===================================================================
--- all/debian/common.functions.preinst	(revision 0)
+++ all/debian/common.functions.preinst	(revision 0)
@@ -0,0 +1,66 @@
+# common.functions.preinst start
+
+dpkg_md5sum(){
+    file=$1
+    md5sum=$(grep "$file[[:space:]]"  /var/lib/dpkg/status | cut -f 3 -d ' ')
+    if [ -z "$md5sum" ]; then
+        echo "$file: md5sum not known. Exiting" >&2
+        exit 1
+    fi
+    echo $md5sum
+}
+
+check_move ()
+{
+    orig="$1"
+    new="$2"
+    if [ -r "$orig" ] ; then
+        mdorig=$(dpkg_md5sum "$orig")
+        if [ $(md5sum "$orig" | cut -f 1 -d ' ') = "$mdorig" ] ; then
+            rm "$orig"
+        else
+            mkdir -p $(dirname "$new")
+            mv "$orig" "$new"
+        fi
+    fi
+}
+
+#
+# handle_config_file_preinst/postinst/prerm/postrm
+# handle those config files which are left over from old texlive and
+# tetex installations
+handle_config_file_preinst ()
+{
+    cfgfile="$1"
+    case "$cfgfile" in 
+        # files which were only present in /etc/texmf/texlive:
+        /etc/texmf/texdoctk/texdocrc.defaults)
+            check_move /etc/texmf/texlive/texdoctk/texdocrc.defaults /etc/texmf/texdoctk/texdocrc.defaults
+            ;;
+        /etc/texmf/dvipdfm/dvipdfm.cfg)
+            check_move /etc/texmf/texlive/dvipdfm.cfg /etc/texmf/dvipdfm/dvipdfm.cfg
+            ;;
+        /etc/texmf/dvips/config/*)
+            check_move /etc/texmf/texlive/dvips/$(basename "$cfgfile") $cfgfile
+            ;;
+        # files which were only present in tetex
+        /etc/texmf/texdoctk/texdoctk.dat)
+            check_move /etc/texmf/texdoctk.dat /etc/texmf/texdoctk/texdoctk.dat
+            ;;
+        # files which were present in both tetex and texlive
+        /etc/texmf/xdvi/xdvi.cfg)
+            # old tetex version
+            check_move /etc/texmf/xdvi.cfg /etc/texmf/xdvi/xdvi.cfg
+            # old texlive version takes precedence of old tetex version
+            check_move /etc/texmf/texlive/xdvi.cfg /etc/texmf/xdvi/xdvi.cfg
+            ;;
+        *)
+            echo "Please report a bug and indicate the following file" >&2
+            echo "  $cfgfile">&2
+            echo "and that it is not dealt with as config file. Thanks!" >&2
+            exit 1
+            ;;
+    esac
+}
+# common.functions.preinst end
+# vim:set expandtab: #
Index: all/debian/tpm2deb-bin.pl.old
===================================================================
--- all/debian/tpm2deb-bin.pl.old	(revision 0)
+++ all/debian/tpm2deb-bin.pl.old	(revision 0)
@@ -0,0 +1,916 @@
+#!/usr/bin/perl
+#
+# tpm2deb-bin.pl
+# machinery to create debian packages from TeX Live depot
+# (c) 2005, 2006 Norbert Preining
+#
+# $Id: tpm2deb.pl 2080 2006-12-15 12:03:49Z preining $
+#
+# configuration is done via the file tpm2deb.cfg
+#
+
+BEGIN {   # get our other local perl modules.
+	($mydir = $0) =~ s,/[^/]*$,,;
+	if ($mydir eq $0) { $mydir = `pwd` ; chomp($mydir); }
+	if (!($mydir =~ m,/.*,,)) { $mmydir = `pwd`; chomp($mmydir); $mydir = "$mmydir/$mydir" ; }
+	unshift (@INC, $mydir);
+	unshift (@INC, "$mydir/../build/tools");
+}
+
+use strict "vars";
+# use strict "refs"; # not possible with merge_into
+use warnings;
+no warnings 'once';
+no warnings 'uninitialized';
+
+#use Strict;
+use Getopt::Long;
+use File::Basename;
+use File::Copy;
+use File::Path;
+use File::Temp qw/ tempfile tempdir /;
+use Storable;
+## not needed, atm we are calling eperl binary use Parse::ePerl;
+#use XML::DOM;
+use Cwd;
+#use FileUtils qw(canon_dir cleandir make_link newpath member
+#		 normalize substitute_var_val dirname diff_list remove_list
+#		 rec_rmdir sync_dir walk_dir start_redirection stop_redirection);
+#use Tpm;
+
+
+#
+# Configuration for destination of files
+# DONT USER DOUBLE QUOTES; THESE VARIABLES HAVE TO GET REEVALUATED
+# AFTER $tmpdir IS SET!!
+#
+my $sysdebdest = '$tmpdir/debian';
+my $sysbasedir = '$debdest/$package';
+my $sysbindest = '$basedir/usr/bin';
+my $sysrundest = '$basedir/usr/share';
+my $sysdocdest = '$basedir/usr/share/doc/$package';
+my $sysetcdest = '$basedir/etc/texmf';
+
+my $debdest;
+my $basedir;
+my $bindest;
+my $rundest;
+my $docdest;
+my $etcdest;
+
+my @configfiles;
+
+my $texmfdist = "texmf-texlive";
+my $opt_nosource=0;
+my $optdestination="";
+
+my $opt_debug;
+my $opt_master;
+our $Master;
+my $globalreclevel=1;
+
+my $result = GetOptions ("debug!", 	# debug mode
+	"nosource!" => \$opt_nosource,			# don't include source files
+	"master=s" => \$opt_master,	# location of Master
+	"dest=s" => \$optdestination,	# where to write files
+	"reclevel=i" => \$globalreclevel,	# recursion level
+	);
+ 
+# Norbert, is $, intended here, or should it rather be m{/.*$}?
+if (!($opt_master =~ m,/.*$,,)) {
+	$Master = `pwd`;
+	chomp($Master);
+	$Master .= "/$opt_master";
+} else {
+	$Master = $opt_master;
+}
+my $TpmGlobalPath = $Master;
+my $DataGlobalPath = $Master;
+
+#
+# put Master/Tools/ into the include path to find TeX Live perl modules
+#
+unshift (@INC, "$Master/Tools");
+#
+# these we can only load now that we have correctly set the path to Master
+#
+require Strict;
+require XML::DOM;
+require FileUtils;
+import FileUtils qw(canon_dir cleandir make_link newpath member
+	normalize substitute_var_val dirname diff_list remove_list
+	rec_rmdir sync_dir walk_dir start_redirection stop_redirection);
+require Tpm;
+
+my $parser = new XML::DOM::Parser;
+my $startdir=getcwd();
+chdir($startdir);
+File::Basename::fileparse_set_fstype('unix');
+
+use tpm2debcommon;
+
+&main(@ARGV);
+
+1;
+
+
+sub main {
+	my (@packages) = @_;
+	${Tpm::MasterDir} = $TpmGlobalPath;
+	my $arch = "all";
+	$Tpm::CurrentArch = "i386-linux";
+	initialize_config_file_data("debian/tpm2deb.cfg");
+	load_collection_tpm_data();
+	build_data_hash();
+	check_consistency();
+	foreach my $package (@packages) {
+		# 
+		# various variables have to be set
+		#
+		#$arch = get_arch($package);
+		print "Working on $package, arch=$arch\n";
+		make_deb($package);
+	}
+}
+
+
+#
+# make_deb
+#
+sub make_deb {
+	# my function
+	#
+	# do_special ($originalfilename, $finaldestinationfilename)
+	#
+	# Do special actions as specified in the config file, like install info
+	# etc
+	my @SpecialActions = ();
+	sub do_special {
+		my ($origfn, $finalfn) = @_;
+		SPECIALS: foreach my $special (@{$TeXLive{'all'}{'special_actions_config'}}) {
+			my ($pat, $act) = ($special =~ m/(.*):(.*)/);
+			if ($origfn =~ m|$pat$|) {
+				if ($act eq "install-info") {
+					push @SpecialActions, "install-info:$origfn";
+				} else {
+					print "Unknown special action $act, terminating!\n";
+					exit 1;
+				}
+			}
+		}
+	}
+	# real start
+	my ($package) = @_;
+	my $foo;
+	my $tmpdir;
+	if ($optdestination ne "") {
+		$tmpdir = $optdestination;
+	} else {
+		$tmpdir = ".";
+	}
+	$opt_debug && print "tmpdir = $tmpdir\n";
+	$foo="\$debdest = \"$sysdebdest\""; eval $foo;
+	$foo="\$basedir = \"$sysbasedir\""; eval $foo;
+	$foo="\$bindest = \"$sysbindest\""; eval $foo;
+	$foo="\$rundest = \"$sysrundest\""; eval $foo;
+	$foo="\$docdest = \"$sysdocdest\""; eval $foo;
+	$foo="\$etcdest = \"$sysetcdest\""; eval $foo;
+	$opt_debug && print "\nProcess $package\n";
+	if ($opt_debug) {
+		print "debdest = $debdest\n";
+		print "basedir = $basedir\n";
+		print "bindest = $bindest\n";
+		print "rundest = $rundest\n";
+		print "docdest = $docdest\n";
+		print "etcdest = $etcdest\n";
+	}
+	my %lists = %{&get_all_files($package,$globalreclevel)};
+	my $title = $TeXLive{'binary'}{$package}{'title'};
+	my $description = $TeXLive{'binary'}{$package}{'description'};
+	eval { mkpath($rundest) };
+	if ($@) {
+		die "Couldn't create dir: $@";
+	}  
+	if ($opt_debug) {
+		print "SOURCEFILES: ", @{$lists{'SourceFiles'}}, "\n";
+		print "RUNFILES: ", @{$lists{'RunFiles'}}, "\n";
+	}
+	# clean @configfiles
+	@configfiles = ();
+	&mkpath($docdest);
+	if (!$opt_nosource) {
+		DOSFILE: foreach my $f (@{$lists{'SourceFiles'}}) {
+			foreach my $pat (@{$TeXLive{'all'}{'file_blacklist'}}) { 
+				if ($f =~ m|^${pat}$|) { next DOSFILE ; }
+			}
+			my $ret = do_remap_and_copy($f,$rundest);
+			do_special($f,$ret);
+		}
+	}
+	DORFILE: foreach my $f (@{$lists{'RunFiles'}}) {
+		foreach my $pat (@{$TeXLive{'all'}{'file_blacklist'}}) {
+			if ($f =~ m|^${pat}$|) { next DORFILE ; }
+		}
+		my $ret = do_remap_and_copy($f,$rundest);
+		do_special($f,$ret);
+	}
+	my %DocDirHash = ();
+	my @LinkedDocDir = ();
+	DODFILE: foreach my $f (@{$lists{'DocFiles'}}) {
+		foreach my $pat (@{$TeXLive{'all'}{'file_blacklist'}}) {
+			if ($f =~ m|^${pat}$|) { next DODFILE ; }
+		}
+		my $ret = do_remap_and_copy($f,$rundest,'^[^/]*/doc/(.*)$','$docdest/$1');
+		do_special($f,$ret);
+	}
+	DOBFILE: foreach my $f (@{$lists{'BinFiles'}}) {
+		$opt_debug && print "BINFILE: $f\n";
+		foreach my $pat (@{$TeXLive{'all'}{'file_blacklist'}}) {
+			if ($f =~ m|^${pat}$|) { next DOBFILE ; }
+		}
+		my $ret = do_remap_and_copy($f,$bindest,'^bin/[^/]*/(.*)$','$bindest/$1');
+		do_special($f,$ret);
+	}
+	if ($package eq 'texlive-base') {
+		# now activate the language.us file!
+		&mkpath("$basedir/var/lib/tex-common/language-cnf/");
+		open(LISTFILE, ">$basedir/var/lib/tex-common/language-cnf/$package.list")
+		    or die("Cannot open $basedir/var/lib/tex-common/language-cnf/$package.list");
+		print LISTFILE "09$package\n";
+		close LISTFILE;
+		&mkpath("$etcdest/language.d");
+		open(FOO,">$etcdest/language.d/09$package.cnf")
+		    or die("Cannot open $etcdest/language.d/09$package.cnf");
+		print FOO <<EOF;
+% 09$package.cnf
+%
+% You really can change stuff in this file, but it is NOT RECOMMENDED
+% to play around with this file if you do not know what you are doing!
+% Please leave this comment!
+% -_- DebPkgProvidedMaps -_-
+%
+EOF
+		open (BAR,"$DataGlobalPath/texmf/tex/generic/config/language.us")
+		or die("Cannot open $DataGlobalPath/texmf/tex/generic/config/language.us");
+		while (<BAR>) { print FOO $_; }
+		close (BAR);
+		close (FOO);
+	}
+	#
+	# EXECUTE ACTIONS
+	#
+	my @Executes = get_all_executes($package,$globalreclevel);
+	my $gotmapfiles = 0;
+	my $firstlang =1;
+	my %langhash = ();
+	my %formathash = ();
+	$opt_debug && print "Executes= @Executes\n";
+	my %Job;
+	foreach (@Executes) {
+		my @p = /([^=]+)=([^ ]+)\s+([^=]+)=([^ ]+)\s*([^=]*)=?(.*)/;
+		$Job{'parameter'} = $Job{'function'} = $Job{'mode'} = '';
+		$Job{$p[0]}=$p[1];
+		$Job{$p[2]}=$p[3];
+		$Job{$p[4]}=$p[5];
+		my $instcmd;
+		my $rmcmd;
+		if ($Job{'function'} eq 'addMap') {
+			if (!$gotmapfiles) {
+				&mkpath("$etcdest/updmap.d/");
+				open(UPDMAPCFG, ">$etcdest/updmap.d/10$package.cfg")
+				    or die("Cannot open $etcdest/updmap.d/10$package.cfg");
+				print UPDMAPCFG <<EOF;
+# 10$package.cfg
+# You can change/add entries to this file and changes will be preserved
+# over upgrades, even if you have removed the main package prior
+# (not if you purged it). YOu should leave the following pseudo comment
+# present in the file!
+# -_- DebPkgProvidedMaps -_-
+#
+EOF
+				$gotmapfiles = 1;
+			}
+			my $name=$Job{'parameter'};
+			if ($Job{'mode'} eq 'mixed') {
+				print UPDMAPCFG "Mixed";
+			}
+			print UPDMAPCFG "Map $name\n";
+		} elsif ($Job{'function'} eq 'BuildFormat') {
+			my $name=$Job{'parameter'};
+			$formathash{$name} = 1;
+		} elsif ($Job{'function'} eq 'BuildLanguageDat') {
+			my $name=$Job{'parameter'};
+			$langhash{$name} = 1;
+		}
+	}
+	#
+	# additional files to be created
+	#
+	my @formats = keys %formathash;
+	#
+	# Formats
+	#
+	if ($#formats >= 0) {
+		&mkpath("$etcdest/fmt.d/");
+		&mkpath("$basedir/var/lib/tex-common/fmtutil-cnf/");
+		open(LISTFILE, ">>$basedir/var/lib/tex-common/fmtutil-cnf/$package.list")
+		    or die("Cannot open $basedir/var/lib/tex-common/fmtutil-cnf/$package.list");
+		print LISTFILE "10$package\n";
+		close LISTFILE;
+		open(FOO, ">$etcdest/fmt.d/10$package.cnf") 
+		    or die("Cannot open $etcdest/fmt.d/10$package.cnf") ;
+		print FOO <<EOF;
+# 
+# 10$package.cnf
+#
+# You really can change stuff in this file, but it is NOT RECOMMENDED
+# to play around with this file if you do not know what you are doing!
+# Please leave this comment!
+# -_- DebPkgProvidedMaps -_-
+#
+EOF
+		foreach my $f (@formats) {
+		open(INFILE,"<$DataGlobalPath/texmf/fmtutil/format.$f.cnf")
+		    or die("Cannot open $DataGlobalPath/texmf/fmtutil/format.$f.cnf");
+			my @lines = <INFILE>;
+			close(INFILE);
+			print FOO @lines;
+		}
+		close(FOO);
+	}
+	#
+	# Map files
+	#
+	if ($gotmapfiles) {
+		# We have to call update-updmap and updmap-sys, but also create
+		# a file in /var/lib/tex-common/fontmap-cfg/pkgname.list
+		#/ containing all the files put into /etc/texmf/updmap.d/
+		&mkpath("$basedir/var/lib/tex-common/fontmap-cfg/");
+		open(LISTFILE, ">$basedir/var/lib/tex-common/fontmap-cfg/$package.list")
+		    or die("Cannot open $basedir/var/lib/tex-common/fontmap-cfg/$package.list");
+		print LISTFILE "10$package\n";
+		close LISTFILE;
+		close UPDMAPCFG;
+	}
+	#
+	# Languages
+	#
+	my @langs = keys %langhash;
+	if ($#langs >= 0) {
+		&mkpath("$etcdest/language.d/");
+		&mkpath("$basedir/var/lib/tex-common/language-cnf/");
+		open(LISTFILE, ">>$basedir/var/lib/tex-common/language-cnf/$package.list")
+		    or die("$basedir/var/lib/tex-common/language-cnf/$package.list");
+		print LISTFILE "10$package\n";
+		close LISTFILE;
+		open(LANGMAPCNF, ">$etcdest/language.d/10$package.cnf")
+		    or die("Cannot open $etcdest/language.d/10$package.cnf");
+		print LANGMAPCNF <<EOF;
+% 10$package.cnf
+%
+% You really can change stuff in this file, but it is NOT RECOMMENDED
+% to play around with this file if you do not know what you are doing!
+% Please leave this comment!
+% -_- DebPkgProvidedMaps -_-
+%
+EOF
+		foreach my $lang (keys %langhash) {
+			open(INFILE,"<$DataGlobalPath/texmf/tex/generic/config/language.$lang.dat")
+			    or die("Cannot open $DataGlobalPath/texmf/tex/generic/config/language.$lang.dat");
+			while (<INFILE>) {
+				#
+				# do NOT disable any language, users should only choose
+				# those languages they are interested in. AND, I should
+				# make a debconf question which languages should be
+				# installed/activated!!!
+				# if ("$lang" eq "py") { print LANGMAPCNF "% "; }
+				print LANGMAPCNF "$_";
+			}
+			close(INFILE);
+		}
+		close(LANGMAPCNF);
+	}
+	#
+	# Work on @SpecialActions
+	#
+	my @infofiles = ();
+	foreach my $l (@SpecialActions) {
+		my ($act, $fname) = ($l =~ m/(.*):(.*)/);
+		if ($act eq "install-info") {
+			push @infofiles, "$fname";
+		} else {
+			print "Unknown action, huuu, where does this come from: $act, exit!\n";
+			exit 1;
+		}
+	}
+	if ($#infofiles >=0) {
+		open(INFOLIST, ">$debdest/$package.info")
+		    or die("Cannot open $debdest/$package.info");
+		foreach my $f (@infofiles) {
+			print INFOLIST "$f\n";
+		}
+		close(INFOLIST);
+	}
+	#
+	# create the maintainer scripts
+	#
+	make_maintainer($package,$debdest);
+}
+
+#
+# make_maintainer
+#
+# create maintainer scripts
+#
+sub make_maintainer {
+	# my functions
+	sub merge_into {
+		my ($fname, $fhandle) = @_;
+		if (-r "$fname") {
+			open(FOO,"<$fname")
+			    or die("Cannot open $fname");
+			while (<FOO>) { print $fhandle $_; }
+		}
+	}
+	# real start
+	my ($package,$destination) = @_;
+	my @Executes = get_all_executes($package,$globalreclevel);
+	$debdest = $destination;
+	&mkpath($debdest);
+	my $gotmapfiles = 0;
+	my $firstlang = 1;
+	my %langhash = ();
+	my %formathash = ();
+	my %Job;
+	$opt_debug && print "Executes= @Executes\n";
+	foreach (@Executes) {
+		my @p = /([^=]+)=([^ ]+)\s+([^=]+)=([^ ]+)\s*([^=]*)=?(.*)/;
+		$Job{'parameter'} = $Job{'function'} = $Job{'mode'} = '';
+		$Job{$p[0]}=$p[1];
+		$Job{$p[2]}=$p[3];
+		$Job{$p[4]}=$p[5];
+		my $instcmd;
+		my $rmcmd;
+		if ($Job{'function'} eq 'addMap')
+		{
+			if (!$gotmapfiles) {
+				$gotmapfiles = 1;
+			}
+		}
+		elsif ($Job{'function'} eq 'BuildFormat')
+		{
+			my $name=$Job{'parameter'};
+			$formathash{$name} = 1;
+		} elsif ($Job{'function'} eq 'BuildLanguageDat') {
+			my $name=$Job{'parameter'};
+			$langhash{$name} = 1;
+		}
+	}
+	my @formats = keys %formathash;
+	my @alines = ();
+	my @blines = ();
+	my $allformatsbuild = 0;
+	#
+	# it doesn't hurt to call all three of them in any case!
+	#
+	$package eq "texlive-common" || push @alines, "update-texmf";
+	$package eq "texlive-common" || push @alines, "update-language";
+	$package eq "texlive-common" || push @alines, "update-fmtutil";
+	$package eq "texlive-common" || push @alines, "update-updmap --quiet";
+	#
+	# POSTINST HANDLING
+	#
+	if ($package eq "texlive") {
+		# do nothing, texlive does not include any real files, so 
+		# no call to mktexlsr necessary
+	} elsif (($package =~ m/texlive-doc-/) || ($package eq "texlive-common")) {
+		push @blines, "if which mktexlsr > /dev/null ; then update_lsr_files ; fi";
+	} else {
+		push @blines, "update_lsr_files";
+	}
+	if ($package eq 'texlive-base') {
+		push @blines, "rm -f /var/lib/texmf/web2c/latex.fmt /var/lib/texmf/web2c/latex.log /var/lib/texmf/web2c/pdflatex.fmt /var/lib/texmf/web2c/pdflatex.log";
+		push @blines, "build_format --all";
+		$allformatsbuild = 1;
+	}
+	if ($package eq 'texlive-base-bin') {
+		push @blines, "rm -f /var/lib/texmf/web2c/latex.fmt /var/lib/texmf/web2c/latex.log /var/lib/texmf/web2c/pdflatex.fmt /var/lib/texmf/web2c/pdflatex.log";
+		push @blines, "build_format --all";
+		$allformatsbuild = 1;
+	}
+	#
+	# Formats
+	#
+	my @doneformats = ();
+	if ($#formats >= 0) {
+		foreach my $f (@formats) {
+			open(INFILE,"<$DataGlobalPath/texmf/fmtutil/format.$f.cnf")
+			    or die("Cannot open $DataGlobalPath/texmf/fmtutil/format.$f.cnf");
+			my @lines = <INFILE>;
+			close(INFILE);
+			my @actualformats = grep(!/(^\s*#)|(^\s*$)/, @lines);
+			foreach my $l (@actualformats) {
+				my @bar = reverse(split(' ',$l));
+				my $fmt = pop(@bar);
+				#
+				# remove old fmt file if it is present
+				#
+				push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
+				$allformatsbuild || push @blines, "build_format --byfmt $fmt";
+				push @doneformats, $fmt;
+			}
+		}
+	}
+	my @extraformats = ();
+	if ((defined($TeXLive{'binary'}{$package}{'extra_format'})) && (!$allformatsbuild)) {
+		foreach my $fmt (keys %{$TeXLive{'binary'}{$package}{'extra_format'}}) {
+			if (!ismember($fmt,@doneformats)) {
+				push @extraformats, $fmt;
+			}
+		}
+	}
+	foreach my $fmt (@extraformats) {
+		push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
+		if ($TeXLive{'binary'}{$package}{'extra_format'}{$fmt} eq "0") {
+			push @blines, "build_format --byfmt $fmt";
+		} elsif ($TeXLive{'binary'}{$package}{'extra_format'}{$fmt} eq "1") {
+			push @blines, "build_format_if_format_exists --byfmt $fmt";
+		} else {
+			push @blines, "build_format_if_file_exists --byfmt $fmt $TeXLive{'binary'}{$package}{'extra_format'}{$fmt}";
+		}
+	}
+	#
+	# Map files
+	#
+	if ($gotmapfiles) {
+		# We have to call update-updmap and updmap-sys, but also create
+		# a file in /var/lib/tex-common/fontmap-cfg/pkgname.list
+		#/ containing all the files put into /etc/texmf/updmap.d/
+		push @blines, "create_fontmaps";
+	}
+	#
+	# Languages
+	#
+	my @langs = keys %langhash;
+	if ($#langs >= 0) {
+		#
+		# Again a problem with texmf-config settings and fmtutil-sys not
+		# finding language.dat in the right position.
+		#
+		push @blines, "build_format_if_format_exists --byhyphen latex `kpsewhich language.dat`";
+	}
+	if (($#alines >= 0) || 
+		($#blines >= 0) || 
+		(-r "$debdest/postinst.pre") || 
+		(-r "$debdest/postinst.post") || 
+		(-r "$debdest/$package.postinst.pre") || 
+		(-r "$debdest/$package.postinst.post")) {
+		open(POSTINST, ">$debdest/$package.postinst")
+		    or die("Cannot open $debdest/$package.postinst");
+		print POSTINST "#!/bin/sh -e\n";
+		merge_into("$debdest/common.functions", POSTINST);
+		merge_into("$debdest/common.functions.postinst", POSTINST);
+		#
+		# first we merge the .pre parts into the scripts
+		#
+		merge_into("$debdest/postinst.pre", POSTINST);
+		merge_into("$debdest/$package.postinst.pre", POSTINST);
+		print POSTINST <<'EOF';
+case "$1" in
+	configure|abort-upgrade|abort-remove|abort-deconfigure)
+EOF
+		foreach my $a (@alines) {
+			print POSTINST "\t", $a, "\n";
+		}
+		foreach my $b (@blines) {
+			print POSTINST "\t", $b, "\n";
+		}
+		print POSTINST <<'EOF';
+	;;
+	*)
+		echo "postinst called with unknown argument '$1'" >&2
+	exit 1
+	;;
+esac
+
+EOF
+		print POSTINST "\n#DEBHELPER#\n";
+		merge_into("$debdest/$package.postinst.post", POSTINST);
+		merge_into("$debdest/postinst.post", POSTINST);
+		print POSTINST "exit 0\n";
+		close POSTINST;
+	}
+	#
+	# END OF POSTINST STUFF
+	#
+	#
+	# PREINST STUFF
+	#
+	# only create the preinst file *if* there is a content!
+	# if there is a debhelper entry, it will create it if necessary
+	if ((-r "$debdest/$package.preinst.pre") || 
+		(-r "$debdest/$package.preinst.post") ||
+		(-r "$debdest/preinst.pre") ||
+		(-r "$debdest/preinst.post") ||
+		($#configfiles >= 0)) {
+		open(PREINST, ">$debdest/$package.preinst")
+                    or die("Cannot open $debdest/$package.preinst");
+		print PREINST "#!/bin/sh -e\n";
+		merge_into("$debdest/common.functions", PREINST);
+		merge_into("$debdest/common.functions.preinst", PREINST);
+		merge_into("$debdest/preinst.pre", PREINST);
+		merge_into("$debdest/$package.preinst.pre", PREINST);
+		foreach my $cf (@configfiles) {
+			print PREINST "handle_config_file_preinst $cf\n"
+		}
+		print PREINST "\n#DEBHELPER#\n";
+		merge_into("$debdest/$package.preinst.post", PREINST);
+		merge_into("$debdest/preinst.post", PREINST);
+		print PREINST "exit 0\n";
+		close PREINST;
+	}
+	#
+	# END OF PREINST STUFF
+	#
+	#
+	# PRERM STUFF
+	#
+	# only create the prerm file *if* there is a content!
+	# if there is a debhelper entry, it will create it if necessary
+	if ((-r "$debdest/$package.prerm.pre") || 
+		(-r "$debdest/$package.prerm.post") ||
+		(-r "$debdest/prerm.pre") ||
+		(-r "$debdest/prerm.post")) {
+		open(PRERM, ">$debdest/$package.prerm")
+                    or die("Cannot open $debdest/$package.prerm");
+		print PRERM "#!/bin/sh -e\n";
+		merge_into("$debdest/common.functions", PRERM);
+		merge_into("$debdest/common.functions.prerm", PRERM);
+		merge_into("$debdest/prerm.pre", PRERM);
+		merge_into("$debdest/$package.prerm.pre", PRERM);
+		print PRERM "\n#DEBHELPER#\n";
+		merge_into("$debdest/$package.prerm.post", PRERM);
+		merge_into("$debdest/prerm.post", PRERM);
+		print PRERM "exit 0\n";
+		close PRERM;
+	}
+	#
+	# END OF PRERM STUFF
+	#
+	# POSTRM STUFF
+	# on remove:
+	# 		call update-updmap and updmap-sys
+	# 		call update-language and fmtutil-sys --byhyphen
+	# 		call update-fmtutil and remove old formats
+	# on purge etc:
+	# 		do nothing
+	#
+	@alines = ();
+	@blines = ();
+	#
+	# Formats
+	# 
+    if ($package eq "texlive") {
+	        # do nothing, texlive does not include any real files, so
+			# no call to mktexlsr necessary
+	} else {
+		push @blines, "check_run_without_errors mktexlsr";
+	}
+	if ($#formats >= 0) {
+		foreach my $f (@formats) {
+		open(INFILE,"<$DataGlobalPath/texmf/fmtutil/format.$f.cnf")
+		    or die("Cannot open $DataGlobalPath/texmf/fmtutil/format.$f.cnf");
+			my @lines = <INFILE>;
+		my @actualformats = grep(!/(^\s*#)|(^\s*$)/, @lines);
+		foreach my $l (@actualformats) {
+			my @bar = reverse(split(' ',$l));
+			my $fmt = pop(@bar);
+		push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
+		}
+			close(INFILE);
+	}
+	}
+	foreach my $fmt (@extraformats) {
+		push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
+	}
+	if (($#formats >= 0) || ($#extraformats >= 0)) {
+		push @alines, "check_run_without_errors update-fmtutil";
+	}
+	#
+	# Map files
+	#
+	if ($gotmapfiles) {
+		push @alines, "check_run_without_errors update-updmap";
+		push @blines, "check_run_without_errors updmap-sys";
+	}
+	#
+	# Languages
+	# 
+	@langs = keys %langhash;
+	if ($#langs >= 0) {
+		#
+		# Again a problem with texmf-config settings and fmtutil-sys not
+		# finding language.dat in the right position.
+		#
+		push @alines, "check_run_without_errors update-language";
+		push @blines, "if which fmtutil-sys >/dev/null ; then";
+		push @blines, "\tbuild_format_if_format_exists --byhyphen latex `kpsewhich language.dat`";
+		push @blines, "fi";
+	}
+	if (($#alines >= 0) || 
+		($#blines >= 0) || 
+		(-r "$debdest/$package.postrm.pre") || 
+		(-r "$debdest/$package.postrm.pre") || 
+		(-r "$debdest/postrm.pre") || 
+		(-r "$debdest/postrm.post")) {
+		open(POSTRM, ">$debdest/$package.postrm")
+                    or die("Cannot open $debdest/$package.postrm");
+		print POSTRM "#!/bin/sh -e\n";
+		merge_into("$debdest/common.functions", POSTRM);
+		merge_into("$debdest/common.functions.postrm", POSTRM);
+		#
+		# first we merge the .pre parts into the scripts
+		#
+		merge_into("$debdest/postrm.pre", POSTRM);
+		merge_into("$debdest/$package.postrm.pre", POSTRM);
+		#
+		print POSTRM <<'EOF';
+
+case "$1" in
+  remove|disappear)
+EOF
+		foreach my $a (@alines) {
+			print POSTRM "\t", $a, "\n";
+		}
+		foreach my $b (@blines) {
+			print POSTRM "\t", $b, "\n";
+		}
+		print POSTRM <<'EOF';
+	;;
+	purge|upgrade|failed-upgrade|abort-upgrade|abort-install)
+	;;
+	*)
+		echo "postrm called with unknown argument '$1'" >&2
+	exit 1
+	;;
+esac
+
+EOF
+		print POSTRM "\n#DEBHELPER#\n";
+		merge_into("$debdest/$package.postrm.post", POSTRM);
+		merge_into("$debdest/postrm.post", POSTRM);
+		print POSTRM "exit 0\n";
+		close POSTRM;
+	}
+	#
+	# END OF POSTRM STUFF
+	#
+}
+
+
+#
+# do_remap_and_copy
+#
+sub do_remap_and_copy {
+	# my functions
+	#
+	# here the mapping from texlive pathes to debian pathes is done
+	#
+	sub make_destinationname {
+		my ($o) = @_;
+		$o =~ s#texmf-dist#$texmfdist#;
+		$o =~ s#texmf-doc#$texmfdist#;
+		#
+		# we do map *ALL* files into $texmfdist, not only the dist files
+		#
+		$o =~ s#texmf/#$texmfdist/#;
+		return($o);
+	}
+	# real start
+	my ($f,$standarddest,$finalremap,$finaldest) = @_;
+	my $gotremapped = 0;
+	my $returnvalue = "**NOTSET**";
+
+	my $destname = make_destinationname($f);
+	$opt_debug && print "DESTINATION NAME = $destname\n";
+	MAPPINGS: foreach my $maplines (@{$TeXLive{'all'}{'filemappings'}}) {
+		my ($pat, $dest) = ($maplines =~ m/(.*):(.*)/);
+		if ($f =~ m|$pat$|) {
+			$gotremapped = 1;
+			my $act = $TeXLive{'all'}{'file_map_actions'}{$pat};
+			my $newdest;
+			my $foo="\$newdest = \"$dest\"";
+			eval $foo;
+			$opt_debug && print "REMAP HIT f=$f\nnewdest=$newdest\npat=$pat\ndest=$dest\n";
+			# if you add possible actions here, also add them to the list in tpm2deb.cfg
+			if ($act eq "remap") {
+				&mkpath(dirname($newdest));
+				mycopy("$DataGlobalPath/$f",$newdest);
+				$returnvalue = $newdest;
+			} elsif ($act eq "copy") {
+				# mapping;origfile;copy;TEXMF-tree-base
+				# eg
+				# mapping;temxf/tex/latex/pict2e/pict2e.cfg;copy;/etc/texmf
+				#
+				# first install it into the normal path
+				mycopy("$DataGlobalPath/$f","$standarddest/$destname");
+				&mkpath("$basedir/$newdest");
+				# remove the leading texmf{-dist,-doc,}/
+				my $o = $f;
+				$o =~ s#texmf-dist#texmf#;
+				$o =~ s#texmf-doc#texmf#;
+				$o =~ s#texmf/##;
+				mycopy("$DataGlobalPath/$f","$basedir$newdest/$o");
+				$returnvalue = "$basedir$newdest/$o";
+			} elsif ($act eq "config-copy") {
+				# mapping;origfile;config-copy;TEXMFSYSCONFIGPATH
+				# eg
+				# mapping;temxf/tex/generic/language.dat;config-copy;/etc/texmf
+				#
+				# first install it into the normal path
+				mycopy("$DataGlobalPath/$f","$standarddest/$destname");
+				&mkpath("$basedir/$newdest");
+				# remove the leading texmf{-dist,-doc,}/
+				my $o = $f;
+				$o =~ s#texmf-dist#texmf#;
+				$o =~ s#texmf-doc#texmf#;
+				$o =~ s#texmf/##;
+				mycopy("$DataGlobalPath/$f","$basedir$newdest/$o");
+				$returnvalue = "$standarddest/$destname";
+				push @configfiles, "$newdest/$o";
+			} elsif ($act eq "link") {
+				&mkpath(dirname("$standarddest/$destname"));
+				symlink($newdest, "$standarddest/$destname") or
+					die "Cannot symlink $standarddest/$destname -> $newdest: $!\n"; 
+				$returnvalue = $newdest;
+			} elsif ($act eq "config-link") {
+				# config-link is LIKE remap-link, only that we maybe can 
+				# add some automatic specialities for config-file 
+				# maintainer script magic
+				# remap and link from the original destination
+				&mkpath(dirname("$basedir$newdest"));
+				mycopy("$DataGlobalPath/$f","$basedir/$newdest");
+				# we have to strip of the $debdest part
+				&mkpath(dirname("$standarddest/$destname"));
+				symlink($newdest, "$standarddest/$destname") or
+					die "Cannot symlink $standarddest/$destname -> $newdest: $!\n"; 
+				$returnvalue = $newdest; ## ?? or $destname????
+				push @configfiles, $newdest;
+			} elsif ($act eq "remap-link") {
+				# remap and link from the original destination
+				&mkpath(dirname($newdest));
+				mycopy("$DataGlobalPath/$f",$newdest);
+				# we have to strip of the $debdest part
+				$foo = $newdest;
+				$foo =~ s/^$basedir//;
+				&mkpath(dirname("$standarddest/$destname"));
+				symlink($foo, "$standarddest/$destname") or
+					die "Cannot symlink $standarddest/$destname -> $newdest: $!\n"; 
+				$returnvalue = $newdest; ## ?? or $destname????
+			} elsif ($act eq "add-link") {
+				#print "DEBUG: f=$f\nDEBUG: destname=$destname\nDEBUG: newdest=$newdest\n";
+				mycopy("$DataGlobalPath/$f","$standarddest/$destname");
+				&mkpath(dirname($newdest));
+				$b = "$standarddest/$destname";
+				symlink($b,$newdest) or
+					die "Cannot symlink, $newdest -> $b: $!\n";
+				$returnvalue = "$standarddest/$destname";
+			} elsif ($act eq "replace-link") {
+				my ($a,$b) = split(/%/,$newdest);
+				&mkpath(dirname($a));
+				symlink($b,$a) or die "Cannot symlink $a -> $b: $!\n";
+				$returnvalue = $b;
+			} elsif ($act eq "") {
+				$returnvalue = "";
+				# do nothing, the file is killed
+			} else {
+				print "maplines=$maplines\nact = $TeXLive{'all'}{'file_map_actions'}{$pat}\n";
+				print "Unknown action $act in config file, terminating!\n";
+				exit 1;
+			}
+			last MAPPINGS;
+		}
+	}
+	if ($gotremapped == 0) {
+		if ($finalremap ne "" && $destname =~ m|$finalremap|) {
+			my $foo="\$finaldest = \"$finaldest\"";
+			eval $foo;
+			&mkpath(dirname($finaldest));
+			mycopy("$DataGlobalPath/$f",$finaldest);
+			$returnvalue = $finaldest;
+		} else {
+			$opt_debug && print "NORMAL COPY: $standarddest/$destname\n";
+			&mkpath(dirname("$standarddest/$destname"));
+			mycopy("$DataGlobalPath/$f","$standarddest/$destname");
+			$returnvalue = "$standarddest/$destname";
+		}
+	}
+	return($returnvalue);
+}
+
+### Local Variables:
+### perl-indent-level: 4
+### tab-width: 4
+### indent-tabs-mode: t
+### End:
+# vim:set tabstop=4: #

Property changes on: all/debian/tpm2deb-bin.pl.old
___________________________________________________________________
Name: svn:executable
   + *

Index: all/debian/CHANGES.packaging
===================================================================
--- all/debian/CHANGES.packaging	(revision 2483)
+++ all/debian/CHANGES.packaging	(working copy)
@@ -3,6 +3,20 @@
 #
 # $Id: CHANGES.packaging 2080 2006-12-15 12:03:49Z preining $
 #
+
+2007-02-18
+  * add common.functions.preinst and include common.functions.$type in
+    the make_maintainer call. We don't want to have the preinst code
+    hanging around in all other maintainer scripts.
+  * use dh_installtex in the rules files, thus cleaning the 
+    maintainer scripts:
+    - rules.in: use dh_installtex
+    - tpm2deb.cfg: bump tex-common deps to >> 1.0 for the flavor
+      format:build_all
+    - tpm2deb-bin.pl: rewrite make_maintainer()
+    - remove empty common.functions as all the functionality is taken from
+      dh_installtex
+
 2007-02-17
   * add patch 01_tmp_configure_without_installextra which allows to skip
     running updmap-sys, fmtutil-sys, mktexlsr and most importantly
Index: all/debian/tpm2deb.cfg
===================================================================
--- all/debian/tpm2deb.cfg	(revision 2483)
+++ all/debian/tpm2deb.cfg	(working copy)
@@ -224,18 +224,18 @@
 #
 # texlive-base
 build-dep;texlive-base;debhelper (>= 5), quilt
-build-dep-indep;texlive-base;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>= 0.23), eperl, findutils (>=4.2.0)
+build-dep-indep;texlive-base;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>> 1.0), eperl, findutils (>=4.2.0)
 # texlive-doc
 build-dep;texlive-doc;debhelper (>= 5), quilt
-build-dep-indep;texlive-doc;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>= 0.23), eperl, findutils (>=4.2.0)
+build-dep-indep;texlive-doc;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>> 1.0), eperl, findutils (>=4.2.0)
 # texlive-lang
 build-dep;texlive-lang;debhelper (>= 5), quilt
-build-dep-indep;texlive-lang;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>= 0.23), eperl, findutils (>=4.2.0)
+build-dep-indep;texlive-lang;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>> 1.0), eperl, findutils (>=4.2.0)
 # texlive-extra
 build-dep;texlive-extra;debhelper (>= 5), quilt
-build-dep-indep;texlive-extra;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>= 0.23), eperl, findutils (>=4.2.0)
+build-dep-indep;texlive-extra;libxml-dom-perl, libappconfig-perl, libxml-regexp-perl, libxml-perl, sharutils, tex-common (>> 1.0), eperl, findutils (>=4.2.0)
 # texlive-bin
-build-dep;texlive-bin;debhelper (>= 5), libxml-dom-perl, libappconfig-perl, quilt, libxml-regexp-perl, libxml-perl, sharutils, ed, bzip2, libncurses5-dev | libncurses-dev, libxaw7-dev, libpng12-dev | libpng-dev, zlib1g-dev | libz-dev, libgd2-xpm-dev | libgd2-noxpm-dev, flex, bison, libpoppler-dev, tex-common (>= 0.33), eperl
+build-dep;texlive-bin;debhelper (>= 5), libxml-dom-perl, libappconfig-perl, quilt, libxml-regexp-perl, libxml-perl, sharutils, ed, bzip2, libncurses5-dev | libncurses-dev, libxaw7-dev, libpng12-dev | libpng-dev, zlib1g-dev | libz-dev, libgd2-xpm-dev | libgd2-noxpm-dev, flex, bison, libpoppler-dev, tex-common (>> 1.0), eperl
 #build-dep-indep;texlive-bin;, findutils (>=4.2.0)
 #
 # CHECK
Index: all/debian/common.functions
===================================================================
--- all/debian/common.functions	(revision 2483)
+++ all/debian/common.functions	(working copy)
@@ -1,175 +0,0 @@
-# common.functions start
-
-#
-# build_format_if_format_exists
-# $1 = fmtutil mode switch: --byfmt | --byhyphen | --all
-# $2 = name of the format
-# $3 = possible additional options (byhyphen -> hyphenfile)
-build_format_if_format_exists ()
-{
-    #X=`fmtutil-sys --listcfg | grep "^$2[[:space:]]" || true`
-    v=`kpsewhich -var-value TEXMFSYSVAR`
-    c=`kpsewhich -var-value TEXMFSYSCONFIG`
-    TEXMFVAR="$v"
-    TEXMFCONFIG="$c"
-    export TEXMFVAR TEXMFCONFIG
-    fmtcnffile=`kpsewhich --format='web2c files' fmtutil.cnf`
-    X=`grep "^[[:space:]]*$2[[:space:]]" $fmtcnffile || true`
-    if [ ! "X$X" = "X" ] ; then
-        if [ "X$1" = "X--byhyphen" ] ; then
-	    build_format --byhyphen $3
-	else
-            build_format $1 $2
-	fi
-    fi
-}
-
-build_format_if_file_exists ()
-{
-    X=`kpsewhich $3 || true`
-    if [ ! "X$X" = "X" ] ; then
-        build_format $1 $2
-    fi
-}
-
-build_format ()
-{
-    tempfile=`mktemp -p /tmp texlive.fmtutil.XXXXXXXX`
-    printf "Building format(s) $1 `basename "$2"`. This may take some time..."
-    if fmtutil-sys $1 $2 > $tempfile 2>&1 ; then
-        rm -f $tempfile
-	echo " done."
-    else
-        echo
-	echo "fmtutil-sys failed. Output has been stored in"
-	echo "$tempfile"
-	echo "Please include this file if you report a bug."
-	echo
-	exit 1
-    fi
-}
-
-check_run_without_errors ()
-{
-    tempfile=`mktemp -p /tmp texlive.checkrun.XXXXXXXX`
-    if which $1  >/dev/null; then
-        printf "Running $*. This may take some time..."
-	set +e
-        $* > $tempfile 2>&1
-	if [ $? = 0 ] ; then
-	  rm -f $tempfile
-	  echo " done."
-	else
-	  echo
-	  echo "$* failed. Output has been stored in"
-	  echo "$tempfile"
-	  echo "If tex-common is not configured you can ignore this error message!"
-	  echo "Otherwise please include this file if you report a bug."
-	  echo
-	fi
-	set -e
-    else
-        rm -f $tempfile
-    fi
-    return 0
-}
-
-# stolen from tetex common.functions.in
-create_fontmaps ()
-{
-    tempfile=`mktemp -p /tmp texlive.updmap.XXXXXXXX`
-    printf "Running updmap-sys. This may take some time..."
-    if updmap-sys > $tempfile 2>&1 ; then
-      rm -f $tempfile
-      echo " done."
-    else
-      echo
-      echo "updmap failed. Output has been stored in"
-      echo "$tempfile"
-      echo "Please include this file if you report a bug."
-      echo
-      exit 1
-    fi
-}
-
-update_lsr_files ()
-{
-    tempfile=`mktemp -p /tmp texlive.mktexlsr.XXXXXXXX`
-    printf "Running mktexlsr. This may take some time..."
-    if mktexlsr /usr/share/texmf /usr/share/texmf-texlive /var/lib/texmf > $tempfile 2>&1 ; then
-         rm -f $tempfile
-	 echo " done."
-    else
-          echo
-	  echo "mktexlsr failed. Output has been stored in"
-	  echo "$tempfile"
-	  echo "Please include this file if you report a bug."
-	  echo
-	  exit 1
-    fi
-}
-
-dpkg_md5sum(){
-    file=$1
-    md5sum=$(grep "$file[[:space:]]"  /var/lib/dpkg/status | cut -f 3 -d ' ')
-    if [ -z "$md5sum" ]; then
-        echo "$file: md5sum not known. Exiting" >&2
-        exit 1
-    fi
-    echo $md5sum
-}
-
-check_move ()
-{
-    orig="$1"
-    new="$2"
-    if [ -r "$orig" ] ; then
-        mdorig=$(dpkg_md5sum "$orig")
-        if [ $(md5sum "$orig" | cut -f 1 -d ' ') = "$mdorig" ] ; then
-            rm "$orig"
-        else
-            mkdir -p $(dirname "$new")
-            mv "$orig" "$new"
-        fi
-    fi
-}
-
-#
-# handle_config_file_preinst/postinst/prerm/postrm
-# handle those config files which are left over from old texlive and
-# tetex installations
-handle_config_file_preinst ()
-{
-    cfgfile="$1"
-    case "$cfgfile" in 
-        # files which were only present in /etc/texmf/texlive:
-        /etc/texmf/texdoctk/texdocrc.defaults)
-            check_move /etc/texmf/texlive/texdoctk/texdocrc.defaults /etc/texmf/texdoctk/texdocrc.defaults
-            ;;
-        /etc/texmf/dvipdfm/dvipdfm.cfg)
-            check_move /etc/texmf/texlive/dvipdfm.cfg /etc/texmf/dvipdfm/dvipdfm.cfg
-            ;;
-        /etc/texmf/dvips/config/*)
-            check_move /etc/texmf/texlive/dvips/$(basename "$cfgfile") $cfgfile
-            ;;
-        # files which were only present in tetex
-        /etc/texmf/texdoctk/texdoctk.dat)
-            check_move /etc/texmf/texdoctk.dat /etc/texmf/texdoctk/texdoctk.dat
-            ;;
-        # files which were present in both tetex and texlive
-        /etc/texmf/xdvi/xdvi.cfg)
-            # old tetex version
-            check_move /etc/texmf/xdvi.cfg /etc/texmf/xdvi/xdvi.cfg
-            # old texlive version takes precedence of old tetex version
-            check_move /etc/texmf/texlive/xdvi.cfg /etc/texmf/xdvi/xdvi.cfg
-            ;;
-        *)
-            echo "Please report a bug and indicate the following file" >&2
-            echo "  $cfgfile">&2
-            echo "and that it is not dealt with as config file. Thanks!" >&2
-            exit 1
-            ;;
-    esac
-}
-# common.functions end
-# vim:set expandtab: #
Index: all/debian/rules.in
===================================================================
--- all/debian/rules.in	(revision 2483)
+++ all/debian/rules.in	(working copy)
@@ -61,8 +61,13 @@
 
 clean: unpatch
 	for i in $(PACKAGES) ; do \
-	  rm -f debian/$$i.{README.Debian,postinst,postrm,prerm,links,links.generated} ; \
+	  rm -f debian/$$i.{README.Debian,links,links.generated} ; \
+	  rm -f debian/$$i.{postinst,postrm,preinst,prerm} ; \
+	  rm -f debian/$$i.{maps,languages,formats} ; \
 	done
+<: if ($srcpackage eq "texlive-base") { _:>//
+	rm -f debian/texlive-base.cnf
+<: } :>//
 <: if ($srcpackage eq "texlive-bin") { _:>//
 	rm -rf build/source/Work build/source/inst
 	rm -rf bin
@@ -111,6 +116,20 @@
 	dh_installdocs -A debian/README.Debian-source
 <: if ($srcpackage eq "texlive-base") { _:>//
 	dh_installdocs -p texlive-common README.?? debian/CHANGES.packaging
+	dh_installtex -Ntexlive-base -A --priority=10	\
+		texmftrees=/usr/share/texmf-texlive
+	dh_installtex -ptexlive-base --priority=10	\
+		--flavor=format:build_all		\
+		texmftrees=/usr/share/texmf-texlive	\
+		languagefile=debian/texlive-base.cnf=09
+<: } elsif ($srcpackage eq "texlive-bin") { _:>//
+	dh_installtex -Ntexlive-base-bin -A --priority=10	\
+		texmftrees=/usr/share/texmf-texlive
+	dh_installtex -ptexlive-base-bin --priority=10	\
+		--flavor=format:build_all		\
+		texmftrees=/usr/share/texmf-texlive
+<: } else { _:>//
+	dh_installtex -A --priority=10 texmftrees=/usr/share/texmf-texlive
 <: } :>//
 	dh_installchangelogs
 	bash debian/convert-info-files-to-unix.sh
Index: all/debian/tpm2deb-bin.pl
===================================================================
--- all/debian/tpm2deb-bin.pl	(revision 2483)
+++ all/debian/tpm2deb-bin.pl	(working copy)
@@ -232,34 +232,21 @@
 		do_special($f,$ret);
 	}
 	if ($package eq 'texlive-base') {
-		# now activate the language.us file!
-		&mkpath("$basedir/var/lib/tex-common/language-cnf/");
-		open(LISTFILE, ">$basedir/var/lib/tex-common/language-cnf/$package.list")
-		    or die("Cannot open $basedir/var/lib/tex-common/language-cnf/$package.list");
-		print LISTFILE "09$package\n";
-		close LISTFILE;
-		&mkpath("$etcdest/language.d");
-		open(FOO,">$etcdest/language.d/09$package.cnf")
-		    or die("Cannot open $etcdest/language.d/09$package.cnf");
-		print FOO <<EOF;
-% 09$package.cnf
-%
-% You really can change stuff in this file, but it is NOT RECOMMENDED
-% to play around with this file if you do not know what you are doing!
-% Please leave this comment!
-% -_- DebPkgProvidedMaps -_-
-%
-EOF
+		open(USLANG,">$debdest/texlive-base.cnf")
+			or die("Cannot open $debdest/texlive-base.cnf for writing!");
 		open (BAR,"$DataGlobalPath/texmf/tex/generic/config/language.us")
-		or die("Cannot open $DataGlobalPath/texmf/tex/generic/config/language.us");
-		while (<BAR>) { print FOO $_; }
+			or die("Cannot open $DataGlobalPath/texmf/tex/generic/config/language.us");
+		while (<BAR>) { print USLANG; }
 		close (BAR);
-		close (FOO);
+		close (USLANG);
 	}
 	#
 	# EXECUTE ACTIONS
 	#
 	my @Executes = get_all_executes($package,$globalreclevel);
+	my @maplines = ();
+	my @formatlines = ();
+	my @languagelines = ();
 	my $gotmapfiles = 0;
 	my $firstlang =1;
 	my %langhash = ();
@@ -275,121 +262,54 @@
 		my $instcmd;
 		my $rmcmd;
 		if ($Job{'function'} eq 'addMap') {
-			if (!$gotmapfiles) {
-				&mkpath("$etcdest/updmap.d/");
-				open(UPDMAPCFG, ">$etcdest/updmap.d/10$package.cfg")
-				    or die("Cannot open $etcdest/updmap.d/10$package.cfg");
-				print UPDMAPCFG <<EOF;
-# 10$package.cfg
-# You can change/add entries to this file and changes will be preserved
-# over upgrades, even if you have removed the main package prior
-# (not if you purged it). YOu should leave the following pseudo comment
-# present in the file!
-# -_- DebPkgProvidedMaps -_-
-#
-EOF
-				$gotmapfiles = 1;
-			}
 			my $name=$Job{'parameter'};
 			if ($Job{'mode'} eq 'mixed') {
-				print UPDMAPCFG "Mixed";
+				push @maplines, "MixedMap $name\n";
+			} else {
+				push @maplines, "Map $name\n";
 			}
-			print UPDMAPCFG "Map $name\n";
 		} elsif ($Job{'function'} eq 'BuildFormat') {
 			my $name=$Job{'parameter'};
-			$formathash{$name} = 1;
+			open(INFILE,"<$DataGlobalPath/texmf/fmtutil/format.$name.cnf")
+				or die("Cannot open $DataGlobalPath/texmf/fmtutil/format.$name.cnf");
+			my @tmp = <INFILE>;
+			close(INFILE);
+			push @formatlines, @tmp;
 		} elsif ($Job{'function'} eq 'BuildLanguageDat') {
 			my $name=$Job{'parameter'};
-			$langhash{$name} = 1;
-		}
-	}
-	#
-	# additional files to be created
-	#
-	my @formats = keys %formathash;
-	#
-	# Formats
-	#
-	if ($#formats >= 0) {
-		&mkpath("$etcdest/fmt.d/");
-		&mkpath("$basedir/var/lib/tex-common/fmtutil-cnf/");
-		open(LISTFILE, ">>$basedir/var/lib/tex-common/fmtutil-cnf/$package.list")
-		    or die("Cannot open $basedir/var/lib/tex-common/fmtutil-cnf/$package.list");
-		print LISTFILE "10$package\n";
-		close LISTFILE;
-		open(FOO, ">$etcdest/fmt.d/10$package.cnf") 
-		    or die("Cannot open $etcdest/fmt.d/10$package.cnf") ;
-		print FOO <<EOF;
-# 
-# 10$package.cnf
-#
-# You really can change stuff in this file, but it is NOT RECOMMENDED
-# to play around with this file if you do not know what you are doing!
-# Please leave this comment!
-# -_- DebPkgProvidedMaps -_-
-#
-EOF
-		foreach my $f (@formats) {
-		open(INFILE,"<$DataGlobalPath/texmf/fmtutil/format.$f.cnf")
-		    or die("Cannot open $DataGlobalPath/texmf/fmtutil/format.$f.cnf");
-			my @lines = <INFILE>;
+			open(INFILE,"<$DataGlobalPath/texmf/tex/generic/config/language.$name.dat")
+				or die("Cannot open $DataGlobalPath/texmf/tex/generic/config/language.$name.dat");
+			my @tmp = <INFILE>;
 			close(INFILE);
-			print FOO @lines;
+			push @languagelines, @tmp;
 		}
-		close(FOO);
 	}
+	# what is missing from old handling of maintainer scripts:
+	# - texlive-base and texlive-base-bin should call
+	# 	fmtutil-sys --all
+	# 	but dh_installtex does not support something like this!
+	# - extraformats: $TeXLive{'binary'}{$package}{'extra_format'}
+	#   dh_installtex does not support creating creation calls for
+	#   additional formats, ie those not in the to be installed format files
 	#
-	# Map files
-	#
-	if ($gotmapfiles) {
-		# We have to call update-updmap and updmap-sys, but also create
-		# a file in /var/lib/tex-common/fontmap-cfg/pkgname.list
-		#/ containing all the files put into /etc/texmf/updmap.d/
-		&mkpath("$basedir/var/lib/tex-common/fontmap-cfg/");
-		open(LISTFILE, ">$basedir/var/lib/tex-common/fontmap-cfg/$package.list")
-		    or die("Cannot open $basedir/var/lib/tex-common/fontmap-cfg/$package.list");
-		print LISTFILE "10$package\n";
-		close LISTFILE;
-		close UPDMAPCFG;
+	if ($#maplines >= 0) {
+		open(OUTFILE, ">$debdest/$package.maps")
+			or die("Cannot open $debdest/$package.maps");
+		foreach (@maplines) { print OUTFILE; }
+		close(OUTFILE);
 	}
-	#
-	# Languages
-	#
-	my @langs = keys %langhash;
-	if ($#langs >= 0) {
-		&mkpath("$etcdest/language.d/");
-		&mkpath("$basedir/var/lib/tex-common/language-cnf/");
-		open(LISTFILE, ">>$basedir/var/lib/tex-common/language-cnf/$package.list")
-		    or die("$basedir/var/lib/tex-common/language-cnf/$package.list");
-		print LISTFILE "10$package\n";
-		close LISTFILE;
-		open(LANGMAPCNF, ">$etcdest/language.d/10$package.cnf")
-		    or die("Cannot open $etcdest/language.d/10$package.cnf");
-		print LANGMAPCNF <<EOF;
-% 10$package.cnf
-%
-% You really can change stuff in this file, but it is NOT RECOMMENDED
-% to play around with this file if you do not know what you are doing!
-% Please leave this comment!
-% -_- DebPkgProvidedMaps -_-
-%
-EOF
-		foreach my $lang (keys %langhash) {
-			open(INFILE,"<$DataGlobalPath/texmf/tex/generic/config/language.$lang.dat")
-			    or die("Cannot open $DataGlobalPath/texmf/tex/generic/config/language.$lang.dat");
-			while (<INFILE>) {
-				#
-				# do NOT disable any language, users should only choose
-				# those languages they are interested in. AND, I should
-				# make a debconf question which languages should be
-				# installed/activated!!!
-				# if ("$lang" eq "py") { print LANGMAPCNF "% "; }
-				print LANGMAPCNF "$_";
-			}
-			close(INFILE);
-		}
-		close(LANGMAPCNF);
+	if ($#formatlines >= 0) {
+		open(OUTFILE, ">$debdest/$package.formats")
+			or die("Cannot open $debdest/$package.formats");
+		foreach (@formatlines) { print OUTFILE; }
+		close(OUTFILE);
 	}
+	if ($#languagelines >= 0) {
+		open(OUTFILE, ">$debdest/$package.languages")
+			or die("Cannot open $debdest/$package.languages");
+		foreach (@languagelines) { print OUTFILE; }
+		close(OUTFILE);
+	}
 	#
 	# Work on @SpecialActions
 	#
@@ -423,347 +343,44 @@
 # create maintainer scripts
 #
 sub make_maintainer {
-	# my functions
 	sub merge_into {
 		my ($fname, $fhandle) = @_;
 		if (-r "$fname") {
-			open(FOO,"<$fname")
+			open(BAR,"<$fname")
 			    or die("Cannot open $fname");
-			while (<FOO>) { print $fhandle $_; }
+			while (<BAR>) { print $fhandle $_; }
+			close(BAR);
 		}
 	}
-	# real start
-	my ($package,$destination) = @_;
-	my @Executes = get_all_executes($package,$globalreclevel);
-	$debdest = $destination;
+	my ($package,$debdest) = @_;
 	&mkpath($debdest);
-	my $gotmapfiles = 0;
-	my $firstlang = 1;
-	my %langhash = ();
-	my %formathash = ();
-	my %Job;
-	$opt_debug && print "Executes= @Executes\n";
-	foreach (@Executes) {
-		my @p = /([^=]+)=([^ ]+)\s+([^=]+)=([^ ]+)\s*([^=]*)=?(.*)/;
-		$Job{'parameter'} = $Job{'function'} = $Job{'mode'} = '';
-		$Job{$p[0]}=$p[1];
-		$Job{$p[2]}=$p[3];
-		$Job{$p[4]}=$p[5];
-		my $instcmd;
-		my $rmcmd;
-		if ($Job{'function'} eq 'addMap')
-		{
-			if (!$gotmapfiles) {
-				$gotmapfiles = 1;
+	for my $type (qw/postinst preinst postrm prerm/) {
+		if ((-r "$debdest/$type.pre") ||
+			(-r "$debdest/$type.post") ||
+			(-r "$debdest/$package.$type.pre") || 
+			(-r "$debdest/$package.$type.post") ||
+			( ($type eq "preinst") && ($#configfiles >= 0) )) {
+			open(FOO, ">$debdest/$package.$type")
+				or die("Cannot open $debdest/$package.$type for writing");
+			print FOO "#!/bin/sh -e\n";
+			merge_into("$debdest/common.functions", FOO);
+			merge_into("$debdest/common.functions.$type", FOO);
+			merge_into("$debdest/$type.pre", FOO);
+			merge_into("$debdest/$package.$type.pre", FOO);
+			if ($type eq "preinst") {
+				foreach my $cf (@configfiles) {
+					print FOO "handle_config_file_preinst $cf\n"
+				}
 			}
+			print FOO "\n#DEBHELPER#\n";
+			merge_into("$debdest/$package.$type.post", FOO);
+			merge_into("$debdest/$type.post", FOO);
+			print FOO "exit 0\n";
+			close FOO;
 		}
-		elsif ($Job{'function'} eq 'BuildFormat')
-		{
-			my $name=$Job{'parameter'};
-			$formathash{$name} = 1;
-		} elsif ($Job{'function'} eq 'BuildLanguageDat') {
-			my $name=$Job{'parameter'};
-			$langhash{$name} = 1;
-		}
 	}
-	my @formats = keys %formathash;
-	my @alines = ();
-	my @blines = ();
-	my $allformatsbuild = 0;
-	#
-	# it doesn't hurt to call all three of them in any case!
-	#
-	$package eq "texlive-common" || push @alines, "update-texmf";
-	$package eq "texlive-common" || push @alines, "update-language";
-	$package eq "texlive-common" || push @alines, "update-fmtutil";
-	$package eq "texlive-common" || push @alines, "update-updmap --quiet";
-	#
-	# POSTINST HANDLING
-	#
-	if ($package eq "texlive") {
-		# do nothing, texlive does not include any real files, so 
-		# no call to mktexlsr necessary
-	} elsif (($package =~ m/texlive-doc-/) || ($package eq "texlive-common")) {
-		push @blines, "if which mktexlsr > /dev/null ; then update_lsr_files ; fi";
-	} else {
-		push @blines, "update_lsr_files";
-	}
-	if ($package eq 'texlive-base') {
-		push @blines, "rm -f /var/lib/texmf/web2c/latex.fmt /var/lib/texmf/web2c/latex.log /var/lib/texmf/web2c/pdflatex.fmt /var/lib/texmf/web2c/pdflatex.log";
-		push @blines, "build_format --all";
-		$allformatsbuild = 1;
-	}
-	if ($package eq 'texlive-base-bin') {
-		push @blines, "rm -f /var/lib/texmf/web2c/latex.fmt /var/lib/texmf/web2c/latex.log /var/lib/texmf/web2c/pdflatex.fmt /var/lib/texmf/web2c/pdflatex.log";
-		push @blines, "build_format --all";
-		$allformatsbuild = 1;
-	}
-	#
-	# Formats
-	#
-	my @doneformats = ();
-	if ($#formats >= 0) {
-		foreach my $f (@formats) {
-			open(INFILE,"<$DataGlobalPath/texmf/fmtutil/format.$f.cnf")
-			    or die("Cannot open $DataGlobalPath/texmf/fmtutil/format.$f.cnf");
-			my @lines = <INFILE>;
-			close(INFILE);
-			my @actualformats = grep(!/(^\s*#)|(^\s*$)/, @lines);
-			foreach my $l (@actualformats) {
-				my @bar = reverse(split(' ',$l));
-				my $fmt = pop(@bar);
-				#
-				# remove old fmt file if it is present
-				#
-				push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
-				$allformatsbuild || push @blines, "build_format --byfmt $fmt";
-				push @doneformats, $fmt;
-			}
-		}
-	}
-	my @extraformats = ();
-	if ((defined($TeXLive{'binary'}{$package}{'extra_format'})) && (!$allformatsbuild)) {
-		foreach my $fmt (keys %{$TeXLive{'binary'}{$package}{'extra_format'}}) {
-			if (!ismember($fmt,@doneformats)) {
-				push @extraformats, $fmt;
-			}
-		}
-	}
-	foreach my $fmt (@extraformats) {
-		push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
-		if ($TeXLive{'binary'}{$package}{'extra_format'}{$fmt} eq "0") {
-			push @blines, "build_format --byfmt $fmt";
-		} elsif ($TeXLive{'binary'}{$package}{'extra_format'}{$fmt} eq "1") {
-			push @blines, "build_format_if_format_exists --byfmt $fmt";
-		} else {
-			push @blines, "build_format_if_file_exists --byfmt $fmt $TeXLive{'binary'}{$package}{'extra_format'}{$fmt}";
-		}
-	}
-	#
-	# Map files
-	#
-	if ($gotmapfiles) {
-		# We have to call update-updmap and updmap-sys, but also create
-		# a file in /var/lib/tex-common/fontmap-cfg/pkgname.list
-		#/ containing all the files put into /etc/texmf/updmap.d/
-		push @blines, "create_fontmaps";
-	}
-	#
-	# Languages
-	#
-	my @langs = keys %langhash;
-	if ($#langs >= 0) {
-		#
-		# Again a problem with texmf-config settings and fmtutil-sys not
-		# finding language.dat in the right position.
-		#
-		push @blines, "build_format_if_format_exists --byhyphen latex `kpsewhich language.dat`";
-	}
-	if (($#alines >= 0) || 
-		($#blines >= 0) || 
-		(-r "$debdest/postinst.pre") || 
-		(-r "$debdest/postinst.post") || 
-		(-r "$debdest/$package.postinst.pre") || 
-		(-r "$debdest/$package.postinst.post")) {
-		open(POSTINST, ">$debdest/$package.postinst")
-		    or die("Cannot open $debdest/$package.postinst");
-		print POSTINST "#!/bin/sh -e\n";
-		merge_into("$debdest/common.functions", POSTINST);
-		#
-		# first we merge the .pre parts into the scripts
-		#
-		merge_into("$debdest/postinst.pre", POSTINST);
-		merge_into("$debdest/$package.postinst.pre", POSTINST);
-		print POSTINST <<'EOF';
-case "$1" in
-	configure|abort-upgrade|abort-remove|abort-deconfigure)
-EOF
-		foreach my $a (@alines) {
-			print POSTINST "\t", $a, "\n";
-		}
-		foreach my $b (@blines) {
-			print POSTINST "\t", $b, "\n";
-		}
-		print POSTINST <<'EOF';
-	;;
-	*)
-		echo "postinst called with unknown argument '$1'" >&2
-	exit 1
-	;;
-esac
-
-EOF
-		print POSTINST "\n#DEBHELPER#\n";
-		merge_into("$debdest/$package.postinst.post", POSTINST);
-		merge_into("$debdest/postinst.post", POSTINST);
-		print POSTINST "exit 0\n";
-		close POSTINST;
-	}
-	#
-	# END OF POSTINST STUFF
-	#
-	#
-	# PREINST STUFF
-	#
-	# only create the preinst file *if* there is a content!
-	# if there is a debhelper entry, it will create it if necessary
-	if ((-r "$debdest/$package.preinst.pre") || 
-		(-r "$debdest/$package.preinst.post") ||
-		(-r "$debdest/preinst.pre") ||
-		(-r "$debdest/preinst.post") ||
-		($#configfiles >= 0)) {
-		open(PREINST, ">$debdest/$package.preinst")
-                    or die("Cannot open $debdest/$package.preinst");
-		print PREINST "#!/bin/sh -e\n";
-		merge_into("$debdest/common.functions", PREINST);
-		merge_into("$debdest/preinst.pre", PREINST);
-		merge_into("$debdest/$package.preinst.pre", PREINST);
-		foreach my $cf (@configfiles) {
-			print PREINST "handle_config_file_preinst $cf\n"
-		}
-		print PREINST "\n#DEBHELPER#\n";
-		merge_into("$debdest/$package.preinst.post", PREINST);
-		merge_into("$debdest/preinst.post", PREINST);
-		print PREINST "exit 0\n";
-		close PREINST;
-	}
-	#
-	# END OF PREINST STUFF
-	#
-	#
-	# PRERM STUFF
-	#
-	# only create the prerm file *if* there is a content!
-	# if there is a debhelper entry, it will create it if necessary
-	if ((-r "$debdest/$package.prerm.pre") || 
-		(-r "$debdest/$package.prerm.post") ||
-		(-r "$debdest/prerm.pre") ||
-		(-r "$debdest/prerm.post")) {
-		open(PRERM, ">$debdest/$package.prerm")
-                    or die("Cannot open $debdest/$package.prerm");
-		print PRERM "#!/bin/sh -e\n";
-		merge_into("$debdest/common.functions", PRERM);
-		merge_into("$debdest/prerm.pre", PRERM);
-		merge_into("$debdest/$package.prerm.pre", PRERM);
-		print PRERM "\n#DEBHELPER#\n";
-		merge_into("$debdest/$package.prerm.post", PRERM);
-		merge_into("$debdest/prerm.post", PRERM);
-		print PRERM "exit 0\n";
-		close PRERM;
-	}
-	#
-	# END OF PRERM STUFF
-	#
-	# POSTRM STUFF
-	# on remove:
-	# 		call update-updmap and updmap-sys
-	# 		call update-language and fmtutil-sys --byhyphen
-	# 		call update-fmtutil and remove old formats
-	# on purge etc:
-	# 		do nothing
-	#
-	@alines = ();
-	@blines = ();
-	#
-	# Formats
-	# 
-    if ($package eq "texlive") {
-	        # do nothing, texlive does not include any real files, so
-			# no call to mktexlsr necessary
-	} else {
-		push @blines, "check_run_without_errors mktexlsr";
-	}
-	if ($#formats >= 0) {
-		foreach my $f (@formats) {
-		open(INFILE,"<$DataGlobalPath/texmf/fmtutil/format.$f.cnf")
-		    or die("Cannot open $DataGlobalPath/texmf/fmtutil/format.$f.cnf");
-			my @lines = <INFILE>;
-		my @actualformats = grep(!/(^\s*#)|(^\s*$)/, @lines);
-		foreach my $l (@actualformats) {
-			my @bar = reverse(split(' ',$l));
-			my $fmt = pop(@bar);
-		push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
-		}
-			close(INFILE);
-	}
-	}
-	foreach my $fmt (@extraformats) {
-		push @alines, "rm -f /var/lib/texmf/web2c/$fmt.*";
-	}
-	if (($#formats >= 0) || ($#extraformats >= 0)) {
-		push @alines, "check_run_without_errors update-fmtutil";
-	}
-	#
-	# Map files
-	#
-	if ($gotmapfiles) {
-		push @alines, "check_run_without_errors update-updmap";
-		push @blines, "check_run_without_errors updmap-sys";
-	}
-	#
-	# Languages
-	# 
-	@langs = keys %langhash;
-	if ($#langs >= 0) {
-		#
-		# Again a problem with texmf-config settings and fmtutil-sys not
-		# finding language.dat in the right position.
-		#
-		push @alines, "check_run_without_errors update-language";
-		push @blines, "if which fmtutil-sys >/dev/null ; then";
-		push @blines, "\tbuild_format_if_format_exists --byhyphen latex `kpsewhich language.dat`";
-		push @blines, "fi";
-	}
-	if (($#alines >= 0) || 
-		($#blines >= 0) || 
-		(-r "$debdest/$package.postrm.pre") || 
-		(-r "$debdest/$package.postrm.pre") || 
-		(-r "$debdest/postrm.pre") || 
-		(-r "$debdest/postrm.post")) {
-		open(POSTRM, ">$debdest/$package.postrm")
-                    or die("Cannot open $debdest/$package.postrm");
-		print POSTRM "#!/bin/sh -e\n";
-		merge_into("$debdest/common.functions", POSTRM);
-		#
-		# first we merge the .pre parts into the scripts
-		#
-		merge_into("$debdest/postrm.pre", POSTRM);
-		merge_into("$debdest/$package.postrm.pre", POSTRM);
-		#
-		print POSTRM <<'EOF';
-
-case "$1" in
-  remove|disappear)
-EOF
-		foreach my $a (@alines) {
-			print POSTRM "\t", $a, "\n";
-		}
-		foreach my $b (@blines) {
-			print POSTRM "\t", $b, "\n";
-		}
-		print POSTRM <<'EOF';
-	;;
-	purge|upgrade|failed-upgrade|abort-upgrade|abort-install)
-	;;
-	*)
-		echo "postrm called with unknown argument '$1'" >&2
-	exit 1
-	;;
-esac
-
-EOF
-		print POSTRM "\n#DEBHELPER#\n";
-		merge_into("$debdest/$package.postrm.post", POSTRM);
-		merge_into("$debdest/postrm.post", POSTRM);
-		print POSTRM "exit 0\n";
-		close POSTRM;
-	}
-	#
-	# END OF POSTRM STUFF
-	#
 }
 
-
 #
 # do_remap_and_copy
 #

Reply to: