diff options
Diffstat (limited to 'system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild')
-rw-r--r-- | system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild b/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild index 0058c3ab0e..bf44c7de08 100644 --- a/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild +++ b/system/oldschool-pc-fonts/oldschool-pc-fonts.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for oldschool-pc-fonts @@ -22,7 +22,16 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Now maintained by B. Watson <yalhcru@gmail.com> +# Now maintained by B. Watson <urchlay@slackware.uk> + +# 20230307 bkw: BUILD=2, add douninst.sh. + +# 20201207 bkw: +# - Update for v2.2. Enough changes that we can't build the old version with +# the modified script. +# - Include all upstream's documentation. +# - Include OTB fonts, now that they exist. +# - gzip the .psfu fonts. # 20180108 bkw: # - Take over maintenance. @@ -31,25 +40,32 @@ # - Add variables TTF and CONSOLE to control which fonts are installed. # - A bit of useful documentation in README_console.txt. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=oldschool-pc-fonts -VERSION=${VERSION:-1.0} +VERSION=${VERSION:-2.2} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} ARCH=noarch -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -set -eu +set -e -# There are 2 sets of fonts that can be installed: the TrueType ones -# and console ones converted from the .FON files. These 2 variables control -# which are installed: +# There are 2 sets of fonts that can be installed: the TrueType (and +# OTB, OpenType Bitmap) ones and console ones converted from the .FON +# files. These 2 variables control which are installed: -TTF=${TTF:-yes} # By default, TTF is installed +TTF=${TTF:-yes} # By default, TTF and OTB are installed CONSOLE=${CONSOLE:-yes} # By default, install console fonts if possible if [ "$CONSOLE" = "yes" ]; then @@ -60,8 +76,8 @@ if [ "$CONSOLE" = "yes" ]; then fi case "$TTF$CONSOLE" in - "yesyes") TYPE="TrueType and console fonts" ;; - "yesno") TYPE="TrueType fonts only" ;; + "yesyes") TYPE="TrueType/OTB and console fonts" ;; + "yesno") TYPE="TrueType/OTB fonts only" ;; "noyes") TYPE="console fonts only" ;; "nono") echo "!!! At least one of TTF or CONSOLE must be set to 'yes'" exit 1; ;; @@ -73,26 +89,25 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -unzip $CWD/ultimate_oldschool_pc_font_pack_v${VERSION}.zip -d $PRGNAM-$VERSION +unzip $CWD/oldschool_pc_font_pack_v${VERSION}_FULL.zip -d $PRGNAM-$VERSION cd $PRGNAM-$VERSION chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \+ -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ if [ "$TTF" = "yes" ]; then - mkdir -p $PKG/usr/share/fonts/TTF + mkdir -p $PKG/usr/share/fonts/TTF $PKG/usr/share/fonts/misc cp -a */*.ttf $PKG/usr/share/fonts/TTF + cp -a */*.otb $PKG/usr/share/fonts/misc fi if [ "$CONSOLE" = "yes" ]; then - # The "PS/2thin" fonts don't extract, because fon2fnts insists on using + # A few of the fonts don't extract, because fon2fnts insists on using # the font name embedded in the .FON file as a filename, and these have # a slash in them. On Windows, no problem, but a slash is a directory # separator here... but, sed can handle binary files, so we can fix it: - sed -i 's,PS/2,PS_2,g' */*IBM_PS2thin*.FON + sed -i 's,PS/55,PS-55,g' */*IBM_PS-55*.FON + sed -i 's,DOS/V,DOS-V,g' */*DOS-V*.FON mkdir -p $PKG/usr/share/kbd/consolefonts @@ -108,10 +123,13 @@ if [ "$CONSOLE" = "yes" ]; then echo "=== $fnt => $psf" fnt2psf --psf2 --codepage=437 "$fnt" $PKG/usr/share/kbd/consolefonts/$psf done + gzip $PKG/usr/share/kbd/consolefonts/*.psfu fi +# Don't include README.NFO, it's the same as README.TXT but with some +# CP437 characters in the ASCII art logo. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a LICENSE.TXT README.NFO $PKG/usr/doc/$PRGNAM-$VERSION +cp -a *.TXT docs/*.pdf $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/README_console.txt > $PKG/usr/doc/$PRGNAM-$VERSION/README_console.txt cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -122,7 +140,8 @@ sed "s,@TYPE@,$TYPE," $CWD/slack-desc > $PKG/install/slack-desc # actually included. if [ "$TTF" = "yes" ]; then cat $CWD/doinst.sh > $PKG/install/doinst.sh + cp $PKG/install/doinst.sh $PKG/install/douninst.sh fi cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |