summaryrefslogtreecommitdiffstats
path: root/graphics/bdfedit/bdfedit.SlackBuild
blob: 0d1912a14b92872011d73985fbf90ca855944f30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash

# Slackware build script for bdfedit

# Written by B. Watson (yalhcru@gmail.com)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/
# for details.

# Why do we need another BDF editor? Because gbdfed keeps segfaulting on
# me. Also, bdfedit's UI uses a single window instead of the multiple
# windows gbdfed uses (which is better will be a matter of personal
# preference, but I prefer 1 window). fontforge is also capable of
# editing BDFs but its UI is irritating (to me anyway).

# Yes, this is old software that hasn't been maintained in 12+ years,
# but it works fine.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=bdfedit
VERSION=${VERSION:-1.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

ARCH=noarch
# no CFLAGS or LIBDIRSUFFIX needed here

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 -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM$VERSION
tar xvf $CWD/$PRGNAM$VERSION.tar.gz
cd $PRGNAM$VERSION
chown -R root:root .

# upstream perms are bad, do this instead of find|chmod.
chmod 755 .
chmod 644 *

mkdir -p $PKG/usr/bin

# instead of having bdfedit source completion.tcl, just include its
# contents directly in bdfedit. Avoids having to create a private
# lib or share dir. Also set correct path to wish in #! line.
( echo '#!/usr/bin/wish -f'
  cat completion.tcl
  sed '1,5d' $PRGNAM ) \
		> $PKG/usr/bin/$PRGNAM

chmod 755 $PKG/usr/bin/$PRGNAM

# .desktop and icon made for this build. Don't laugh, I'm not
# a graphic designer, OK?
mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop

# man page written for this build (copy/paste from readme, mostly).
mkdir -p $PKG/usr/man/man1
gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $PRGNAM.* *.$PRGNAM $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE