84 lines
2 KiB
Text
84 lines
2 KiB
Text
|
#!/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 3–5× 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
|