2006-12-29 09:42:35 +01:00
|
|
|
#
|
2008-09-22 19:33:31 +02:00
|
|
|
# Pandora FMS Console
|
2006-12-29 09:42:35 +01:00
|
|
|
#
|
|
|
|
%define name PandoraFMS_Console
|
2009-06-25 20:55:16 +02:00
|
|
|
%define version 3.0.0
|
2006-12-29 09:42:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
%define httpd_name httpd
|
|
|
|
# User and Group under which Apache is running
|
|
|
|
# Red Hat: apache:apache
|
|
|
|
%define httpd_user apache
|
|
|
|
%define httpd_group apache
|
|
|
|
# OpenSUSE: wwwrun:www
|
|
|
|
%if "%{_vendor}" == "suse"
|
|
|
|
%define httpd_name apache2
|
|
|
|
%define httpd_user wwwrun
|
|
|
|
%define httpd_group www
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Red Hat
|
|
|
|
# Apache server is packaged under the name of:
|
|
|
|
# - apache: up to Red Hat 9.0, FC6 and Red Hat Enterprise 2.1
|
|
|
|
# - httpd: after these releases above
|
|
|
|
%define is_rh7 0
|
|
|
|
%define is_el2 0
|
|
|
|
%define is_centos2 0
|
2007-04-16 10:11:37 +02:00
|
|
|
%define is_fedora 0
|
2006-12-29 09:42:35 +01:00
|
|
|
%if %(test -f "/etc/redhat-release" && echo 1 || echo 0)
|
|
|
|
%define is_rh7 %(test -n "`cat /etc/redhat-release | grep '(Valhalla)'`" && echo 1 || echo 0)
|
|
|
|
%define is_el2 %(test -n "`cat /etc/redhat-release | grep '(Pensacola)'`" && echo 1 || echo 0)
|
|
|
|
%define is_centos2 %(test -n "`cat /etc/redhat-release | grep 'CentOS release 2'`" && echo 1 || echo 0)
|
2006-12-29 11:30:57 +01:00
|
|
|
%define is_fedora %(test -n "`cat /etc/redhat-release | grep 'Fedora'`" && echo 1 || echo 0)
|
2006-12-29 09:42:35 +01:00
|
|
|
%endif
|
|
|
|
%define is_apache 0
|
|
|
|
%if %{is_rh7}
|
|
|
|
%define is_apache 1
|
|
|
|
%endif
|
|
|
|
%if %{is_el2}
|
|
|
|
%define is_apache 1
|
|
|
|
%endif
|
|
|
|
%if %{is_centos2}
|
|
|
|
%define is_apache 1
|
2006-12-29 11:30:57 +01:00
|
|
|
%if %{is_fedora}
|
|
|
|
%define is_apache 1
|
|
|
|
%endif
|
2006-12-29 09:42:35 +01:00
|
|
|
%endif
|
|
|
|
# Evaluate PHP version
|
|
|
|
%define phpver_lt_430 %(out=`rpm -q --queryformat='%{VERSION}' php` 2>&1 >/dev/null || out=0 ; out=`echo $out | tr . : | sed s/://g` ; if [ $out -lt 430 ] ; then out=1 ; else out=0; fi ; echo $out)
|
|
|
|
|
2009-08-11 19:14:21 +02:00
|
|
|
Summary: Pandora FMS Console
|
2006-12-29 09:42:35 +01:00
|
|
|
Name: %{name}
|
|
|
|
Version: %{version}
|
2009-06-25 20:55:16 +02:00
|
|
|
Release: 1
|
2006-12-29 09:42:35 +01:00
|
|
|
License: GPL
|
2009-08-11 19:14:21 +02:00
|
|
|
Vendor: Artica ST <info@artica.es>
|
2006-12-29 09:42:35 +01:00
|
|
|
Source0: %{name}-%{version}.tar.gz
|
2008-09-22 19:33:31 +02:00
|
|
|
URL: http://www.pandorafms.com
|
2007-01-08 10:05:32 +01:00
|
|
|
Group: Productivity/Networking/Web/Utilities
|
2006-12-29 09:42:35 +01:00
|
|
|
Packager: Manuel Arostegui <marostegui@artica.es>
|
|
|
|
|
|
|
|
%if "%{_vendor}" == "suse"
|
2008-03-19 13:14:29 +01:00
|
|
|
Prefix: /srv/www/htdocs
|
2006-12-29 09:42:35 +01:00
|
|
|
%else
|
2006-12-29 11:30:57 +01:00
|
|
|
Prefix: /var/www/html
|
2006-12-29 09:42:35 +01:00
|
|
|
%endif
|
2007-01-04 11:42:10 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}
|
2006-12-29 09:42:35 +01:00
|
|
|
BuildArchitectures: noarch
|
|
|
|
|
|
|
|
AutoReq: 0
|
|
|
|
%if "%{_vendor}" == "suse"
|
|
|
|
Requires: apache2
|
2008-03-19 13:14:29 +01:00
|
|
|
Requires: php >= 4.3.0
|
2009-06-25 20:55:16 +02:00
|
|
|
Requires: php-gd, php-snmp, php-pear
|
|
|
|
Requires: mysql, php-mysql
|
|
|
|
Requires: graphviz
|
2006-12-29 09:42:35 +01:00
|
|
|
|
|
|
|
%else
|
|
|
|
%if %{is_apache}
|
|
|
|
Requires: apache
|
|
|
|
%else
|
|
|
|
Requires: httpd
|
|
|
|
%endif
|
2009-07-09 11:04:00 +02:00
|
|
|
Requires: httpd mysql-server php-pear php-mysql php-pear-DB php-gd php-snmp php-ldap php-mbstring net-snmp-perl net-snmp-utils graphviz-php
|
2006-12-29 09:42:35 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
Provides: %{name}-%{version}
|
|
|
|
|
|
|
|
%description
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%setup -q -n pandora_console
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2007-02-02 11:48:47 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_console
|
|
|
|
cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_console
|
2009-06-25 20:55:16 +02:00
|
|
|
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_console/pandora_console.spec ] ; then
|
|
|
|
rm $RPM_BUILD_ROOT%{prefix}/pandora_console/pandora_console.spec
|
2006-12-29 09:42:35 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
%post
|
2009-08-11 19:14:21 +02:00
|
|
|
echo "Please, now, point your browser to http://your_ip_address/pandora_console/install.php and follow all the steps described on it."
|
2009-06-25 20:55:16 +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
|
|
|
|
else
|
|
|
|
pear install DB
|
2009-08-11 19:14:21 +02:00
|
|
|
echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it."
|
2009-06-25 20:55:16 +02:00
|
|
|
fi
|
2006-12-29 09:42:35 +01:00
|
|
|
%files
|
|
|
|
%defattr(0644,%{httpd_user},%{httpd_group},0755)
|
2007-02-02 11:48:47 +01:00
|
|
|
%docdir %{prefix}/pandora_console/docs
|
|
|
|
%{prefix}/pandora_console
|