slackbuilds/fonts/bitmap-fonts/SlackBuild

92 lines
2.4 KiB
Text
Raw Normal View History

2023-02-15 10:46:20 +01:00
#!/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=/var/cache/SlackBuilds.gwh/$PRGNAM
2023-02-15 10:46:20 +01:00
# 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)
2023-03-23 09:54:21 +01:00
VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)"
2023-02-15 10:46:20 +01:00
;;
latest)
2024-05-27 07:53:51 +02:00
VERSION=$(git tag --sort=-version:refname | head -n1)
2023-02-15 10:46:20 +01:00
git checkout "$VERSION"
;;
*)
git checkout "$VERSION"
;;
esac
2024-11-28 13:12:22 +01:00
mkdir -p "$PKG/usr/share/fonts/bitmap/"
find "$REPOSITORY/bitmap/" -type f -name \*f -exec cp {} "$PKG/usr/share/fonts/bitmap/" \;
find "$PKG/usr/share/fonts/bitmap/" -name \*f -exec gzip -9 {} \;
find "$REPOSITORY/bitmap/" -type f -name \*.gz -exec cp {} "$PKG/usr/share/fonts/bitmap/" \;
2023-02-15 10:46:20 +01:00
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------------------------------------------------------|
2023-02-15 10:55:15 +01:00
$PRGNAM: $PRGNAM (bitmap fonts collection)
2023-02-15 10:46:20 +01:00
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
2023-02-15 10:55:15 +01:00
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/Tecate/bitmap-fonts
2023-02-15 10:46:20 +01:00
$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
2023-08-16 12:23:26 +02:00
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-$VERSION-noarch-$BUILD$TAG.txz"