2010-09-26 18:07:28 +02:00
#
# Pandora FMS Console
#
2023-09-28 10:42:39 +02:00
%global _missing_build_ids_terminate_build 0
%define __strip /bin/true
%define debug_package %{nil}
2010-09-26 18:07:28 +02:00
%define name pandorafms_console
2023-12-21 17:13:20 +01:00
%define version 7.0NG.775
2024-02-28 01:00:06 +01:00
%define release 240228
2010-11-08 15:57:49 +01:00
2010-09-26 18:07:28 +02:00
# User and Group under which Apache is running
%define httpd_name httpd
%define httpd_user apache
%define httpd_group apache
Summary: Pandora FMS Console
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
2023-06-29 16:06:25 +02:00
Vendor: Pandora FMS <info@pandorafms.com>
2010-09-26 18:07:28 +02:00
#Source0: %{name}-%{version}-%{revision}.tar.gz
Source0: %{name}-%{version}.tar.gz
URL: http://www.pandorafms.com
Group: Productivity/Networking/Web/Utilities
Packager: Sancho Lerena <slerena@artica.es>
Prefix: /var/www/html
BuildRoot: %{_tmppath}/%{name}
2023-09-12 16:46:05 +02:00
BuildArch: x86_64
2010-09-26 18:07:28 +02:00
AutoReq: 0
2012-06-27 09:16:00 +02:00
Requires: %{httpd_name} >= 2.0.0
2023-02-02 11:34:23 +01:00
Requires: php >= 8.0
2012-06-27 09:16:00 +02:00
Requires: php-gd, php-ldap, php-snmp, php-session, php-gettext
2018-10-29 16:11:29 +01:00
Requires: php-mysqlnd, php-mbstring, php-zip, php-zlib, php-curl
2018-12-03 17:02:09 +01:00
Requires: xorg-x11-fonts-75dpi, xorg-x11-fonts-misc, php-pecl-zip
2010-11-25 18:46:50 +01:00
Requires: graphviz
2022-06-14 16:55:25 +02:00
Requires: openldap-clients libzstd
2010-09-26 18:07:28 +02:00
Provides: %{name}-%{version}
2011-08-19 18:39:09 +02:00
2010-09-26 18:07:28 +02:00
%description
2010-12-17 10:58:21 +01:00
The Web Console is a web application that allows to see graphical reports, state of every agent, also to access to the information sent by the agent, to see every monitored parameter and to see its evolution throughout the time, to form the different nodes, groups and users of the system. It is the part that interacts with the final user, and that will allows you to administer the system.
2010-09-26 18:07:28 +02:00
%prep
rm -rf $RPM_BUILD_ROOT
%setup -q -n pandora_console
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_console
2015-11-02 16:52:30 +01:00
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
2020-05-19 16:27:17 +02:00
cp -aRf . $RPM_BUILD_ROOT%{prefix}/pandora_console
2010-09-26 18:07:28 +02:00
rm $RPM_BUILD_ROOT%{prefix}/pandora_console/*.spec
rm $RPM_BUILD_ROOT%{prefix}/pandora_console/pandora_console_install
2015-11-16 17:29:58 +01:00
install -m 0644 pandora_console_logrotate_centos $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_console
2010-09-26 18:07:28 +02:00
%clean
rm -rf $RPM_BUILD_ROOT
%post
2021-06-14 13:56:42 +02:00
# Upgrading.
if [ "$1" -eq "1" ]; then
echo "Updating the database schema."
/usr/bin/php %{prefix}/pandora_console/godmode/um_client/updateMR.php 2>/dev/null
fi
2019-11-08 09:49:09 +01:00
# 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"
2010-09-26 18:07:28 +02:00
# Has an install already been done, if so we only want to update the files
# push install.php aside so that the console works immediately using existing
# configuration.
#
if [ -f %{prefix}/pandora_console/include/config.php ] ; then
mv %{prefix}/pandora_console/install.php %{prefix}/pandora_console/install.done
2023-02-01 16:26:03 +01:00
# Upgrading MR.
echo "Updating the database schema."
/usr/bin/php %{prefix}/pandora_console/godmode/um_client/updateMR.php 2>/dev/null
2010-09-26 18:07:28 +02:00
else
echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it."
fi
2023-08-08 14:51:32 +02:00
# Delete old dprecated files
if [ -f %{prefix}/pandora_console/extras/delete_files/delete_files.txt ] ; then
echo "Deleting old deprecated files"
cd %{prefix}/pandora_console/
rm -rf `cat extras/delete_files/delete_files.txt`
2023-08-08 15:17:13 +02:00
cd - > /dev/null
echo "Done deleting deprecated files"
2023-08-08 14:51:32 +02:00
fi
2010-09-26 18:07:28 +02:00
%preun
# Upgrading
2021-06-14 13:56:42 +02:00
if [ "$1" -eq "1" ]; then
2010-09-26 18:07:28 +02:00
exit 0
fi
%files
%defattr(0644,%{httpd_user},%{httpd_group},0755)
%docdir %{prefix}/pandora_console/docs
%{prefix}/pandora_console
2015-11-02 16:52:30 +01:00
%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_console
2020-01-30 13:08:56 +01:00
%attr(0644, root, root) %{_sysconfdir}/logrotate.d/pandora_console
2023-09-14 12:03:51 +02:00
%defattr(0744,%{httpd_user},%{httpd_group},0755)
%{prefix}/pandora_console/attachment/discovery