slackbuilds/fonts/ultimate_oldschool_pc_font_pack/SlackBuild
2018-04-20 23:02:35 +02:00

65 lines
1.6 KiB
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-1.0}
ARCH=noarch
BUILD=${BUILD:-1}
TAG=${TAG:-cyco}
# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
TMP=${TMP:=/tmp/$TAG}
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
# Create working directories:
rm -rf $PKG
mkdir -p $OUTPUT
mkdir -p $PKG
FONTDIR=/usr/share/fonts/TTF
# Move the fonts into place:
mkdir -p $PKG$FONTDIR $PKG/usr/doc/$PRGNAM
cd $PKG$FONTDIR/
[ ! -e $CWD/${PRGNAM}_v$VERSION.zip ] && wget -c http://int10h.org/oldschool-pc-fonts/download/${PRGNAM}_v$VERSION.zip -O $CWD/${PRGNAM}_v$VERSION.zip
unzip -o $CWD/${PRGNAM}_v$VERSION.zip
mv LICENSE.TXT README.NFO $PKG/usr/doc/$PRGNAM
find . -type d -maxdepth 1 -name \*437\* -exec rm -r {} \;
find . -iname \*.ttf -exec mv {} . \;
find . -type d -maxdepth 1 -name Px\* -exec rm -r {} \;
# Post-install script:
mkdir -p $PKG/install
cat <<EOT > $PKG/install/doinst.sh
# Update X font indexes and the font cache:
if [ -x ./usr/bin/mkfontdir ]; then
chroot . /usr/bin/mkfontscale $FONTDIR
chroot . /usr/bin/mkfontdir $FONTDIR
fi
if [ -x ./usr/bin/fc-cache ]; then
chroot . /usr/bin/fc-cache -f $FONTDIR
fi
EOT
# Add a package description:
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (The Ultimate Oldschool PC Font Pack)
$PRGNAM:
$PRGNAM: "Old School" fonts
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://int10h.org/oldschool-pc-fonts/
$PRGNAM:
EOF
# Build the package:
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz