#!/bin/sh set -e . /usr/share/debconf/confmodule archive=ttf_fonts.tar.gz db_get ttf-root-installer/dldir LOCALCOPY=$RET db_get ttf-root-installer/savedir SAVEDIR=${RET} case "$1" in configure) if test ! -f /var/cache/ttf-root-installer && \ test "x`echo $LOCALCOPY | tr [:upper:] [:lower:]`" != "xnone" ; then savdir=`pwd` tmpdir=`mktemp -d` cd $tmpdir if test -z $LOCALCOPY ; then # We need to download the tar-ball wget --continue --tries=1 --dns-timeout=10 \ --connect-timeout=5 --read-timeout=300 -q \ --directory-prefix . -c \ ftp://root.cern.ch/root/ttf/$archive else # Have the tar-ball already cp $LOCALCOPY/$archive . fi if test ! -f $archive ; then exit 1 fi # Unpack tar -tzf $archive | grep "\.ttf$" | sed 's,ttf/fonts/,,' \ | grep -v "symbol.ttf" > /var/cache/ttf-root-installer tar -xzf $archive mkdir -p @prefix@/share/root/fonts/ cd ttf/fonts/ for i in *.ttf ; do case $i in *symbol.ttf) ;; # ignore this one *) if grep $i /var/lib/ttf-root-installer/sha256sums | sha256sum -c ; then cp -a $i @prefix@/share/root/fonts/ else echo "Checksum mismatch for $i, aborting" exit 1 fi ;; esac done cp LICENSE \ @prefix@/share/doc/ttf-root-installer/LICENSE.fonts cd ../../ rm -rf ttf if test "x$SAVEDIR" != "x" ; then mkdir -p $SAVEDIR cp -a $archive $SAVEDIR/$archive fi rm -f $archive cd $savdir fi ;; abort-upgrade|abort-remove|abort-deconfigure) # Nothing to be done here ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0