Merge branch 'ent-fix-deb-package-creation' into 'develop'

Fixed deb package creation scripts to work with recent Ubuntu, 20.04 LTS and 22.04 LTS.

See merge request artica/pandorafms!5026
This commit is contained in:
vgilc 2022-07-20 06:01:00 +00:00
commit 762959b85f
5 changed files with 26 additions and 29 deletions

View File

@ -61,7 +61,7 @@ chmod 755 -R temp_package/DEBIAN
#cp -aRf * temp_package/usr/share/pandora_agent/ #cp -aRf * temp_package/usr/share/pandora_agent/
#but don't copy recursive the temp_package into temp_package #but don't copy recursive the temp_package into temp_package
for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v HP-UX | grep -v SunOS | grep -v temp_package` for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v NetBSD | grep -v HP-UX | grep -v SunOS | grep -v Darwin | grep -v OpenWRT | grep -v pandorafms.agent_unix | grep -v temp_package`
do do
#if [ \( $item != 'temp_package' \) -a \( $item != 'NT4' \) ] #if [ \( $item != 'temp_package' \) -a \( $item != 'NT4' \) ]
#then #then
@ -133,9 +133,9 @@ echo "END"
echo "Make the package \"Pandorafms agent\"." echo "Make the package \"Pandorafms agent\"."
if [ "$USE_DOCKER_APP" == "1" ]; then if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package eval $DPKG_DEB --root-owner-group --build temp_package
else else
dpkg-deb --build temp_package dpkg-deb --root-owner-group --build temp_package
fi fi
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb

View File

@ -1 +0,0 @@
/var/www/pandora_console/include/config.php

View File

@ -5,6 +5,6 @@ Priority: optional
Section: admin Section: admin
Installed-Size: 42112 Installed-Size: 42112
Maintainer: Artica ST <deptec@artica.es> Maintainer: Artica ST <deptec@artica.es>
Homepage: http://pandorafms.org/ Homepage: https://pandorafms.com/
Depends: php | php7.2, php7.2-snmp | php-snmp, php7.2-gd | php-gd, php7.2-mysqlnd | php-mysqlnd, php-db, php7.2-xmlrpc | php-xmlrpc, php-gettext, php7.2-curl | php-curl, graphviz, dbconfig-common, php7.2-ldap | php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php7.2-zip | php-zip Depends: php, php-snmp, php-gd, php-mysqlnd, php-db, php-xmlrpc, php-curl, graphviz, dbconfig-common, php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php-zip, php-mbstring
Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process. Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process.

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
#Pandora FMS- http:#pandorafms.com #Pandora FMS - https://pandorafms.com
# ================================================== # ==================================================
# Copyright (c) 2005-2021 Artica Soluciones Tecnologicas # Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
# Please see http:#pandorafms.org for full contribution list # Please see http:#pandorafms.org for full contribution list
@ -94,17 +94,19 @@ echo "Make a \"temp_package\" temporary dir for job."
mkdir -p temp_package mkdir -p temp_package
if [ $package_pandora -eq 1 ] if [ $package_pandora -eq 1 ]
then then
mkdir -p temp_package/var/www/pandora_console mkdir -p temp_package/var/www/html/pandora_console
mkdir -p temp_package/var/log/pandora
mkdir -p temp_package/etc/logrotate.d mkdir -p temp_package/etc/logrotate.d
mkdir -p temp_package/etc/init.d
echo "Make directory system tree for package." echo "Make directory system tree for package."
cp -R $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console cp -R $(ls | grep -v temp_package | grep -v DEBIAN | grep -v pandorafms.console_$pandora_version.deb) temp_package/var/www/html/pandora_console
cp -R DEBIAN temp_package cp -R DEBIAN temp_package
cp -aRf pandora_console_logrotate_ubuntu temp_package/etc/logrotate.d/pandora_console cp -aRf pandora_console_logrotate_ubuntu temp_package/etc/logrotate.d/pandora_console
find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf cp -aRf pandora_websocket_engine temp_package/etc/init.d/
rm -Rf temp_package/var/www/pandora_console/pandora_console.spec find temp_package/var/www/html/pandora_console -name ".svn" | xargs rm -Rf
rm -Rf temp_package/var/www/html/pandora_console/pandora_console.spec
chmod 755 -R temp_package/DEBIAN chmod 755 -R temp_package/DEBIAN
touch temp_package/var/www/pandora_console/include/config.php
echo "Remove the SVN files and other temp files." echo "Remove the SVN files and other temp files."
@ -128,30 +130,31 @@ then
echo "END" echo "END"
echo "Calculate md5sum for md5sums package control file." echo "Calculate md5sum for md5sums package control file."
for item in `find temp_package` FILES=`find temp_package`
while read item
do do
echo -n "." echo -n "."
if [ ! -d $item ] if [ ! -d "$item" ]
then then
echo $item | grep "DEBIAN" > /dev/null echo "$item" | grep "DEBIAN" > /dev/null
#last command success #last command success
if [ $? -eq 1 ] if [ $? -eq 1 ]
then then
md5=`md5sum $item | cut -d" " -f1` md5=`md5sum "$item" | cut -d" " -f1`
#delete "temp_package" in the path #delete "temp_package" in the path
final_path=${item#temp_package} final_path=${item#temp_package}
echo $md5" "$final_path >> temp_package/DEBIAN/md5sums echo $md5" "$final_path >> temp_package/DEBIAN/md5sums
fi fi
fi fi
done done < <(echo "$FILES")
echo "END" echo "END"
echo "Make the package \"Pandorafms console\"." echo "Make the package \"Pandorafms console\"."
if [ "$USE_DOCKER_APP" == "1" ]; then if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package eval $DPKG_DEB --root-owner-group --build temp_package
else else
dpkg-deb --build temp_package dpkg-deb --root-owner-group --build temp_package
fi fi
mv temp_package.deb pandorafms.console_$pandora_version.deb mv temp_package.deb pandorafms.console_$pandora_version.deb
fi fi

View File

@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash
echo Change the user and group to /var/www/pandora_console. echo Change the user and group to /var/www/html/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/pandora_console chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/html/pandora_console
chgrp www-data /var/www/pandora_console -R chgrp www-data /var/www/html/pandora_console -R
chown www-data /var/www/pandora_console -R chown www-data /var/www/html/pandora_console -R
if [ -d /var/www/html ]; then mv /var/www/pandora_console /var/www/html/; fi
if [ -f /etc/init.d/apache2 ]; then if [ -f /etc/init.d/apache2 ]; then
echo Restart the apache. echo Restart the apache.
/etc/init.d/apache2 restart /etc/init.d/apache2 restart
fi fi
# Install pandora_websocket_engine service.
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
chmod +x /etc/init.d/pandora_websocket_engine
echo "You can now start the Pandora FMS Websocket service by executing" echo "You can now start the Pandora FMS Websocket service by executing"
echo " /etc/init.d/pandora_websocket_engine start" echo " /etc/init.d/pandora_websocket_engine start"