mirror of
https://codeberg.org/gwh/slackbuilds.git
synced 2024-11-16 19:51:19 +01:00
60 lines
1.3 KiB
Bash
Executable file
60 lines
1.3 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
|
|
|
|
FONTDIR=/usr/share/fonts/TTF
|
|
|
|
# Move the fonts into place:
|
|
mkdir -p $PKG$FONTDIR
|
|
cd $PKG$FONTDIR/
|
|
[ ! -e $CWD/helvetica.zip ] && wget -c http://mirrored.spockz.nl/file/fonts/helvetica/helvetica.zip -O $CWD/helvetica.zip
|
|
unzip $CWD/helvetica.zip
|
|
|
|
# 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 (font)
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: http://en.wikipedia.org/wiki/Helvetica
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
# Build the package:
|
|
cd $PKG
|
|
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz
|