slackbuilds/ap/the_silver_searcher/the_silver_searcher.SlackBuild
Gwenhael Le Moine 854cb30a48 add the_silver_searcher a.k.a. ag, a replacement for ack and grep
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2012-12-12 13:46:06 +01:00

83 lines
2 KiB
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh -x
# variables
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
BUILD=${BUILD:-1}
TAG=cyco
TMP=/tmp/$TAG
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
ARCH=${ARCH:-$(uname -m)}
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/repositories/$PRGNAM}
PREFIX=${PREFIX:-/usr}
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
if [ ! -e $REPOSITORY ] ; then
mkdir -p $(dirname $REPOSITORY)
git clone http://github.com/ggreer/the_silver_searcher.git $REPOSITORY
else
( cd $REPOSITORY
git pull
)
fi
cp -R $REPOSITORY $TMP/
cd $TMP/$PRGNAM
aclocal
autoconf
autoheader
automake --add-missing
./configure \
--prefix=/usr \
--mandir=/usr/man
make
make install DESTDIR=$PKG
# correction
cd $PKG
chown -R root:root *
# move doc/ to the appropriate location
mkdir -p $PKG$PREFIX/doc
cp LICENSE NOTICE README.md $PKG$PREFIX/doc
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
# 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 ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (An attempt to make something better than ack.)
$PRGNAM:
$PRGNAM: It searches code about 35× faster than ack.
$PRGNAM: It ignores file patterns from your .gitignore and .hgignore.
$PRGNAM: If there are files in your source repo you don't want to search,
$PRGNAM: just add their patterns to a .agignore file. *cough* extern *cough*
$PRGNAM: The command name is 33% shorter than ack!
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/ggreer/the_silver_searcher
$PRGNAM:
EOF
# empaquetage
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz