#!/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 $(curl http://users.teilar.gr/~g1951d/ | iconv -f utf-16 -t utf-8 | grep -o "[A-Za-z0-9]*\.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 < $PKG/install/doinst.sh # Update X font indexes and the font cache: if [ -x ./usr/bin/mkfontdir ]; then chroot . /usr/bin/mkfontscale $TTFDIR chroot . /usr/bin/mkfontdir $TTFDIR fi if [ -x ./usr/bin/fc-cache ]; then chroot . /usr/bin/fc-cache -f $TTFDIR fi EOT # Add a package description: mkdir -p $PKG/install cat < $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