slackbuilds/UNUSED/n/artillery/SlackBuild

98 lines
2.4 KiB
Text
Raw Normal View History

#!/bin/sh
2011-10-17 11:13:58 +02:00
# variables
VERSION=$(date +"%Y.%m.%d_%H.%M")
BUILD=1
2020-06-25 11:23:11 +02:00
TAG=gwh
2011-10-17 11:13:58 +02:00
TMP=/tmp/$TAG
CWD=$(pwd)
OUTPUT=/tmp
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
2011-10-17 11:14:43 +02:00
ARCH=noarch
2011-10-17 11:13:58 +02:00
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
# mise en place
cd $TMP
if [ ! -e $REPOSITORY ] ; then
svn co http://svn.secmaniac.com/artillery $REPOSITORY
else
( cd $REPOSITORY
svn update
)
fi
mkdir -p $PKG/{var/,etc/rc.d/,usr/doc/$PRGNAM/}
cp -R $REPOSITORY $PKG/var/
cd $PKG/var/$PRGNAM
find . -name .svn -exec rm -fr {} \;
mv README readme/ install.py $PKG/usr/doc/$PRGNAM/
cat <<EOF > $PKG/etc/rc.d/rc.$PRGNAM
#!/bin/bash
case "\$1" in
'start')
python /var/$PRGNAM/$PRGNAM.py &
echo \$! > /var/run/$PRGNAM.pid
;;
'stop')
2011-10-17 11:27:25 +02:00
[ -e /var/run/$PRGNAM.pid ] && kill \$(cat /var/run/$PRGNAM.pid) && rm /var/run/$PRGNAM.pid
2011-10-17 11:13:58 +02:00
;;
'restart')
2011-10-17 11:27:25 +02:00
\$0 stop
sleep 1
\$0 start
2011-10-17 11:13:58 +02:00
;;
esac
EOF
#chmod +x $PKG/etc/rc.d/rc.$PRGNAM
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/doinst.sh
#!/bin/sh
grep -q "/etc/rc.d/rc.$PRGNAM" /etc/rc.d/rc.local || cat <<FOE >> /etc/rc.d/rc.local
[ -x /etc/rc.d/rc.$PRGNAM ] && /etc/rc.d/rc.$PRGNAM start
FOE
EOF
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 (Network Security tool)
$PRGNAM:
$PRGNAM: Artillery is a combination of a honeypot, file monitoring and
$PRGNAM: integrity, alerting, and brute force prevention tool. Its extremely
$PRGNAM: light weight, has multiple different methods for detecting specific
$PRGNAM: attacks and eventually will also notify you of insecure nix
$PRGNAM: configurations.
$PRGNAM:
$PRGNAM:
$PRGNAM: http://www.secmaniac.com/blog/2011/10/14/new-tool-release-artillery-for-linux-protection/
$PRGNAM:
EOF
# empaquetage
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
2020-07-12 09:22:26 +02:00
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz