Modified server tarball to permit enterprise installer call (from-binary option)

This commit is contained in:
fermin831 2016-01-13 16:04:36 +01:00
parent b94f47f3a9
commit a344615359
1 changed files with 75 additions and 68 deletions

35
pandora_server/pandora_server_installer Normal file → Executable file
View File

@ -45,7 +45,7 @@ set_global_vars () {
OS_VERSION=`uname -r` OS_VERSION=`uname -r`
DISTRO=`uname -s` DISTRO=`uname -s`
# set corret value for LINUX_DISTRO # set correct value for LINUX_DISTRO
case $DISTRO in case $DISTRO in
Linux) Linux)
# Default for Linux # Default for Linux
@ -168,19 +168,31 @@ install () {
set_global_vars set_global_vars
FORCE=0 FORCE=0
BINARIES=0
# parse options # parse options
while : while :
do do
case $1 in case $1 in
--force) FORCE=1;; --force) FORCE=1;;
--no-tentacle) WITHOUT_TENTALCE=1;; --from-binary) BINARIES=1;;
--no-tentacle) WITHOUT_TENTACLE=1;;
--destdir) DESTDIR=$2;shift;; --destdir) DESTDIR=$2;shift;;
*) break;; *) break;;
esac esac
shift shift
done done
if [ "$LINUX" = YES ]
then
echo "$DISTRO distribution detected"
else
echo "$DISTRO detected"
fi
if [ ! $BINARIES -eq 1 ]
# Do not compile files if binary is distributed
then
$PERL Makefile.PL INSTALLMAN1DIR=none WITHOUT_TENTACLE=$WITHOUT_TENTACLE > output 2>&1 $PERL Makefile.PL INSTALLMAN1DIR=none WITHOUT_TENTACLE=$WITHOUT_TENTACLE > output 2>&1
#&& sleep 2 && cat output | grep "found" | wc -l #&& sleep 2 && cat output | grep "found" | wc -l
DEPENDENCIAS=`cat output | grep "found" | wc -l` DEPENDENCIAS=`cat output | grep "found" | wc -l`
@ -202,8 +214,8 @@ install () {
echo "For OpenSUSE / SLES do : " echo "For OpenSUSE / SLES do : "
echo " " echo " "
echo " # zypper install nmap perl-DBD-mysql perl-DBI perl-HTML-Parser perl-JSON echo " # zypper install nmap perl-DBD-mysql perl-DBI perl-HTML-Parser perl-JSON
perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP perl-IO-Socket-INET6 perl-Socket6 perl-HTML-Encoding perl-HTML-Tree perl-NetAddr-IP perl-IO-Socket-INET6 perl-Socket6
perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client" perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client"
echo " " echo " "
echo " You also will need to install (optionally) xprobe2 and wmiclient from rpm (download from our website)" echo " You also will need to install (optionally) xprobe2 and wmiclient from rpm (download from our website)"
echo " " echo " "
@ -230,13 +242,6 @@ perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client"
fi fi
rm output rm output
if [ "$LINUX" = YES ]
then
echo "$DISTRO distribution detected"
else
echo "$DISTRO detected"
fi
echo "Installing binaries and libraries" echo "Installing binaries and libraries"
make make
make DESTDIR=$DESTDIR install make DESTDIR=$DESTDIR install
@ -256,6 +261,7 @@ perl-TimeDate perl-XML-Simple perl-XML-Twig perl-libwww-perl mysql-client"
ln -s /usr/local/bin/tentacle_server $DESTDIR$PREFIX/bin ln -s /usr/local/bin/tentacle_server $DESTDIR$PREFIX/bin
fi fi
fi fi
fi
echo "Creating common Pandora FMS directories" echo "Creating common Pandora FMS directories"
id pandora 2> /dev/null id pandora 2> /dev/null
@ -484,12 +490,13 @@ help () {
echo " --force Ignore dependency problems and do the install" echo " --force Ignore dependency problems and do the install"
echo " --no-tentacle Skip tentacle server installation (by default tentacle server installed)" echo " --no-tentacle Skip tentacle server installation (by default tentacle server installed)"
echo " --destdir DIR Specify root directory for \"fakeroot\" installation" echo " --destdir DIR Specify root directory for \"fakeroot\" installation"
echo " --from-binary No compile Pandora Server and not execute Makefiles"
echo " " echo " "
} }
# Script banner at start # Script banner at start
echo " " echo " "
echo "Pandora FMS Server Installer $PI_VERSION $PI_BUILD (c) 2008-2015 Artica ST" echo "Pandora FMS Server Installer $PI_VERSION $PI_BUILD (c) 2008-2016 Artica ST"
echo "This program is licensed under GPL2 Terms. http://pandorafms.com" echo "This program is licensed under GPL2 Terms. http://pandorafms.com"
echo " " echo " "
@ -497,12 +504,12 @@ case "$MODE" in
'--install') '--install')
install "$@" install "$@"
exit exit 0
;; ;;
'--uninstall') '--uninstall')
uninstall "$@" uninstall "$@"
exit exit 0
;; ;;
*) *)