[subversion-commit] SVN tetex commit + diffs: r156 - tex-common/trunk/scripts

Norbert Preining preining-guest at costa.debian.org
Tue Aug 23 13:28:53 UTC 2005


Author: preining-guest
Date: 2005-08-23 13:28:49 +0000 (Tue, 23 Aug 2005)
New Revision: 156

Added:
   tex-common/trunk/scripts/mk-tex-fontpack
Log:
Check in of the current mk-tex-fontpack


Added: tex-common/trunk/scripts/mk-tex-fontpack
===================================================================
--- tex-common/trunk/scripts/mk-tex-fontpack	2005-08-23 13:08:59 UTC (rev 155)
+++ tex-common/trunk/scripts/mk-tex-fontpack	2005-08-23 13:28:49 UTC (rev 156)
@@ -0,0 +1,158 @@
+#!/bin/bash
+#
+# mk-tex-fontpack
+#
+# generate a debian package of a font pack, i.e. from a TDS 1.1 compliant tree
+# of fonts
+#
+# (C) 2005 Norbert Preining
+# GPL
+#
+
+if [ "$DEBFULLNAME" ] ; then
+    name=$DEBFULLNAME
+else
+    name=`awk -F : "/$LOGNAME/ {print \$5}" /etc/passwd`
+fi
+
+if [ "$DEBEMAIL" ] ; then
+    email=$DEBEMAIL
+else
+    email="$LOGNAME@`hostname`"
+fi
+
+shopt -s nullglob
+
+usage() {
+    echo "usage: `basename $0` [-r n] tds-dir packname"
+}
+
+revision=1
+
+if [ "X$1" = "X-r" ] ; then
+    shift
+    revision=$1
+    shift
+fi
+
+tdsdir=`echo $1 | sed  "s|/$||"` 
+packname="tex-fontpack-$2"
+
+if [ "X$tdsdir" = "X" -o "X$2" = "X" ] ; then
+	usage
+	exit 1
+fi
+
+
+tmpdir=`mktemp -d`
+mkdir -p $tmpdir/debian/$packname/usr/share/texmf
+
+mapfiles=""
+for f in `find $tdsdir -type f` ; do
+    case $f in
+      $tdsdir/fonts/map/*)
+      		nn=`echo $f | sed -e "s|$tdsdir/fonts|/etc/texmf|"`
+		mkdir -p `dirname "$tmpdir/debian/$packname/$nn"`
+		cp -p $f `dirname "$tmpdir/debian/$packname/$nn"`
+		mapfiles="$mapfiles `basename $f`"
+		;;
+      $tdsdir/doc/*)
+      		nn=`echo $f | sed -e "s|$tdsdir/doc|/usr/share/doc/texmf|"`
+		mkdir -p `dirname "$tmpdir/debian/$packname/$nn"`
+		cp -p $f `dirname "$tmpdir/debian/$packname/$nn"`
+		;;
+      *)
+      		nn=`echo $f | sed -e "s|$tdsdir|/usr/share/texmf|"`
+		mkdir -p `dirname "$tmpdir/debian/$packname/$nn"`
+		cp -p $f `dirname "$tmpdir/debian/$packname/$nn"`
+		;;
+    esac
+done
+
+# configure map files for Debian
+if [ ! "X$mapfiles" = "X" ] ; then
+    mkdir -p $tmpdir/debian/$packname/etc/texmf/updmap.d
+    cat > $tmpdir/debian/$packname/etc/texmf/updmap.d/50$packname.cfg <<EOF 
+#
+# 50$packname.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
+
+    for m in $mapfiles ; do
+        echo "Map $m" >> $tmpdir/debian/$packname/etc/texmf/updmap.d/50$packname.cfg
+    done
+
+    mkdir -p $tmpdir/debian/$packname/var/lib/tex-common/fontmap-cfg
+    echo "50$packname" > $tmpdir/debian/$packname/var/lib/tex-common/fontmap-cfg/$packname.list 
+fi
+
+cat > $tmpdir/debian/copyright <<EOF
+This package was debianized by $name <$email> 
+on `date -R` with the help of `basename $0`.
+
+Most likely it contains commercial fonts which one is not allowed to 
+distribute.
+EOF
+
+cat > $tmpdir/debian/changelog <<EOF 
+$packname ($revision) unstable; urgency=low
+
+  * packed by `basename $0`
+
+ -- $name <$email>  `date -R`
+EOF
+
+echo "4" > $tmpdir/debian/compat 
+
+cat > $tmpdir/debian/control <<EOF
+Source: $packname
+Section: non-free/tex
+Priority: optional
+Maintainer: $name <$email>
+Standards-Version: 3.6.2.1
+
+Package: $packname
+Architecture: all
+Depends: tex-common, tetex-base | texlive-basic
+Description: Font Pack $2
+ This package provides the fonts from font pack $2.
+EOF
+
+cat > $tmpdir/debian/postinst <<EOF
+#!/bin/sh
+test -e /usr/bin/mktexlsr && mktexlsr /usr/share/texmf
+update-updmap --quiet
+updmap-sys
+exit 0
+EOF
+
+cat > $tmpdir/debian/postrm <<EOF
+#!/bin/sh
+test -e /usr/bin/mktexlsr && mktexlsr /usr/share/texmf
+if [ ! "X$1" = "Xupgrade" ] ; then
+        update-updmap --quiet
+	updmap-sys
+fi
+exit 0
+EOF
+
+echo "Changing to $tmpdir."
+cd $tmpdir
+fakeroot dh_testdir
+fakeroot dh_testroot
+fakeroot dh_installdocs
+fakeroot dh_installchangelogs
+fakeroot dh_compress
+fakeroot dh_fixperms
+fakeroot dh_installdeb
+fakeroot dh_gencontrol
+fakeroot dh_md5sums
+fakeroot dh_builddeb
+
+#rm -rf $tmpdir
+




More information about the Pkg-tetex-commits mailing list