New package: grub-terminus-0.2

Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
This commit is contained in:
Jürgen Buchmüller 2019-06-28 17:32:19 +02:00
parent a6af639942
commit 1872c82de8
No known key found for this signature in database
GPG Key ID: DE55AD8DBEBB4EE8
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,32 @@
#!/bin/sh
#
# Helper script to add or modify the /etc/default/grub
# line starting with GRUB_FONT to use one of the
# /boot/grub/fonts/terminus<size>.pf2 files.
#
if [ "$(id -r -u)" -ne 0 ]; then
echo "$0 needs to be run as root."
exit 1
fi
if [ $# -ne 1 ]; then
echo "Usage: grub-terminus <size>"
echo "Where size is one of: @sizes@"
exit 1
fi
if ! [ -e /etc/default/grub ]; then
echo "Did not find /etc/default/grub to modify."
exit 1
fi
font=/boot/grub/fonts/terminus${1}.pf2
if ! [ -e ${font} ]; then
echo "Font ${font} does not exist."
exit 1
fi
grep -v "^GRUB_FONT=" /etc/default/grub > /tmp/grub.$$
echo "GRUB_FONT=${font}" >> /tmp/grub.$$
cp -p /etc/default/grub /etc/default/grub.orig
mv /tmp/grub.$$ /etc/default/grub
echo "Changed font to ${font}."
echo "You may now run update-grub."

View File

@ -0,0 +1,25 @@
# Template file for 'grub-terminus'
pkgname=grub-terminus
version=0.2
revision=1
archs=noarch
hostmakedepends="grub-utils terminus-font"
short_desc="Terminus bold fonts for GRUB"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="Public Domain"
homepage="https://voidlinux.org"
do_install() {
local _sizes="12 14 16 18 20 22 24 28 32"
vmkdir boot/grub/fonts
for s in ${_sizes}; do
msg_normal "Converting Terminus Bold ${s} font...\n"
grub-mkfont -o ${DESTDIR}/boot/grub/fonts/terminus${s}.pf2 \
--verbose /usr/share/fonts/X11/misc/ter-x${s}b.pcf.gz
done
vmkdir usr/bin
sed ${FILESDIR}/grub-terminus.template \
-e "s;@sizes@;${_sizes};" \
> ${DESTDIR}/usr/bin/grub-terminus
chmod o+x ${DESTDIR}/usr/bin/grub-terminus
}