system/ansifilter: Added (ANSI converter).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-12-21 22:19:10 +07:00 committed by Willy Sudiarto Raharjo
parent 32e4d04dde
commit 946150dbc5
No known key found for this signature in database
GPG key ID: 3F617144D7238786
5 changed files with 130 additions and 0 deletions

5
system/ansifilter/README Normal file
View file

@ -0,0 +1,5 @@
ansifilter (strip or convert ANSI escapes in text files)
Ansifilter handles text files containing ANSI terminal escape codes.
The command sequences may be stripped or be interpreted to generate
formatted output (HTML, RTF, TeX, LaTeX, BBCode, Pango).

View file

@ -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

View file

@ -0,0 +1,10 @@
PRGNAM="ansifilter"
VERSION="2.20"
HOMEPAGE="http://andre-simon.de/doku/ansifilter/en/ansifilter.php"
DOWNLOAD="http://andre-simon.de/zip/ansifilter-2.20.tar.bz2"
MD5SUM="d2a8d8b9256bc8c843934d8123b5c0dd"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
EMAIL="urchlay@slackware.uk"

View file

@ -0,0 +1,9 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
fi
fi

View file

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# 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
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
ansifilter: ansifilter (strip or convert ANSI escapes in text files)
ansifilter:
ansifilter: Ansifilter handles text files containing ANSI terminal escape codes.
ansifilter: The command sequences may be stripped or be interpreted to generate
ansifilter: formatted output (HTML, RTF, TeX, LaTeX, BBCode, Pango).
ansifilter:
ansifilter:
ansifilter:
ansifilter:
ansifilter:
ansifilter: