summaryrefslogtreecommitdiffstats
path: root/source/ap/tmux
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/tmux')
-rw-r--r--source/ap/tmux/doinst.sh13
-rw-r--r--source/ap/tmux/slack-desc8
-rwxr-xr-xsource/ap/tmux/tmux.SlackBuild45
-rw-r--r--source/ap/tmux/tmux.conf7
4 files changed, 51 insertions, 22 deletions
diff --git a/source/ap/tmux/doinst.sh b/source/ap/tmux/doinst.sh
new file mode 100644
index 000000000..3adb2ad88
--- /dev/null
+++ b/source/ap/tmux/doinst.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+config etc/tmux.conf.new
diff --git a/source/ap/tmux/slack-desc b/source/ap/tmux/slack-desc
index a84d8d0ad..59b5405c5 100644
--- a/source/ap/tmux/slack-desc
+++ b/source/ap/tmux/slack-desc
@@ -1,8 +1,8 @@
# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
+# 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
+# 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------------------------------------------------------|
@@ -13,7 +13,7 @@ tmux: (or windows) to be accessed and controlled from a single terminal.
tmux: tmux is intended to be a simple, modern, BSD-licensed alternative to
tmux: programs such as GNU screen.
tmux:
-tmux: Homepage: http://tmux.github.io/
+tmux: Homepage: http://tmux.github.io/
tmux:
tmux:
tmux:
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
diff --git a/source/ap/tmux/tmux.conf b/source/ap/tmux/tmux.conf
new file mode 100644
index 000000000..de3bee1f2
--- /dev/null
+++ b/source/ap/tmux/tmux.conf
@@ -0,0 +1,7 @@
+# System-wide tmux config file.
+#
+# As installed, this serves only to set the default terminal type.
+# For a more complete example, see: /usr/doc/tmux-*/example_tmux.conf
+
+# Change the default $TERM to tmux-256color
+set -g default-terminal "tmux-256color"