slackbuilds/UNUSED/fonts/cantarell-fonts/SlackBuild

76 lines
2.3 KiB
Text
Raw Normal View History

2011-02-09 16:16:25 +01:00
#!/bin/sh
PRGNAM=$(basename $(pwd))
VERSION=0.0.1
ARCH=noarch
BUILD=${BUILD:-1}
2020-06-25 11:23:11 +02:00
TAG=${TAG:-gwh}
2011-02-09 16:16:25 +01:00
CWD=$(pwd)
# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
2011-03-07 06:05:41 +01:00
TMP=${TMP:=/tmp/$TAG}
PKG=$TMP/pkg-$PRGNAM
2011-02-09 16:16:25 +01:00
OUTPUT=${OUTPUT:-/tmp}
# Create working directories:
mkdir -p $OUTPUT # place for the package to be saved
mkdir -p $PKG # place for the package to be built
rm -rf $PKG/* # always erase old package's contents
2020-07-12 09:22:26 +02:00
rm -rf $OUTPUT/{configure,make,install,error,/sbin/makepkg}-$PRGNAM.log
2011-02-09 16:16:25 +01:00
# remove old log files
FONTDIR="/usr/share/fonts/OTF"
# Move the fonts into place:
mkdir -p $PKG$FONTDIR $PKG/usr/doc/
( cd $PKG$FONTDIR/
[ ! -e $CWD/$PRGNAM-$VERSION.tar.bz2 ] && wget -c http://ftp.acc.umu.se/pub/gnome/sources/$PRGNAM/$(echo "$VERSION" | cut -d. -f 1,2)/$PRGNAM-$VERSION.tar.bz2 -O $CWD/$PRGNAM-$VERSION.tar.bz2
tar xf $CWD/$PRGNAM-$VERSION.tar.bz2
find $PRGNAM-$VERSION/ -type f -name "*.?TF" -o -name "*.?tf" -exec mv {} . \;
find $PRGNAM-$VERSION/ -name Makefile\* -exec rm {} \;
rm -fr $PRGNAM-$VERSION/{src/,aclocal.m4,configure*,missing,otf/,install-sh}
mv $PRGNAM-$VERSION $PKG/usr/doc/
# find . -type d -exec rm -r {} \;
)
# Post-install script:
mkdir -p $PKG/install
cat <<EOT > $PKG/install/doinst.sh
# Update X font indexes and the font cache:
2013-09-25 10:21:30 +02:00
if [ -x ./usr/bin/mkfontdir ]; then
chroot . /usr/bin/mkfontscale $FONTDIR
chroot . /usr/bin/mkfontdir $FONTDIR
2011-02-09 16:16:25 +01:00
fi
2013-09-25 10:21:30 +02:00
if [ -x ./usr/bin/fc-cache ]; then
chroot . /usr/bin/fc-cache -f $FONTDIR
2011-02-09 16:16:25 +01:00
fi
EOT
# Add a package description:
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (Gnome 3 font)
$PRGNAM:
$PRGNAM: The Cantarell font family is a contemporary Humanist sans serif
$PRGNAM: designed for on-screen reading.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://live.gnome.org/CantarellFonts
$PRGNAM:
EOF
# Build the package:
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
2020-07-12 09:22:26 +02:00
/sbin/makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz 2>&1 | tee $OUTPUT//sbin/makepkg-${PRGNAM}.log
2011-02-09 16:16:25 +01:00
cd $OUTPUT
md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz.md5
cd -
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt