Re: Font packages for teTeX
Norbert Preining <preining@logic.at> writes:
> Could you send me your current script. We could also set up some cvs or
> put it somewhere where you have cvs/svn/arch write permissions (and me
> too) and maybe we can work out something nice. I would really like to
> see this.
Sure, I wanted to wait till I get X11 integration done, but see the
attachment. Main changes are the texmf/doc -> doc/texmf change and using
cat instead of echo for longer files. Looks cleaner to me. ;-)
Concerning cvs/svn/arch: Frank just suggested to use the svn for tetex,
which would be fine with me. Guess I would have to register on
alioth.debian.org then, right?
cheerio
ralf
#!/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
Reply to: