slackbuilds_ponce/misc/txt2regex/txt2regex.SlackBuild
B. Watson 91a8414969
misc/txt2regex: Added (interactive regular expression trainer)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2020-11-22 01:14:19 +07:00

49 lines
1.3 KiB
Bash

#!/bin/sh
# Slackware build script for txt2regex
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
PRGNAM=txt2regex
VERSION=${VERSION:-0.9}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
ARCH=noarch
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
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 {} \+
# There's a MANDIR in the Makefile, but nothing uses it. Have to
# install the man page, er, manually.
make install DESTDIR=$PKG
mkdir -p $PKG/usr/man/man1
gzip -9c < man/$PRGNAM.man > $PKG/usr/man/man1/$PRGNAM.1.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
chmod -x tests/regex-tester.sh # no +x files in the doc dir!
gzip -9 tests/regex-tester.txt # 116KB => 10KB
cp -a *.md COPYRIGHT TODO tests man/*.html $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}