diff options
Diffstat (limited to 'system/ossec-server/ossec-server.SlackBuild')
-rw-r--r-- | system/ossec-server/ossec-server.SlackBuild | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/system/ossec-server/ossec-server.SlackBuild b/system/ossec-server/ossec-server.SlackBuild index e3b7463eb3..e9410aa8fd 100644 --- a/system/ossec-server/ossec-server.SlackBuild +++ b/system/ossec-server/ossec-server.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for ossec-server -# Copyright 2016 Mario Preksavec, Zagreb, Croatia +# Copyright 2016, 2020 Mario Preksavec, Zagreb, Croatia # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +22,15 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Special thanks to Jason Graham for patches and testing + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=ossec-server -VERSION=${VERSION:-2.9.1} +VERSION=${VERSION:-3.6.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} SRCNAM=ossec-hids @@ -37,7 +42,14 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +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} @@ -61,6 +73,14 @@ USERID_MAIL=${USERID_MAIL:-334} USERID_REMOTE=${USERID_REMOTE:-335} GROUPID=${GROUPID:-333} +if [ "$GEOIP" != "yes" ]; then + GEOIP=no +fi + +if [ "$INOTIFY" != "yes" ]; then + INOTIFY=no +fi + if ! grep ^ossec: /etc/group 2>&1 > /dev/null \ || ! grep -E '^(ossec|ossecm|ossecr):' /etc/passwd 2>&1 > /dev/null; then echo -e "\n You must have ossec users and a group to run this script\n" @@ -106,6 +126,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +patch -p1 < $CWD/gcc-fno-common-3.6.0.patch + # Makefile fixes sed -e 's|\(./init/adduser.sh.*\)|#\1|' \ -e 's|\(DEFINES+=-DDEFAULTDIR=\).*|\1\\"/var/ossec\\"|' \ @@ -113,8 +135,10 @@ sed -e 's|\(./init/adduser.sh.*\)|#\1|' \ # There is no configure script and install.sh is a bit limited ( cd src - make PREFIX=$PKG/var/ossec TARGET=server build - make PREFIX=$PKG/var/ossec TARGET=server install + make USE_GEOIP=$GEOIP USE_INOTIFY=$INOTIFY \ + PREFIX=$PKG/var/ossec TARGET=server build + make USE_GEOIP=$GEOIP USE_INOTIFY=$INOTIFY \ + PREFIX=$PKG/var/ossec TARGET=server install ) # Prepare system /etc @@ -141,7 +165,8 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a BUGS CHANGELOG CONFIG CONTRIBUTORS LICENSE README.md doc/{*.txt,README.*} \ +cp -a BUGS CHANGELOG.md CONFIG CONTRIBUTORS INSTALL LICENSE README.md SUPPORT.md \ + doc/{*.txt,README.*} \ $CWD/README.SLACKWARE $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -150,4 +175,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |