[subversion-commit] SVN tetex commit + diffs: r232 - / dh-installtexfonts dh-installtexfonts/trunk dh-installtexfonts/trunk/debian

Norbert Preining preining-guest at costa.debian.org
Sat Oct 15 21:56:07 UTC 2005


Author: preining-guest
Date: 2005-10-15 21:56:06 +0000 (Sat, 15 Oct 2005)
New Revision: 232

Added:
   dh-installtexfonts/
   dh-installtexfonts/tags/
   dh-installtexfonts/trunk/
   dh-installtexfonts/trunk/debian/
   dh-installtexfonts/trunk/debian/changelog
   dh-installtexfonts/trunk/debian/compat
   dh-installtexfonts/trunk/debian/control
   dh-installtexfonts/trunk/debian/copyright
   dh-installtexfonts/trunk/debian/install
   dh-installtexfonts/trunk/debian/manpages
   dh-installtexfonts/trunk/debian/rules
   dh-installtexfonts/trunk/dh_installtexfonts
   dh-installtexfonts/trunk/postinst-texfonts
   dh-installtexfonts/trunk/postrm-texfonts
Log:
[svn-inject] Installing original source of dh-installtexfonts

Added: dh-installtexfonts/trunk/debian/changelog
===================================================================
--- dh-installtexfonts/trunk/debian/changelog	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/debian/changelog	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,5 @@
+dh-installtexfonts (0.1) unstable; urgency=low
+
+  * initial release
+
+ -- Norbert Preining <preining at logic.at>  Sat, 15 Oct 2005 23:42:26 +0200

Added: dh-installtexfonts/trunk/debian/compat
===================================================================
--- dh-installtexfonts/trunk/debian/compat	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/debian/compat	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1 @@
+4

Added: dh-installtexfonts/trunk/debian/control
===================================================================
--- dh-installtexfonts/trunk/debian/control	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/debian/control	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,15 @@
+Source: dh-installtexfonts
+Section: devel
+Priority: optional
+Maintainer: Norbert Preining <preining at logic.at>
+Build-Depends-Indep: debhelper (>= 4.1.16), cdbs, perl5
+Standards-Version: 3.6.2
+
+Package: dh-installtexfonts
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, debhelper (>= 4.0), ${perl:Depends}
+Enhances: debhelper
+Description: Debhelper to install fonts for TeX
+ This debhelper addon is intented to be used for font installation for TeX
+ system according to the TeX Policy. It automates the the generation of the
+ necessary config files for map installation and management.

Added: dh-installtexfonts/trunk/debian/copyright
===================================================================
--- dh-installtexfonts/trunk/debian/copyright	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/debian/copyright	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,23 @@
+This is dh-installtexfonts, written by Norbert Preining <preining at logic.at>.
+
+Copyright (C) 2005  Norbert Preining
+
+License:
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this package; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.

Added: dh-installtexfonts/trunk/debian/install
===================================================================
--- dh-installtexfonts/trunk/debian/install	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/debian/install	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,3 @@
+dh_installtexfonts /usr/bin
+postrm-* usr/share/debhelper/autoscripts
+postinst-* usr/share/debhelper/autoscripts

Added: dh-installtexfonts/trunk/debian/manpages
===================================================================
--- dh-installtexfonts/trunk/debian/manpages	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/debian/manpages	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1 @@
+dh_installtexfonts.1

Added: dh-installtexfonts/trunk/debian/rules
===================================================================
--- dh-installtexfonts/trunk/debian/rules	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/debian/rules	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+
+dh_installtexfonts.1: dh_installtexfonts
+	pod2man dh_installtexfonts > dh_installtexfonts.1
+
+build/dh-installtexfonts:: dh_installtexfonts.1


Property changes on: dh-installtexfonts/trunk/debian/rules
___________________________________________________________________
Name: svn:executable
   + 

Added: dh-installtexfonts/trunk/dh_installtexfonts
===================================================================
--- dh-installtexfonts/trunk/dh_installtexfonts	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/dh_installtexfonts	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,96 @@
+#!/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>>]
+
+=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.7) so that the
+update-* commands are available. (This program adds that dependency to
+${misc:Depends}.)
+
+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 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 @maps;
+	if ($file) {
+		open(FOO, "<$file") || error("$file cannot be opened.");
+		@maps = <FOO>;
+		close(FOO);
+		chomp @maps;
+	}
+	if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
+		push @maps, @ARGV;
+	}
+
+
+        if ( ! -d "$tmp/etc/texmf/updmap.d/") {
+            doit("install","-d","$tmp/etc/texmf/updmap.d/");
+        }
+	open(CFGFILE, ">$tmp/etc/texmf/updmap.d/50$package.cfg") || 
+		error("Cannot open $tmp/etc/texmf/updmap.d/10$package.cfg for writing!");
+	print CFGFILE <<EOF;
+# 50$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
+	foreach (@maps) {
+		print CFGFILE "Map $_\n";
+	}
+	close(CFGFILE);
+        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!");
+	print LISTFILE "50$package";
+	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)>
+
+This program is till now not a part of debhelper.
+
+=head1 AUTHOR
+
+Norbert Preining <preining at logic.at>
+
+=cut


Property changes on: dh-installtexfonts/trunk/dh_installtexfonts
___________________________________________________________________
Name: svn:executable
   + 

Added: dh-installtexfonts/trunk/postinst-texfonts
===================================================================
--- dh-installtexfonts/trunk/postinst-texfonts	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/postinst-texfonts	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,38 @@
+
+update_fontmaps()
+{
+    update-updmap --quiet
+    # mktexlsr is recommended now because updmap-sys relies heavily on
+    # Kpathsea to locate updmap.cfg and the map files. Also, it is slightly
+    # better not to specify a particular directory to refresh because
+    # updmap.cfg is typically found in $TEXMFSYSVAR while the map files are in
+    # $TEXMFMAIN.
+    # According to the Debian TeX policy, running mktexlsr and updmap-sys
+    # should work as long as tex-common is configured and these files are
+    # available (general Debian policy wouldn't assure that without this
+    # override from the Debian TeX policy).
+    if which mktexlsr >/dev/null; then mktexlsr; fi
+    if which updmap-sys >/dev/null; then
+        printf "Running updmap-sys... "
+        updmap-sys --quiet
+        echo "done."
+    fi
+
+    return 0
+}
+
+case "$1" in
+    configure)
+        update_fontmaps
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+        update_fontmaps
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+

Added: dh-installtexfonts/trunk/postrm-texfonts
===================================================================
--- dh-installtexfonts/trunk/postrm-texfonts	2005-10-15 21:00:01 UTC (rev 231)
+++ dh-installtexfonts/trunk/postrm-texfonts	2005-10-15 21:56:06 UTC (rev 232)
@@ -0,0 +1,87 @@
+
+tell_that_errors_are_ok()
+{
+    # Cheap option handling...
+    if [ "$1" = -n ]; then
+        prog="$2"
+        endwith=' '
+    else
+        prog="$1"
+        endwith='\n'
+    fi
+
+    # According to the Debian TeX policy, running mktexlsr and updmap-sys
+    # should work as long as tex-common is configured and these files are
+    # available (general Debian policy wouldn't assure that without this
+    # override from the Debian TeX policy).
+    printf "\
+Trying to run '$prog' (error messages can be ignored if tex-common
+is not configured)...$endwith"
+
+    return 0
+}
+
+# The function name is *try_to*_update_fontmaps because the following
+# scenario might happen:
+#    1. this package is deconfigured
+#    2. tex-common and tetex-bin are removed
+#    3. this package is removed or purged
+#
+# (cf. Policy § 6.5, step 2, about a conflicting package being removed due
+# to the installation of the package being discussed).
+#
+# In this case, update-updmap, mktexlsr and updmap-sys would all be gone once
+# tex-common and tetex-bin are removed, so we must append "|| true" to their
+# calls.
+try_to_update_fontmaps()
+{
+    # Don't print alarming error messages if the programs aren't even
+    # available.
+    if which update-updmap >/dev/null; then
+        tell_that_errors_are_ok -n update-updmap
+        update-updmap --quiet || true
+        echo "done."
+    fi
+    # mktexlsr is recommended now because updmap-sys relies heavily on
+    # Kpathsea to locate updmap.cfg and the map files. Also, it is slightly
+    # better not to specify a particular directory to refresh because
+    # updmap.cfg is typically found in $TEXMFSYSVAR while the map files are in
+    # $TEXMFMAIN.
+    if which mktexlsr >/dev/null; then
+        tell_that_errors_are_ok mktexlsr
+        mktexlsr || true
+        echo "done."
+    fi
+
+    if which updmap-sys >/dev/null; then
+        tell_that_errors_are_ok -n updmap-sys
+        updmap-sys --quiet || true
+        echo "done."
+    fi
+
+    return 0
+}
+
+case "$1" in
+    remove|disappear)
+        try_to_update_fontmaps
+    ;;
+
+    purge)
+        # Supposing updmap.cfg & Co are clean (which I think is a reasonable
+        # assumption), we don't need to call try_to_update_fontmaps().
+        # Calling it on remove _and_ on purge just for hypothetical users
+        # who would break their config before purging this package seems to
+        # be more annoying than useful (it takes a lot of time).
+    ;;
+
+    upgrade|failed-upgrade|abort-upgrade|abort-install)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+




More information about the Pkg-tetex-commits mailing list