aboutsummaryrefslogtreecommitdiff
path: root/development/onetrueawk
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-05-25 07:14:46 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-05-28 09:11:36 +0700
commit3871af76fcda5b75688b5a61507ca30dc04c07ab (patch)
tree46c012a409329551af4237ad0f1b2dc1af2d1d71 /development/onetrueawk
parenteda64253976db3924aa773e425812e6cf5c73075 (diff)
development/onetrueawk: Added (port of original UNIX awk)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/onetrueawk')
-rw-r--r--development/onetrueawk/README17
-rw-r--r--development/onetrueawk/git2tarxz.sh61
-rw-r--r--development/onetrueawk/onetrueawk.SlackBuild83
-rw-r--r--development/onetrueawk/onetrueawk.info10
-rw-r--r--development/onetrueawk/slack-desc19
5 files changed, 190 insertions, 0 deletions
diff --git a/development/onetrueawk/README b/development/onetrueawk/README
new file mode 100644
index 0000000000000..70c652df20d7a
--- /dev/null
+++ b/development/onetrueawk/README
@@ -0,0 +1,17 @@
+onetrueawk (port of original UNIX awk)
+
+This is the version of awk described in "The AWK Programming
+Language", by Al Aho, Brian Kernighan, and Peter Weinberger
+(Addison-Wesley, 1988, ISBN 0-201-07981-X). It is still maintained,
+and has received many bug fixes since the book was released. The code
+is released under a BSD-style license.
+
+The executable and man page are installed as "otawk", to avoid
+conflicting with Slackware's own gawk package. Also, otawk is
+installed to /opt/onetrueawk/bin/awk, so you can use it as the default
+awk by adjusting your user's $PATH (but it's not recommended to do
+this system-wide).
+
+If you want to run the test suite, export MAKETEST=yes in the
+environment. The test results will be saved to:
+/usr/doc/onetrueawk-$VERSION/maketest.log
diff --git a/development/onetrueawk/git2tarxz.sh b/development/onetrueawk/git2tarxz.sh
new file mode 100644
index 0000000000000..82e637800599f
--- /dev/null
+++ b/development/onetrueawk/git2tarxz.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# Create source tarball from git repo, with generated version number.
+
+# Takes one optional argument, which is the commit or tag to create a
+# tarball of. With no arg, HEAD is used.
+
+# Version number example: 20200227_ad7ec17
+
+# Notes:
+
+# Do not use this if you're packaging a release.
+
+# This script doesn't need to be run as root. It does need to be able
+# to write to the current directory it's run from.
+
+# Running this script twice for the same commit will NOT give identical
+# tarballs, even if the contents are identical. This is because tar
+# includes the current time in a newly-created tarball (plus there may
+# be other git-related reasons).
+
+# Once you've generated a tarball, you'll still need a place to host it.
+# Ask on the mailing list, if you don't have your own web server to
+# play with.
+
+## Config:
+PRGNAM=onetrueawk
+CLONE_URL=https://github.com/onetrueawk/awk
+## End of config.
+
+set -e
+
+GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX )
+rm -rf $GITDIR
+git clone $CLONE_URL $GITDIR
+
+CWD="$( pwd )"
+cd $GITDIR
+
+if [ "$1" != "" ]; then
+ git reset --hard "$1" || exit 1
+fi
+
+GIT_SHA=$( git rev-parse --short HEAD )
+
+DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 )
+
+VERSION=${DATE}_${GIT_SHA}
+
+rm -rf .git
+find . -name .gitignore -print0 | xargs -0 rm -f
+
+cd "$CWD"
+rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz
+mv $GITDIR $PRGNAM-$VERSION
+tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION
+
+echo
+echo "Created tarball: $PRGNAM-$VERSION.tar.xz"
+echo "VERSION=\"$VERSION\""
+echo "MD5SUM=\"$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )\""
diff --git a/development/onetrueawk/onetrueawk.SlackBuild b/development/onetrueawk/onetrueawk.SlackBuild
new file mode 100644
index 0000000000000..00dcea130860a
--- /dev/null
+++ b/development/onetrueawk/onetrueawk.SlackBuild
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Slackware build script for onetrueawk
+
+# 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=onetrueawk
+VERSION=${VERSION:-20220303_2402014}
+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"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
+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 {} \+
+
+make HOSTCC=${CC:-gcc} CFLAGS="$SLKCFLAGS"
+
+# no 'make install'. binary is called a.out, very retro.
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+PKGOPT=$PKG/opt/$PRGNAM
+mkdir -p $PKGDOC {$PKG/usr,$PKGOPT}/{bin,man/man1}
+install -s -m0755 a.out $PKGOPT/bin/awk
+gzip -9c < awk.1 > $PKGOPT/man/man1/awk.1.gz
+
+# test suite failure doesn't exit with error status. save the log for
+# later perusal.
+[ "${MAKETEST:-no}" = "yes" ] && make test 2>&1 | tee $PKGDOC/maketest.log
+
+ln -s ../../opt/$PRGNAM/bin/awk $PKG/usr/bin/otawk
+ln -s ../../../opt/$PRGNAM/man/man1/awk.1.gz $PKG/usr/man/man1/otawk.1.gz
+
+cp -a ChangeLog FIXES LICENSE README.md TODO $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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
diff --git a/development/onetrueawk/onetrueawk.info b/development/onetrueawk/onetrueawk.info
new file mode 100644
index 0000000000000..a830b5ee9a510
--- /dev/null
+++ b/development/onetrueawk/onetrueawk.info
@@ -0,0 +1,10 @@
+PRGNAM="onetrueawk"
+VERSION="20220303_2402014"
+HOMEPAGE="https://github.com/onetrueawk/awk"
+DOWNLOAD="https://slackware.uk/~urchlay/src/onetrueawk-20220303_2402014.tar.xz"
+MD5SUM="77c6cc994faa8636f470c778ff2bdf9a"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="urchlay@slackware.uk"
diff --git a/development/onetrueawk/slack-desc b/development/onetrueawk/slack-desc
new file mode 100644
index 0000000000000..2c1854ab34a8c
--- /dev/null
+++ b/development/onetrueawk/slack-desc
@@ -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------------------------------------------------------|
+onetrueawk: onetrueawk (port of original UNIX awk)
+onetrueawk:
+onetrueawk: This is the version of awk described in "The AWK Programming
+onetrueawk: Language", by Al Aho, Brian Kernighan, and Peter Weinberger
+onetrueawk: (Addison-Wesley, 1988, ISBN 0-201-07981-X). It is still maintained,
+onetrueawk: and has received many bug fixes since the book was released.
+onetrueawk:
+onetrueawk:
+onetrueawk:
+onetrueawk:
+onetrueawk: