67 lines
1.7 KiB
Bash
Executable file
67 lines
1.7 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
CWD=$(pwd)
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
VERSION=${VERSION:-$(date +%Y.%m.%d_%H.%M)}
|
|
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
|
|
|
|
TTFDIR=/usr/share/fonts/TTF
|
|
OTFDIR=/usr/share/fonts/OTF
|
|
|
|
# Move the fonts into place:
|
|
mkdir -p $PKG$OTFDIR $PKG$TTFDIR $PKG/usr/doc/$PRGNAM
|
|
cd $PKG$TTFDIR/
|
|
|
|
for i in Aegean600.zip Aegyptus313.zip Gardiner313.zip Symbola605.zip Alfios.zip Aroania.zip Alexander.zip Anaktoria.zip Avdira.zip Atavyros.zip Analecta306.zip Musica306.zip Akkadian256.zip Anatolian306.zip Maya106.zip Unidings605.zip; do
|
|
[ ! -e $CWD/$i ] && wget -c http://users.teilar.gr/~g1951d/$i -O $CWD/$i
|
|
unzip -o $CWD/$i
|
|
done
|
|
find . -type f -iname \*.otf -exec mv {} $PKG$OTFDIR \;
|
|
find . -type f -not -iname \*.ttf -exec mv {} $PKG/usr/doc/$PRGNAM \;
|
|
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 .$XPREF/bin/mkfontdir ]; then
|
|
chroot . $XPREF/bin/mkfontscale $TTFDIR
|
|
chroot . $XPREF/bin/mkfontdir $TTFDIR
|
|
fi
|
|
if [ -x .$XPREF/bin/fc-cache ]; then
|
|
chroot . $XPREF/bin/fc-cache -f $TTFDIR
|
|
fi
|
|
EOT
|
|
|
|
# Add a package description:
|
|
mkdir -p $PKG/install
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
$PRGNAM: $PRGNAM (Unicode Fonts for Ancient Scripts)
|
|
$PRGNAM:
|
|
$PRGNAM: As recommended @
|
|
$PRGNAM: http://98.245.80.27/tcpc/OSCON2011/gbu/gbu.html
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: http://users.teilar.gr/~g1951d/
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
# Build the package:
|
|
cd $PKG
|
|
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz
|