summaryrefslogtreecommitdiffstats
path: root/system/rxvt/rxvt.SlackBuild
blob: 1e2873648b0f55566b9e5216074079a421f3c11f (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash

# Slackware build script for rxvt

# Written by B. Watson (urchlay@slackware.uk)

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

# This is loosely based on Pat Volkerding's rxvt from Slackware 14.2's
# patches/ (same ./configure options and patches). Since his last BUILD
# was 5, I'm submitting this with BUILD=6 to start out with.

# The original upstream site is long gone. I was gonna link to an
# archive.org copy of it for the screenshots in the HTML doc, but
# the screenshot (the only one) isn't archived. So the docs have dead
# links, *shrug*.

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

PRGNAM=rxvt
VERSION=${VERSION:-2.7.10}
BUILD=${BUILD:-6}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

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}

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
else
  SLKCFLAGS="-O2"
fi

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 .
find -L .  -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
        \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +

# Patches came from:
# https://ftp.slackware.com/pub/slackware/slackware-14.2/patches/source/rxvt/
# ...though I gunzipped them since SBo prefers that.
patch -p1 < $CWD/rxvt-integer-overflow-fix.diff
patch -p1 < $CWD/rxvt.utempter.diff

# Same configure options as Pat used:
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --enable-languages \
  --enable-utmp \
  --enable-wtmp \
  --enable-xpm-background \
  --enable-transparency \
  --enable-menubar \
  --enable-graphics \
  --enable-rxvt-scroll \
  --enable-next-scroll \
  --enable-xterm-scroll \
  --enable-xim \
  --enable-frills \
  --enable-linespace \
  --enable-24bit \
  --enable-keepscrolling \
  --enable-mousewheel \
  --enable-slipwheeling \
  --enable-xgetdefault \
  --enable-old-selection \
  --build=$ARCH-slackware-linux

make
make install DESTDIR=$PKG
strip $PKG/usr/bin/*
gzip -9 $PKG/usr/man/man*/*

# Cleanup on aisle six: empty dirs and a duplicate binary.
rmdir $PKG/usr/lib $PKG/usr/include
rm -rf $PKG/usr/bin/$PRGNAM-$VERSION

# Note to self: do not include the terminfo entry, even though it's
# present in the source. Slackware's already got it, in the ncurses
# package.

# Pat's package didn't include an icon or a .desktop. rxvt-logo.png
# came from upstream's web site, and the .desktop is a modified version
# of the one from rxvt-unicode.
APPS=$PKG/usr/share/applications
ICONS=$PKG/usr/share/icons/hicolor/32x32/apps
PMAPS=$PKG/usr/share/pixmaps

mkdir -p $APPS $ICONS $PMAPS
cat $CWD/$PRGNAM.desktop > $APPS/$PRGNAM.desktop
cat $CWD/rxvt-logo.png > $ICONS/$PRGNAM.png
ln -s ../icons/hicolor/32x32/apps/$PRGNAM.png $PMAPS/$PRGNAM.png

# Here we differ from Pat's package: not going to include the entire
# contents of doc/, since some of it's YODL source for the HTML, and there
# are Makefiles...
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
chmod 644 doc/menu/*
cp -a ChangeLog \
      *.lsm \
      doc/{etc/*.ad,menu,BUGS,FAQ,README.*,TODO,*.{txt,html,seq}} \
      rclock/*.html $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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