development/mawk: Add option to build with glibc regexes.

Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
B. Watson 2018-09-03 15:44:06 -04:00 committed by Willy Sudiarto Raharjo
parent 2c8965c4a2
commit ef1c421252
No known key found for this signature in database
GPG key ID: 887B8374D7333381
4 changed files with 50 additions and 14 deletions

View file

@ -16,3 +16,27 @@ and mawk provides a small number of extensions.
This build does not conflict with Slackware's own awk (from the gawk
package).
By default, mawk is built using its own built-in regular expression
engine. There are some slight differences between this and the glibc
regular expression engine:
- Embedded NUL characters are supported by the built-in engine. For
instance, you can use the hex escape \x00 to match a NUL character.
glibc regexes don't support this.
- POSIX brace syntax is NOT supported by the built-in engine. For
instance, /a{3}/ to match "aaa" but not "a" or "aa". glibc regexes do
support this.
If you require the glibc engine, export BUILTIN_REGEX=no in the script's
environment.
The default version in the .info file is 1.3.4, which is a stable release
from 2009. If you'd like to (or need to) build one of the newer 'snapshot'
releases, get the source from ftp://ftp.invisible-island.net/mawk/
and export VERSION in the environment. Notice the filenames look like
e.g. "mawk-1.3.4-20171017.tgz". Slackware version numbers can't contain
the hyphen, so use an underscore instead. Example:
# export "VERSION=1.3.4_20171017"

View file

@ -6,9 +6,12 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20180902 bkw:
# - Add BUILTIN_REGEX option.
PRGNAM=mawk
VERSION=${VERSION:-1.3.4}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -40,23 +43,32 @@ fi
set -e
# This does nothing for 1.3.4, but allows e.g. VERSION=1.3.4_20171017 in
# the environment.
SRCVER="$( echo $VERSION | sed 's,_,-,' )"
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tgz
cd $PRGNAM-$VERSION
rm -rf $PRGNAM-$SRCVER
tar xvf $CWD/$PRGNAM-$SRCVER.tgz
cd $PRGNAM-$SRCVER
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
if [ "${BUILTIN_REGEX:-yes}" = "yes" ]; then
REGEX_OPT="--with-builtin-regex"
REGEX_DESC="mawk's built-in"
else
REGEX_OPT="--without-builtin-regex"
REGEX_DESC="glibc's"
fi
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
$REGEX_OPT \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
@ -76,7 +88,7 @@ cp -a ACKNOWLEDGMENT CHANGES COPYING MANIFEST README \
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
sed "s,@REGEX_DESC@,$REGEX_DESC," $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -1,8 +1,8 @@
PRGNAM="mawk"
VERSION="1.3.4"
VERSION="1.3.4_20171017"
HOMEPAGE="http://invisible-island.net/mawk/mawk.html"
DOWNLOAD="ftp://ftp.invisible-island.net/mawk/mawk-1.3.4.tgz"
MD5SUM="b1d27324ae80302452d0fa0c98447b65"
DOWNLOAD="ftp://ftp.invisible-island.net/mawk/mawk-1.3.4-20171017.tgz"
MD5SUM="6de7560406cd9836335a7297bb910e08"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""

View file

@ -13,7 +13,7 @@ mawk: Language. It's a very fast AWK implementation based on a bytecode
mawk: interpreter. Originally written by Mike Brennan, mawk is currently
mawk: maintained by Thomas E. Dickey.
mawk:
mawk:
mawk: Package built with @REGEX_DESC@ regular expression engine.
mawk:
mawk:
mawk: