From 1872c82de89b1a2597c41abe56b85881b334b4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Fri, 28 Jun 2019 17:32:19 +0200 Subject: [PATCH] New package: grub-terminus-0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Buchmüller --- .../files/grub-terminus.template | 32 +++++++++++++++++++ srcpkgs/grub-terminus/template | 25 +++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 srcpkgs/grub-terminus/files/grub-terminus.template create mode 100644 srcpkgs/grub-terminus/template diff --git a/srcpkgs/grub-terminus/files/grub-terminus.template b/srcpkgs/grub-terminus/files/grub-terminus.template new file mode 100644 index 00000000000..e6b75e34ffc --- /dev/null +++ b/srcpkgs/grub-terminus/files/grub-terminus.template @@ -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.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 " + 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." diff --git a/srcpkgs/grub-terminus/template b/srcpkgs/grub-terminus/template new file mode 100644 index 00000000000..5f53c77384d --- /dev/null +++ b/srcpkgs/grub-terminus/template @@ -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 " +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 +}