summaryrefslogtreecommitdiffstats
path: root/source/ap/tmux/tmux.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/tmux/tmux.SlackBuild')
-rwxr-xr-xsource/ap/tmux/tmux.SlackBuild45
1 files changed, 27 insertions, 18 deletions
diff --git a/source/ap/tmux/tmux.SlackBuild b/source/ap/tmux/tmux.SlackBuild
index e58c2aae1..ccd43d999 100755
--- a/source/ap/tmux/tmux.SlackBuild
+++ b/source/ap/tmux/tmux.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2013, 2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2013, 2016, 2017, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,10 +20,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=tmux
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -36,6 +37,14 @@ if [ -z "$ARCH" ]; then
export ARCH
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
if [ "$ARCH" = "i486" ]; then
@@ -61,7 +70,6 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
@@ -70,8 +78,8 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
-cd $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
find . \
@@ -89,28 +97,28 @@ CFLAGS="$SLKCFLAGS" \
--mandir=/usr/man \
--infodir=/usr/info \
--disable-static \
- --build=$ARCH-slackware-linux
+ --build=$ARCH-slackware-linux || exit 1
# Build and install:
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
-# Add tmux terminfo entries:
-mkdir -p $PKG/usr/share/terminfo/t
-cat <<EOF | tic -x -o $PKG/usr/share/terminfo -
-tmux|tmux terminal multiplexer,
- ritm=\E[23m, rmso=\E[27m, sitm=\E[3m, smso=\E[7m, Ms@,
- use=xterm+tmux, use=screen,
-tmux-256color|tmux with 256 colors,
- use=xterm+256setaf, use=tmux,
-EOF
-
# Strip binaries:
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
+# Add a default system-wide config file. The only purpose for this is to set
+# the default $TERM to "tmux-256color" since otherwise it will default to
+# "screen" which won't properly map the backspace key to kbs=\177.
+mkdir $PKG/etc
+cp -a $CWD/tmux.conf.gz $PKG/etc
+gzip -d $PKG/etc/tmux.conf.gz
+mv $PKG/etc/tmux.conf $PKG/etc/tmux.conf.new
+chown root:root $PKG/etc/tmux.conf.new
+chmod 644 $PKG/etc/tmux.conf.new
+
# Add a documentation directory:
mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
cp -a \
@@ -151,6 +159,7 @@ if [ -r CHANGES ]; then
fi
mkdir -p $PKG/install
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG