diff options
author | Petr Kletecka <petr@kle.cz> | 2018-05-03 23:54:37 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-05-05 06:46:30 +0700 |
commit | 739fc9a5eb0cc59d52327191e9807d345f2bbfaf (patch) | |
tree | 77311f4ffdd40607ca1724257e10cc713cdd44f4 /misc | |
parent | 3061e9c60a8a275c2eb0c7dd777a743e66a785f7 (diff) |
misc/sgrep: Added (sorted grep).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/sgrep/README | 9 | ||||
-rw-r--r-- | misc/sgrep/sgrep.SlackBuild | 86 | ||||
-rw-r--r-- | misc/sgrep/sgrep.info | 10 | ||||
-rw-r--r-- | misc/sgrep/slack-desc | 19 |
4 files changed, 124 insertions, 0 deletions
diff --git a/misc/sgrep/README b/misc/sgrep/README new file mode 100644 index 0000000000000..a8f93ac25a3a5 --- /dev/null +++ b/misc/sgrep/README @@ -0,0 +1,9 @@ +Sgrep (sorted grep) searches sorted input files for lines that match a +search key and outputs the matching lines. When searching large files +sgrep is much faster than traditional Unix grep, but with significant +restrictions. + + * All input files must be sorted regular files. + * The sort key must start at the beginning of the line. + * The search key matches only at the beginning of the line. + * No regular expression support. diff --git a/misc/sgrep/sgrep.SlackBuild b/misc/sgrep/sgrep.SlackBuild new file mode 100644 index 0000000000000..b2d22c333e2a2 --- /dev/null +++ b/misc/sgrep/sgrep.SlackBuild @@ -0,0 +1,86 @@ +#!/bin/sh + +# Slackware build script for sgrep + +# Petr Kletecka petr@kle.cz <2018> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=sgrep +VERSION=${VERSION:-1.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +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.tgz +cd $PRGNAM-$VERSION +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 {} \; + +make CFLAGS="$SLKCFLAGS" + +install -D -m755 sgrep $PKG/usr/bin/sgrep +strip --strip-unneeded $PKG/usr/bin/sgrep + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat COPYING > $PKG/usr/doc/$PRGNAM-$VERSION/COPYING +cat doc.html > $PKG/usr/doc/$PRGNAM-$VERSION/doc.html +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} diff --git a/misc/sgrep/sgrep.info b/misc/sgrep/sgrep.info new file mode 100644 index 0000000000000..885cc3b295519 --- /dev/null +++ b/misc/sgrep/sgrep.info @@ -0,0 +1,10 @@ +PRGNAM="sgrep" +VERSION="1.0" +HOMEPAGE="http://sgrep.sourceforge.net/" +DOWNLOAD="https://downloads.sourceforge.net/project/sgrep/sgrep/sgrep-1.0/sgrep-1.0.tgz" +MD5SUM="f3c0949a15c24934c0d17ff9c61fc45d" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Petr Kletecka" +EMAIL="petr@kle.cz" diff --git a/misc/sgrep/slack-desc b/misc/sgrep/slack-desc new file mode 100644 index 0000000000000..5638a61f307d3 --- /dev/null +++ b/misc/sgrep/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------------------------------------------------------| +sgrep: sgrep (sorted grep) +sgrep: +sgrep: Sgrep searches sorted input files for lines that match a search key +sgrep: and outputs the matching lines. +sgrep: +sgrep: +sgrep: +sgrep: +sgrep: website: http://sgrep.sourceforge.net +sgrep: +sgrep: |