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 This build does not conflict with Slackware's own awk (from the gawk
package). 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. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20180902 bkw:
# - Add BUILTIN_REGEX option.
PRGNAM=mawk PRGNAM=mawk
VERSION=${VERSION:-1.3.4} VERSION=${VERSION:-1.3.4}
BUILD=${BUILD:-1} BUILD=${BUILD:-2}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
@ -40,23 +43,32 @@ fi
set -e 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 rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT mkdir -p $TMP $PKG $OUTPUT
cd $TMP cd $TMP
rm -rf $PRGNAM-$VERSION rm -rf $PRGNAM-$SRCVER
tar xvf $CWD/$PRGNAM-$VERSION.tgz tar xvf $CWD/$PRGNAM-$SRCVER.tgz
cd $PRGNAM-$VERSION cd $PRGNAM-$SRCVER
chown -R root:root . chown -R root:root .
find -L . \ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
-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 {} \+
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" \ CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \
./configure \ ./configure \
$REGEX_OPT \
--prefix=/usr \ --prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \ --libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \ --sysconfdir=/etc \
@ -76,7 +88,7 @@ cp -a ACKNOWLEDGMENT CHANGES COPYING MANIFEST README \
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install 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 cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -1,8 +1,8 @@
PRGNAM="mawk" PRGNAM="mawk"
VERSION="1.3.4" VERSION="1.3.4_20171017"
HOMEPAGE="http://invisible-island.net/mawk/mawk.html" HOMEPAGE="http://invisible-island.net/mawk/mawk.html"
DOWNLOAD="ftp://ftp.invisible-island.net/mawk/mawk-1.3.4.tgz" DOWNLOAD="ftp://ftp.invisible-island.net/mawk/mawk-1.3.4-20171017.tgz"
MD5SUM="b1d27324ae80302452d0fa0c98447b65" MD5SUM="6de7560406cd9836335a7297bb910e08"
DOWNLOAD_x86_64="" DOWNLOAD_x86_64=""
MD5SUM_x86_64="" MD5SUM_x86_64=""
REQUIRES="" 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: interpreter. Originally written by Mike Brennan, mawk is currently
mawk: maintained by Thomas E. Dickey. mawk: maintained by Thomas E. Dickey.
mawk: mawk:
mawk: mawk: Package built with @REGEX_DESC@ regular expression engine.
mawk: mawk:
mawk: mawk:
mawk: mawk: