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

This commit is contained in:
Junichi Satoh 2022-07-20 14:10:37 +09:00
parent 385610fef6
commit 44cc9898c2
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/
#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
#if [ \( $item != 'temp_package' \) -a \( $item != 'NT4' \) ]
#then
@ -133,9 +133,9 @@ echo "END"
echo "Make the package \"Pandorafms agent\"."
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
eval $DPKG_DEB --root-owner-group --build temp_package
else
dpkg-deb --build temp_package
dpkg-deb --root-owner-group --build temp_package
fi
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
Installed-Size: 42112
Maintainer: Artica ST <deptec@artica.es>
Homepage: http://pandorafms.org/
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
Homepage: https://pandorafms.com/
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.

View File

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

View File

@ -1,20 +1,15 @@
#!/bin/bash
echo Change the user and group to /var/www/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/pandora_console
chgrp www-data /var/www/pandora_console -R
chown www-data /var/www/pandora_console -R
if [ -d /var/www/html ]; then mv /var/www/pandora_console /var/www/html/; fi
echo Change the user and group to /var/www/html/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/html/pandora_console
chgrp www-data /var/www/html/pandora_console -R
chown www-data /var/www/html/pandora_console -R
if [ -f /etc/init.d/apache2 ]; then
echo Restart the apache.
/etc/init.d/apache2 restart
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 " /etc/init.d/pandora_websocket_engine start"