[subversion-commit] SVN tetex commit + diffs: r244 - in
tex-common/trunk: debian scripts
Norbert Preining
preining-guest at costa.debian.org
Sun Oct 16 22:56:48 UTC 2005
Author: preining-guest
Date: 2005-10-16 22:56:47 +0000 (Sun, 16 Oct 2005)
New Revision: 244
Added:
tex-common/trunk/scripts/dh_installtexfonts
tex-common/trunk/scripts/postinst-texfonts
tex-common/trunk/scripts/postrm-texfonts
Modified:
tex-common/trunk/debian/changelog
tex-common/trunk/debian/control
tex-common/trunk/debian/rules
Log:
inclusion of dh_installtexfonts into tex-common, implementation of the
policy as discussed on the ML.
Modified: tex-common/trunk/debian/changelog
===================================================================
--- tex-common/trunk/debian/changelog 2005-10-16 22:42:42 UTC (rev 243)
+++ tex-common/trunk/debian/changelog 2005-10-16 22:56:47 UTC (rev 244)
@@ -1,10 +1,11 @@
tex-common (0.8.1) UNRELEASED; urgency=low
* Change ls-R file handling to be useful. Don't use debconf as
- registry. (Closes: #332264)
+ registry. (Closes: #332264) [preining]
* Translations:
- updated danish debconf translation, thanks to Claus Hindsgaul
<claus_h at image.dk> (closes: #332699) [frank]
+ * install debhelper dh_installtexfonts script (closes: #320147) [preining]
-- Frank Küster <frank at debian.org> Tue, 11 Oct 2005 11:28:02 +0200
Modified: tex-common/trunk/debian/control
===================================================================
--- tex-common/trunk/debian/control 2005-10-16 22:42:42 UTC (rev 243)
+++ tex-common/trunk/debian/control 2005-10-16 22:56:47 UTC (rev 244)
@@ -9,7 +9,7 @@
Package: tex-common
Architecture: all
-Depends: ucf, ${misc:Depends}
+Depends: ucf, debhelper (>= 4.0), ${perl:Depends}, ${misc:Depends}
Replaces: tetex-base (<= 3.0-7)
Conflicts: tetex-bin (<= 3.0-4), tetex-base (<= 3.0-3)
Description: Common infrastructure for using and building TeX in Debian
Modified: tex-common/trunk/debian/rules
===================================================================
--- tex-common/trunk/debian/rules 2005-10-16 22:42:42 UTC (rev 243)
+++ tex-common/trunk/debian/rules 2005-10-16 22:56:47 UTC (rev 244)
@@ -8,6 +8,8 @@
sbin_scripts=update-texmf update-fontlang
sbin_installfiles=$(foreach script,$(sbin_scripts), scripts/$(script))
sbin_manpages=$(foreach script,$(sbin_scripts), scripts/$(script).8) scripts/update-fmtutil.8 scripts/update-language.8
+
+bin_scripts=dh_installtexfonts
bin_manpages=$(foreach script,$(bin_scripts), scripts/$(script).1) scripts/update-updmap.1
# for the teTeX packages
@@ -38,6 +40,7 @@
# Add here commands to compile the package.
cd doc; $(MAKE)
+ cd scripts; pod2man dh_installtexfonts > dh_installtexfonts.1
touch build-stamp
@@ -69,10 +72,16 @@
cp conf/updmap.d/00updmap.cfg $(INSTDIR)/usr/share/tex-common/
cp -a debian/md5sums/* $(INSTDIR)/usr/share/tex-common/
cp $(sbin_installfiles) $(INSTDIR)/usr/sbin/
+ cp $(bin_installfiles) $(INSTDIR)/usr/bin/
ln -s update-fontlang $(INSTDIR)/usr/sbin/update-language
ln -s update-fontlang $(INSTDIR)/usr/sbin/update-fmtutil
ln -s ../sbin/update-fontlang $(INSTDIR)/usr/bin/update-updmap
+ # debhelper stuff
+ # dh_installtexfonts(.1) is already installed via the bin_scripts
+ cp scripts/postrm-texfonts $(INSTDIR)/usr/share/debhelper/autoscripts
+ cp scripts/postinst-texfonts $(INSTDIR)/usr/share/debhelper/autoscripts
+
# ship /var/cache/fonts with proper permissions
mkdir --mode=1777 $(INSTDIR)/var/cache/fonts/pk
mkdir --mode=1777 $(INSTDIR)/var/cache/fonts/tfm
Copied: tex-common/trunk/scripts/dh_installtexfonts (from rev 242, dh-installtexfonts/trunk/dh_installtexfonts)
===================================================================
--- dh-installtexfonts/trunk/dh_installtexfonts 2005-10-16 17:08:26 UTC (rev 242)
+++ tex-common/trunk/scripts/dh_installtexfonts 2005-10-16 22:56:47 UTC (rev 244)
@@ -0,0 +1,212 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_installtexfonts - register TeX type1 fonts
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_installtexfonts> [S<I<debhelper options>>] [B<--priority=>I<n>] [S<I<maptype=mapfile ...>|I<cfg-file ...>>]
+
+=head1 DESCRIPTION
+
+dh_installtexfonts is a debhelper program that is responsible for
+registering type1 fonts for TeX.
+
+Your package should depend on tex-common (>= 0.9) so that the
+update-* commands are available. (This program adds that dependency to
+${misc:Depends}.)
+
+Registering map files for TeX can be done in the following ways:
+1) You can specify cfg files on the cmd line. These cfg files will be
+installed into etc/texmf/updmap.d/ with the standard priority 10 (but
+see below) and their original name (foo.cfg installs into 10foo.cfg).
+
+2) You can specify map lines on the cmdline, where the map type and the
+map files is connected with =. These map lines are stored in a cfg file
+10package.cfg.
+
+3) You create a file debian/package.maps or debian/maps. These files are
+installed with default priority and the name of the package (i.e.
+debian/package.maps is installed as 10package.cfg). The file debian/maps
+will be installed into the first package dh_installtexfonts is told to
+act on. By default this is the first binary package in debian/control, but
+if you use -p, -i, or -a flags, it will be the first package specified
+by those flags.
+
+If you mix these variants and the same file 10package.cfg would be created
+several times (by variant 1) if you provide a cfg file with the same name,
+by 2) and by 3) if debian/package.maps is present), they will get renamed
+to 10package1.cfg and 10package2.cfg.
+
+The files as installed in variant 1) or 3) will get an additional header
+containing a explanation text and the magic header for correct updmap
+function. Please see the TeX Policy for more information on this
+magic header.
+
+This program automatically generates the postinst and postrm commands needed
+to register TeX fonts. See L<dh_installdeb(1)> for an explanation of how this
+works.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--priority=>I<n>
+
+Instead of using the default priority of 10 for the updmap-config file,
+use the priority specified by the --priority parameter.
+
+=head1 NOTES
+
+See Debian TeX policy, section 4.1.1. for details about doing fonts for TeX
+the Debian way.
+
+=cut
+
+init();
+
+foreach my $package (@{$dh{DOPACKAGES}}) {
+ my $tmp=tmpdir($package);
+ my $file=pkgfile($package,"maps");
+ my $priority=10;
+ my @pkgcfg;
+ my @cmdlinemaps;
+ my @cmdlinecfgs;
+ my $pkgfilepresent = 0;
+ my $pkgfileext = "";
+ my @listlines;
+
+ if (defined($dh{PRIORITY}) && $dh{PRIORITY} ne '') {
+ $priority=$dh{PRIORITY};
+ }
+ if ($file) {
+ open(FOO, "<$file") || error("$file cannot be opened.");
+ @pkgcfg = <FOO>;
+ close(FOO);
+ $pkgfilepresent = 1;
+ }
+ if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
+ foreach my $entry (@ARGV) {
+ if ($entry =~ m/^(Map|MixedMap)=(.*)$/) {
+ push @cmdlinemaps, "$1 $2";
+ } elsif ($entry =~ m/\.cfg$/) {
+ my $bn=basename($entry);
+ if ($entry eq "$package.cfg") {
+ $pkgfileext = "1";
+ }
+ push @cmdlinecfgs, $entry;
+ } else {
+ error("$entry is neither of the form Map=filename.map, MixedMap=filename.map, or filename.cfg.");
+ }
+ }
+ }
+
+ if (!$pkgfilepresent && ($#cmdlinemaps < 0) && ($#cmdlinecfgs < 0)) {
+ # we have nothing to do here, skip to the next one!
+ next;
+ }
+
+ if ( ! -d "$tmp/etc/texmf/updmap.d/") {
+ doit("install","-d","$tmp/etc/texmf/updmap.d/");
+ }
+ #
+ # the cmd line cfg files
+ #
+ foreach my $cfg (@cmdlinecfgs) {
+ my $bn=basename($cfg);
+ print "cfg=...$cfg...\nbn=...$bn...\n";
+ open(CFGFILE, ">$tmp/etc/texmf/updmap.d/$priority$bn") ||
+ error("Cannot open $tmp/etc/texmf/updmap.d/$priority$bn for writing!");
+ print CFGFILE <<EOF;
+# $priority$bn
+# 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
+ open(FOO,"<$cfg") || error("Cannot open $cfg for reading!");
+ while (<FOO>) { print CFGFILE $_; }
+ close(FOO);
+ close(CFGFILE);
+ $bn =~ s/\.cfg$//;
+ push @listlines, "$priority$bn";
+ }
+ #
+ # now debian/package.maps and/or debian/maps
+ #
+ if ($pkgfilepresent) {
+ # here we rely on $pkgfileext either being "" or being "2"
+ open(CFGFILE, ">$tmp/etc/texmf/updmap.d/$priority$package$pkgfileext.cfg") ||
+ error("Cannot open $tmp/etc/texmf/updmap.d/$priority$package$pkgfileext.cfg for writing!");
+ print CFGFILE <<EOF;
+# $priority$package$pkgfileext.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
+ foreach (@pkgcfg) {
+ print CFGFILE "$_";
+ }
+ close(CFGFILE);
+ push @listlines, "$priority$package$pkgfileext";
+ }
+ #
+ # finally do the cmdline maps
+ #
+ if ($#cmdlinemaps >= 0) {
+ $pkgfileext++;
+ open(CFGFILE, ">$tmp/etc/texmf/updmap.d/$priority$package$pkgfileext.cfg") ||
+ error("Cannot open $tmp/etc/texmf/updmap.d/$priority$package$pkgfileext.cfg for writing!");
+ print CFGFILE <<EOF;
+# $priority$package$pkgfileext.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
+ foreach (@cmdlinemaps) {
+ print CFGFILE "$_\n";
+ }
+ close(CFGFILE);
+ push @listlines, "$priority$package$pkgfileext";
+ }
+
+
+ if ( ! -d "$tmp/var/lib/tex-common/fontmap-cfg/") {
+ doit("install","-d","$tmp/var/lib/tex-common/fontmap-cfg/");
+ }
+ open(LISTFILE, ">$tmp/var/lib/tex-common/fontmap-cfg/$package.list")||
+ error("Cannot open $tmp/var/lib/tex-common/fmtutil-cnf/$package.list for writing!");
+ foreach (@listlines) {
+ print LISTFILE "$_\n";
+ }
+ close(LISTFILE);
+
+ autoscript($package, "postinst", "postinst-texfonts", "");
+ autoscript($package, "postrm", "postrm-texfonts", "");
+
+ addsubstvar($package, "misc:Depends", "tex-common", ">= 0.7");
+}
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+=head1 AUTHOR
+
+Norbert Preining <preining at logic.at>
+
+=cut
Copied: tex-common/trunk/scripts/postinst-texfonts (from rev 242, dh-installtexfonts/trunk/postinst-texfonts)
Copied: tex-common/trunk/scripts/postrm-texfonts (from rev 242, dh-installtexfonts/trunk/postrm-texfonts)
More information about the Pkg-tetex-commits
mailing list