summaryrefslogtreecommitdiffstats
path: root/development/hexcurse/hexcurse.SlackBuild
diff options
context:
space:
mode:
author B. Watson2018-08-08 18:47:52 +0200
committer Willy Sudiarto Raharjo2018-08-11 02:23:06 +0200
commitdc346489b44f0ce7754c030e7f17609620e752a5 (patch)
treed2189d8de512ddab987448a58e7605c64ad20510 /development/hexcurse/hexcurse.SlackBuild
parent8a89006a6e241e10d0036659a3124d9241cffac2 (diff)
downloadslackbuilds-dc346489b44f0ce7754c030e7f17609620e752a5.tar.gz
development/hexcurse: Added (ncurses-based hex editor).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'development/hexcurse/hexcurse.SlackBuild')
-rw-r--r--development/hexcurse/hexcurse.SlackBuild88
1 files changed, 88 insertions, 0 deletions
diff --git a/development/hexcurse/hexcurse.SlackBuild b/development/hexcurse/hexcurse.SlackBuild
new file mode 100644
index 0000000000..976054222e
--- /dev/null
+++ b/development/hexcurse/hexcurse.SlackBuild
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+# Slackware build script for hexcurse
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=hexcurse
+VERSION=${VERSION:-1.60.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+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 {} \+
+
+# Include some fixes from upstream git. The main one is to have hexcurse
+# exit with a usage message if called with no filename. Without this,
+# it will show its UI, but it's useless with no data to edit, and the
+# 'quit' keystrokes don't work (very annoying, have to kill from another
+# terminal).
+GITREV="${GITREV:-a7d60e8b}"
+PATCH=v$VERSION-$GITREV.diff
+[ -e $CWD/$PATCH ] && patch -p1 < $CWD/$PATCH
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --build=$ARCH-slackware-linux
+
+make
+make install-strip DESTDIR=$PKG
+gzip -9 $PKG/usr/man/man1/$PRGNAM.1
+
+# Will the real license please stand up? COPYING is the GPLv2, LICENSE.txt
+# is the LGPLv2. The READMEs don't say, so I include both in the tarball.
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS COPYING ChangeLog LICENSE.txt NEWS README README.md \
+ $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
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}