slackbuilds/fonts/Meslo-Font/Meslo-Font.SlackBuild
Gwenhael Le Moine 60587a72f4 fix bad path
2013-09-25 10:21:30 +02:00

65 lines
1.7 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-DZ-$VERSION.zip ] && wget --no-check-certificate -c "https://github.com/downloads/andreberg/Meslo-Font/Meslo%20LG%20DZ%20v$VERSION.zip" -O $CWD/$PRGNAM-DZ-$VERSION.zip
unzip $CWD/$PRGNAM-DZ-$VERSION.zip
[ ! -e $CWD/$PRGNAM-$VERSION.zip ] && wget --no-check-certificate -c "https://github.com/downloads/andreberg/Meslo-Font/Meslo%20LG%20v$VERSION.zip" -O $CWD/$PRGNAM-$VERSION.zip
unzip $CWD/$PRGNAM-$VERSION.zip
find . -type f -not -iname \*.ttf -exec mv {} $PKG/usr/doc/$PRGNAM \;
find . -type f -iname \*.ttf -exec mv {} . \;
find . -type d -delete
# 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 (monospace font)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/andreberg/Meslo-Font
$PRGNAM:
EOF
# Build the package:
cd $PKG
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz