summaryrefslogtreecommitdiffstats
path: root/system/ansifilter/ansifilter.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/ansifilter/ansifilter.SlackBuild')
-rw-r--r--system/ansifilter/ansifilter.SlackBuild87
1 files changed, 87 insertions, 0 deletions
diff --git a/system/ansifilter/ansifilter.SlackBuild b/system/ansifilter/ansifilter.SlackBuild
new file mode 100644
index 0000000000..2a5461d435
--- /dev/null
+++ b/system/ansifilter/ansifilter.SlackBuild
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+# Slackware build script for ansifilter
+
+# Written by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=ansifilter
+VERSION=${VERSION:-2.20}
+BUILD=${BUILD:-1}
+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.bz2
+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 {} +
+
+# don't need this in the doc dir.
+sed -i '/\.\/INSTALL/d' makefile
+
+# use our flags, followed by upstream's (which are already -O2 -fPIC,
+# so this really only matters on x86 32-bit). don't have to mess with
+# the qt stuff, qmake already uses the correct flags it was built with.
+sed -i "/FLAGS/s,-Wall,$SLKCFLAGS," src/makefile
+
+make
+make gui
+# make tcl ### tcl support disabled unless someone requests it someday.
+make install \
+ man_dir=/usr/man/man1 doc_dir=/usr/doc/$PRGNAM-$VERSION \
+ DESTDIR=$PKG INSTALL_PROGRAM="install -s -m0755"
+make install-gui \
+ DESTDIR=$PKG INSTALL_PROGRAM="install -s -m0755"
+gzip -9 $PKG/usr/man/man*/*
+
+ICONS=$PKG/usr/share/icons/hicolor/48x48/apps
+mkdir -p $ICONS
+convert src/qt-gui/ansifilter.xpm $ICONS/$PRGNAM.png
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+cp -a ansi_art_samples $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