2008-03-19 11:12:45 +01:00
#
2008-09-08 18:12:57 +02:00
# Pandora FMS Server
2008-03-19 11:12:45 +01:00
#
2009-08-19 03:41:25 +02:00
%define name pandorafms_server
2009-06-30 11:10:58 +02:00
%define version 3.0.0
2009-07-10 08:36:23 +02:00
%define release 1
2009-06-30 11:10:58 +02:00
2008-09-08 18:12:57 +02:00
Summary: Pandora FMS Server
2008-03-19 11:12:45 +01:00
Name: %{name}
Version: %{version}
2009-06-30 11:10:58 +02:00
Release: %{release}
2008-03-19 11:12:45 +01:00
License: GPL
2009-08-19 03:41:25 +02:00
Vendor: ArticaST <http://www.artica.es>
2008-03-19 11:12:45 +01:00
Source0: %{name}-%{version}.tar.gz
2008-09-08 18:12:57 +02:00
URL: http://www.pandorafms.com
2008-03-19 11:12:45 +01:00
Group: System/Monitoring
2009-08-19 09:12:56 +02:00
Packager: Manuel Arostegui <manuel@todo-linux.com>
2008-03-19 11:12:45 +01:00
Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-buildroot
2009-07-10 08:36:23 +02:00
BuildArchitectures: noarch
2009-06-30 11:10:58 +02:00
Requires(pre): /usr/sbin/useradd
2008-03-19 11:12:45 +01:00
AutoReq: 0
Provides: %{name}-%{version}
2009-08-19 21:49:55 +02:00
Requires: perl-mail-sendmail perl-DBI perl-DBD-mysql perl-time-format
Requires: perl-mail-sendmail perl-netaddr-ip perl-SNMP net-snmp
2009-09-04 14:18:42 +02:00
Requires: nmap wmic sudo
2008-03-19 11:12:45 +01:00
%description
2009-08-19 03:41:25 +02:00
Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments.
2008-03-19 11:12:45 +01:00
%prep
rm -rf $RPM_BUILD_ROOT
%setup -q -n pandora_server
%build
%install
2009-08-19 03:41:25 +02:00
#%define perl_version %(rpm -q --queryformat='%{VERSION}' perl)
#export perl_version=`rpm -q --queryformat='%{VERSION}' perl`
# Temporal hack for For SLES 11 only, warning
export perl_version=5.10.0
%define perl_version 5.10.0
2008-03-19 11:12:45 +01:00
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/bin/
2009-06-30 11:10:58 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/local
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
2009-06-30 11:50:35 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
2008-03-19 11:12:45 +01:00
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
mkdir -p $RPM_BUILD_ROOT/etc/pandora/
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in
2009-08-28 13:07:52 +02:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/conf
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/md5
2008-03-19 11:12:45 +01:00
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
2009-06-30 11:10:58 +02:00
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/$perl_version/
2009-08-19 03:41:25 +02:00
cp -aRf bin/pandora_server $RPM_BUILD_ROOT/usr/local/bin/
2009-06-30 11:10:58 +02:00
cp -aRf util/pandora_exec $RPM_BUILD_ROOT/usr/local/bin/
cp -aRf bin/tentacle_server $RPM_BUILD_ROOT/usr/local/bin/
2009-08-19 03:41:25 +02:00
#cp -aRf util/wmic $RPM_BUILD_ROOT/usr/bin/
2009-06-30 11:10:58 +02:00
cp -aRf conf/* $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
cp -aRf util $RPM_BUILD_ROOT%{prefix}/pandora_server/
cp -aRf lib/* $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/$perl_version/
2009-08-19 03:41:25 +02:00
#cp -aRf util/Time/ $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/$perl_version/
#cp -aRf util/Traceroute/ $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/$perl_version/Net
#cp -aRf util/Traceroute.pm $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/$perl_version/Net
2009-06-30 11:10:58 +02:00
cp -aRf AUTHORS COPYING ChangeLog README $RPM_BUILD_ROOT%{prefix}/pandora_server/
2009-08-19 03:41:25 +02:00
cp -aRf pandora_server $RPM_BUILD_ROOT/etc/init.d/
cp -aRf util/tentacle_serverd $RPM_BUILD_ROOT/etc/init.d/
2008-03-19 11:12:45 +01:00
%clean
rm -fr $RPM_BUILD_ROOT
2009-06-30 11:10:58 +02:00
%pre
2009-08-19 03:41:25 +02:00
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
2009-06-30 11:10:58 +02:00
exit 0
2008-03-19 11:12:45 +01:00
%post
2009-09-01 18:27:36 +02:00
chkconfig -s pandora_server on
chkconfig -s tentacle_serverd on
2009-08-19 03:41:25 +02:00
echo "/usr/share/pandora_server/util/pandora_db /etc/pandora/pandora_server.conf" > /etc/cron.daily/pandora_db
chmod 750 /etc/cron.daily/pandora_db
2009-09-01 18:27:36 +02:00
cp -aRf util/pandora_logrotate /etc/logrotate.d/pandora
2009-06-30 11:10:58 +02:00
if [ ! -d /etc/pandora ] ; then
mkdir -p /etc/pandora
fi
2009-08-19 03:41:25 +02:00
if [ ! -e /etc/pandora/pandora_server.conf ] ; then
2009-06-30 11:10:58 +02:00
ln -s /usr/share/pandora_server/conf/pandora_server.conf /etc/pandora/
2009-08-19 03:41:25 +02:00
echo "Pandora FMS Server configuration is /etc/pandora/pandora_server.conf"
echo "Pandora FMS Server main directory is %{prefix}/pandora_server/"
2009-06-30 11:10:58 +02:00
echo "The manual can be reached at: man pandora or man pandora_server"
2009-08-19 03:41:25 +02:00
echo "Pandora FMS Documentation is in: http://pandorafms.org"
echo " "
2009-06-30 11:10:58 +02:00
fi
2009-08-19 03:41:25 +02:00
/etc/init.d/tentacle_serverd start
2009-06-30 11:10:58 +02:00
%preun
2009-08-23 23:49:25 +02:00
/etc/init.d/pandora_server stop &>/dev/null
/etc/init.d/tentacle_serverd stop &>/dev/null
2009-09-01 18:27:36 +02:00
chkconfig -d pandora_server
chkconfig -d tentacle_serverd
2009-06-30 11:10:58 +02:00
2008-03-19 11:12:45 +01:00
%files
2009-06-30 11:10:58 +02:00
2009-08-19 03:41:25 +02:00
%defattr(750,pandora,root)
2008-03-19 11:12:45 +01:00
/etc/init.d/pandora_server
2009-06-30 11:10:58 +02:00
/etc/init.d/tentacle_serverd
2009-09-04 14:18:42 +02:00
%defattr(755,pandora,root)
2009-06-30 11:10:58 +02:00
/usr/local/bin/pandora_exec
/usr/local/bin/pandora_server
/usr/local/bin/tentacle_server
2008-03-19 11:12:45 +01:00
2009-08-19 03:41:25 +02:00
%defattr(755,pandora,root)
2009-06-30 11:10:58 +02:00
/usr/lib/perl5/site_perl/%{perl_version}/PandoraFMS/
%{prefix}/pandora_server
2008-03-19 11:12:45 +01:00
/var/log/pandora
2009-06-30 11:10:58 +02:00
2009-08-19 03:41:25 +02:00
%defattr(770,pandora,www)
/var/spool/pandora
%defattr(750,pandora,root)
/etc/pandora
2009-06-30 11:50:35 +02:00