2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2020-06-26 15:54:07 +02:00
|
|
|
|
|
|
|
# Slackware build script for fonts-opendyslexic
|
|
|
|
|
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
|
|
|
# Yes, I know, there are newer versions of this at github. However,
|
|
|
|
# they lack the compiled OpenDyslexicMono (terminal) font, and the tools
|
|
|
|
# required to compile the source would require me submitting 15 or 20
|
2021-08-02 21:25:50 +02:00
|
|
|
# python SlackBuilds for the tools and all their deps. Not interested.
|
2020-06-26 15:54:07 +02:00
|
|
|
|
|
|
|
# The Debian package only includes the .otf fonts. That's what I'll do
|
|
|
|
# by default, but I'll support installing the other types if needed.
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2020-06-26 15:54:07 +02:00
|
|
|
PRGNAM=fonts-opendyslexic
|
|
|
|
VERSION=${VERSION:-20160623}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2020-06-26 15:54:07 +02:00
|
|
|
|
|
|
|
SRCDIR=open-dyslexic-$VERSION-Stable
|
|
|
|
|
|
|
|
ARCH=noarch
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-06-26 15:54:07 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $SRCDIR
|
|
|
|
tar xvf $CWD/${PRGNAM}_$VERSION.orig.tar.gz
|
|
|
|
cd $SRCDIR
|
|
|
|
chown -R root:root .
|
|
|
|
# rotten upstream perms, do not revert to template please.
|
|
|
|
find . -type d -exec chmod 755 {} \+
|
|
|
|
find . -type f -exec chmod 644 {} \+
|
|
|
|
|
|
|
|
# See README
|
|
|
|
FORMATS="$( echo ${FORMATS:-otf} | tr A-Z a-z )"
|
|
|
|
ALLFMT="otf ttf eot woff svg"
|
|
|
|
[ "$FORMATS" = "all" ] && FORMATS="$ALLFMT"
|
|
|
|
|
|
|
|
for i in $FORMATS; do
|
|
|
|
ok=0
|
|
|
|
for j in $ALLFMT; do
|
|
|
|
[ "$i" = "$j" ] && ok=1
|
|
|
|
done
|
|
|
|
if [ "$ok" != "1" ]; then
|
|
|
|
cat <<EOF
|
|
|
|
***
|
|
|
|
*** Unsupported font format '$i'. Supported formats are: $ALLFMT all
|
|
|
|
***
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/fonts
|
|
|
|
for fmt in $FORMATS; do
|
|
|
|
FMT=$( echo $fmt | tr a-z A-Z )
|
|
|
|
cp -a $fmt $PKG/usr/share/fonts/$FMT
|
|
|
|
[ "$FMT" = "TTF" -o "$FMT" = "OTF" ] && MKFDIRS+="$FMT "
|
|
|
|
DESCFMT+=" $FMT"
|
|
|
|
done
|
|
|
|
|
|
|
|
# I thought about including screenshots/ in the doc dir, but they're
|
|
|
|
# more like an advertisement (anyone building this package has already
|
|
|
|
# "bought" the product).
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a README* $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
|
|
|
sed "s,@DESCFMT@,$DESCFMT," $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
# Only install doinst.sh if TTF and/or OTF fonts are included, because
|
|
|
|
# fc-cache and X only know about these 2 types.
|
|
|
|
if [ -n "$MKFDIRS" ]; then
|
|
|
|
sed "s,@MKFDIRS@,$MKFDIRS," $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|