slackbuilds/fonts/exljbris/exljbris.SlackBuild
2011-03-07 12:05:41 +07:00

73 lines
1.9 KiB
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
ARCH=font
BUILD=${BUILD:-1}
TAG=${TAG:-cyco}
# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
TAG=cyco
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
# Create working directories:
mkdir -p $OUTPUT # place for the package to be saved
[ -e $PKG ] && rm -fr $PKG
mkdir -p $PKG # place for the package to be built
rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log
# remove old log files
FONTDIR="/usr/share/fonts"
# Move the fonts into place:
mkdir -p $PKG$FONTDIR/{TTF,OTF}
mkdir -p $PKG/usr/doc/$PRGNAM
for f in fontin2_pc.zip FontinSans_49.zip tallys_15b2.zip delicious-123.zip Diavlo_II_37b2.zip ; do
[ ! -e $CWD/$f ] && wget -c http://www.exljbris.com/dl/$f -O $CWD/$f
unzip -jo $CWD/$f
mv *.ttf $PKG$FONTDIR/TTF
mv *.otf $PKG$FONTDIR/OTF
mv *.txt $PKG/usr/doc/$PRGNAM
done
[ ! -e $CWD/eula.html ] && wget -c http://www.josbuivenga.demon.nl/eula.html -O $CWD/eula.html
cp $CWD/eula.html $PKG/usr/doc/$PRGNAM
# Post-install script:
mkdir -p $PKG/install
cat <<EOT > $PKG/install/doinst.sh
# Update X font indexes and the font cache:
if [ -x .$XPREF/bin/mkfontdir ]; then
chroot . $XPREF/bin/mkfontscale $FONTDIR
chroot . $XPREF/bin/mkfontdir $FONTDIR
fi
if [ -x .$XPREF/bin/fc-cache ]; then
chroot . $XPREF/bin/fc-cache -f $FONTDIR
fi
EOT
# Add a package description:
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (exljbris Font Foundry's free fonts)
$PRGNAM:
$PRGNAM: http://www.josbuivenga.demon.nl/
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: By downloading this font, you agree to the font license agreement
$PRGNAM: for free fonts:
$PRGNAM: http://www.josbuivenga.demon.nl/eula.html
$PRGNAM:
EOF
# Build the package:
cd $PKG
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz