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

Re: Font packages for teTeX (was: Error upgrading tetex-extra (experimental))



Hi all!

On Don, 18 Aug 2005, Norbert Preining wrote:
> structure. I have created a `reference' implementation of a fontpack, ok
> it does not include, copyright statements documentation, examples
> blabla, but all the files necessary for setting up a decent font pack.

Ok, I have written a stupid script for those desperate ones. It is
attached. It generates a .deb from a TDS-conform subtree of the fonts.

Eg: I have a directory
	/usr/TeX/font-collection/mtpro/
which contains direcories fonts, afm, tfm, ..., CTAN conform, as I said.

I can call
	mk-tex-fontpack /usr/TeX/font-collection/mtpro mtpro
and I will get a debian package
	/tmp/tex-fontpack-mtpro_1_all.deb
which does more or less all necessary to register the fonts in a TeX
system (teTeX 3.0 or texlive).

Please don't kill me for this horrible script, I did it for myself in 5
minutes, but if someone wants to expand it to a decent script, here is
the skeleton!

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining AT logic DOT at>             Università di Siena
sip:preining@at43.tuwien.ac.at                             +43 (0) 59966-690018
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
And wow! Hey! What's this thing coming towards me very
fast? Very very fast. So big and flat and round, it needs a
big wide sounding word like... ow... ound... round...
ground! That's it! That's a good name - ground!
I wonder if it will be friends with me?
                 --- For the sperm whale, it wasn't.
                 --- Douglas Adams, The Hitchhikers Guide to the Galaxy
#!/bin/bash
#
# mk-tex-fontpack
#
# generate a debian package of a font pack, i.e. from a TDS compliant tree
# of fonts
#
# (C) 2005 Norbert Preining
# GPL
#

name="Norbert Preining"
email="preining@logic.at"

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="$1"
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 $f `dirname "$tmpdir/debian/$packname/$nn"`
		mapfiles="$mapfiles `basename $f`"
		;;
      *)
      		nn=`echo $f | sed -e "s|$tdsdir|/usr/share/texmf|"`
		mkdir -p `dirname "$tmpdir/debian/$packname/$nn"`
		cp $f `dirname "$tmpdir/debian/$packname/$nn"`
		;;
    esac
done

mkdir -p $tmpdir/debian/$packname/etc/texmf/updmap.d
if [ ! "X$mapfiles" = "X" ] ; then
    echo "#
#
# 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 -_-
#" > $tmpdir/debian/$packname/etc/texmf/updmap.d/50$packname.cfg
fi
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

echo -e "$packname ($revision) unstable; urgency=low

  * packed by `basename $0`

 -- $name <$email>  `date -R`" > $tmpdir/debian/changelog

echo "4" > $tmpdir/debian/compat

echo -e "Source: $packname
Section: 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." > $tmpdir/debian/control

echo -e "#!/bin/sh\ntest -e /usr/bin/mktexlsr && mktexlsr\nupdate-updmap --quiet\nupdmap-sys\nexit 0" > $tmpdir/debian/postinst

echo -e '#!/bin/sh
test -e /usr/bin/mktexlsr && mktexlsr
if [ ! "X$1" = "Xupgrade" ] ; then
        update-updmap --quiet
	updmap-sys
fi
exit 0
' > $tmpdir/debian/postrm

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


Reply to: