[bitmap-fonts] added

This commit is contained in:
Gwenhael Le Moine 2023-02-15 10:46:20 +01:00
parent 3c6f6381cc
commit 6d6c79d9c2
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

88
fonts/bitmap-fonts/SlackBuild Executable file
View file

@ -0,0 +1,88 @@
#!/bin/bash
cd "$(dirname "$0")" || exit 1
CWD=$(pwd)
PRGNAM=$(basename "$CWD")
GITHUB_REPO=Tecate/bitmap-fonts
#VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/releases/latest | jq -r .tag_name)} # or VERSION=trunk
VERSION=${VERSION:-trunk}
BUILD=${BUILD:-1}
TAG=${TAG:-gwh}
TMP=${TMP:-/tmp/$TAG}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM
# nettoyage préalable
rm -fr "$PKG" "${TMP:?}/$PRGNAM"
mkdir -p "$PKG"
# mise en place
[ ! -e "$REPOSITORY" ] && git clone https://github.com/${GITHUB_REPO} "$REPOSITORY"
cd "$REPOSITORY" || exit 1
git reset --hard HEAD
git pull --all
cp -R "$REPOSITORY" "$TMP/"
cd "$TMP/$PRGNAM/" || exit 1
case $VERSION in
trunk)
VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)"
;;
latest)
VERSION=$(git describe --tags --abbrev=0)
git checkout "$VERSION"
;;
*)
git checkout "$VERSION"
;;
esac
mkdir -p "$PKG/usr/share/fonts/"
cp -avr "$REPOSITORY/bitmap/" "$PKG/usr/share/fonts/"
#chmod 0644 "$PKG/usr/share/fonts/*"
mkdir -p "$PKG/usr/doc/$PRGNAM/"
cp -avr "$REPOSITORY/README.md" "$REPOSITORY/screenshots/" "$PKG/usr/doc/$PRGNAM/"
mkdir -p "$PKG/install"
cat <<EOF > "$PKG/install/slack-desc"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (a clean fixed width font)
$PRGNAM:
$PRGNAM: OTB format addition to the official terminus-font package.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: Homepage: http://$PRGNAM.sourceforge.net
$PRGNAM: https://github.com/archlinux/svntogit-community/tree/packages/terminus-font-otb/trunk
$PRGNAM:
$PRGNAM:
EOF
cat <<EOF > "$PKG/install/doinst.sh"
#!/bin/sh
# Update the X font indexes:
if [ -x /usr/bin/mkfontdir -o -x /usr/X11R6/bin/mkfontdir ]; then
mkfontdir usr/share/fonts/bitmap 2> /dev/null
fi
if [ -x /usr/bin/fc-cache ]; then
/usr/bin/fc-cache -f 2> /dev/null
fi
EOF
cd "$PKG" || exit 1
/sbin/makepkg -l y -c n "$OUTPUT/$PRGNAM-$VERSION-noarch-$BUILD$TAG.txz"