85 lines
2.8 KiB
Bash
Executable file
85 lines
2.8 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# Copyright 2013, 2018, 2019 Patrick J. Volkerding, Sebeka, MN, USA
|
|
# All rights reserved.
|
|
#
|
|
# Redistribution and use of this script, with or without modification, is
|
|
# permitted provided that the following conditions are met:
|
|
#
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
# otb conversion by Gwh 2020
|
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
PKGNAM=$(basename $CWD)
|
|
VERSION=${VERSION:-$(ls /usr/doc/ | grep terminus-font | rev | cut -d- -f1 | rev)}
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-gwh}
|
|
|
|
TMP=${TMP:-/tmp/$TAG}
|
|
PKG=$TMP/package-$PKGNAM
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $PKG/usr/share/fonts/misc/
|
|
cd $PKG/usr/share/fonts/misc/
|
|
|
|
for i in /usr/share/fonts/misc/ter-u*; do
|
|
f=$(echo $(basename $i) | sed 's|\.gz$||')
|
|
zcat $i > $f
|
|
fonttosfnt -o "${f/pcf/otb}" "$f"
|
|
rm $f
|
|
done
|
|
|
|
chmod 0644 $PKG/usr/share/fonts/misc/*
|
|
|
|
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------------------------------------------------------|
|
|
$PKGNAM: $PKGNAM (a clean fixed width font)
|
|
$PKGNAM:
|
|
$PKGNAM: OTB format addition to the official terminus-font package.
|
|
$PKGNAM:
|
|
$PKGNAM:
|
|
$PKGNAM:
|
|
$PKGNAM:
|
|
$PKGNAM: Homepage: http://$PKGNAM.sourceforge.net
|
|
$PKGNAM: https://github.com/archlinux/svntogit-community/tree/packages/terminus-font-otb/trunk
|
|
$PKGNAM:
|
|
$PKGNAM:
|
|
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/misc 2> /dev/null
|
|
fi
|
|
if [ -x /usr/bin/fc-cache ]; then
|
|
/usr/bin/fc-cache -f 2> /dev/null
|
|
fi
|
|
EOF
|
|
|
|
cd $PKG
|
|
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PKGNAM-$VERSION-noarch-$BUILD$TAG.txz
|