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
2010-06-08 19:00:23 +02:00
%define version 3.1
2010-05-20 17:18:25 +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-09-21 02:34:14 +02:00
Requires: perl-Mail-Sendmail perl-DBI perl-DBD-mysql perl-time-format
2009-10-27 21:58:38 +01:00
Requires: perl-NetAddr-IP net-snmp net-tools
2009-12-18 19:22:33 +01:00
Requires: nmap wmic sudo xprobe2
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-09-16 02:02:23 +02:00
#Uncomment this if you build from other RPM system (fedora, opensuse != 11..)
2009-08-19 03:41:25 +02:00
#%define perl_version %(rpm -q --queryformat='%{VERSION}' perl)
#export perl_version=`rpm -q --queryformat='%{VERSION}' perl`
2009-09-16 02:02:23 +02:00
2009-08-19 03:41:25 +02:00
# Temporal hack for For SLES 11 only, warning
2010-05-19 19:09:15 +02:00
#export perl_version=5.10.0
#%define perl_version 5.10.0
2009-08-19 03:41:25 +02:00
2008-03-19 11:12:45 +01:00
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/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
2010-07-19 12:17:17 +02:00
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/collections
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/
2010-05-19 19:09:15 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/
2010-06-09 13:45:18 +02:00
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
2009-09-16 02:02:23 +02:00
2009-12-18 19:22:33 +01:00
# All binaries go to /usr/bin
cp -aRf bin/pandora_server $RPM_BUILD_ROOT/usr/bin/
cp -aRf bin/pandora_exec $RPM_BUILD_ROOT/usr/bin/
cp -aRf bin/tentacle_server $RPM_BUILD_ROOT/usr/bin/
2009-09-16 02:02:23 +02:00
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/
2010-05-19 19:09:15 +02:00
cp -aRf lib/* $RPM_BUILD_ROOT/usr/lib/perl5/
2009-06-30 11:10:58 +02:00
cp -aRf AUTHORS COPYING ChangeLog README $RPM_BUILD_ROOT%{prefix}/pandora_server/
2009-09-16 02:02:23 +02:00
cp -aRf util/pandora_server $RPM_BUILD_ROOT/etc/init.d/
2009-08-19 03:41:25 +02:00
cp -aRf util/tentacle_serverd $RPM_BUILD_ROOT/etc/init.d/
2008-03-19 11:12:45 +01:00
2010-06-09 12:46:06 +02:00
cp -aRf man/man1/pandora_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
2010-06-09 13:34:49 +02:00
cp -aRf man/man1/tentacle_server.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
2010-06-09 12:46:06 +02:00
2010-05-20 16:16:43 +02:00
rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS
2008-03-19 11:12:45 +01:00
%clean
rm -fr $RPM_BUILD_ROOT
2009-12-18 19:22:33 +01:00
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-12-18 19:22:33 +01:00
if [ -e "/etc/pandora/pandora_server.conf" ]
then
cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
fi
2009-06-30 11:10:58 +02:00
exit 0
2008-03-19 11:12:45 +01:00
%post
2010-01-22 15:24:56 +01:00
chkconfig pandora_server on
chkconfig tentacle_serverd on
2009-12-18 19:22:33 +01:00
2009-09-25 02:09:15 +02:00
echo "/usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf" > /etc/cron.daily/pandora_db
2009-08-19 03:41:25 +02:00
chmod 750 /etc/cron.daily/pandora_db
2009-09-21 02:34:14 +02:00
cp -aRf /usr/share/pandora_server/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-12-28 19:00:53 +01:00
echo "Don't forget to start Tentacle Server daemon if you want to receive"
echo "data using tentacle"
2009-06-30 11:10:58 +02:00
%preun
2010-06-04 11:42:14 +02:00
# Upgrading
if [ "$1" = "1" ]; then
exit 0
fi
2009-08-23 23:49:25 +02:00
/etc/init.d/pandora_server stop &>/dev/null
/etc/init.d/tentacle_serverd stop &>/dev/null
2010-01-22 15:24:56 +01:00
chkconfig --del pandora_server
chkconfig --del tentacle_serverd
2009-06-30 11:10:58 +02:00
2009-09-30 02:00:22 +02:00
%postun
2010-06-04 12:37:26 +02:00
# Upgrading
if [ "$1" = "1" ]; then
exit 0
fi
2009-09-30 02:00:22 +02:00
rm -Rf /etc/init.d/tentacle_serverd
rm -Rf /etc/init.d/pandora_server
rm -Rf %{prefix}pandora_server
rm -Rf /var/log/pandora
2010-05-19 19:09:15 +02:00
rm -Rf /usr/lib/perl5/PandoraFMS/
2009-09-30 02:00:22 +02:00
rm -Rf /etc/pandora/pandora_server.conf
rm -Rf /var/spool/pandora
rm -Rf /etc/init.d/pandora_server /etc/init.d/tentacle_serverd
2009-12-18 19:22:33 +01:00
rm -Rf /usr/bin/pandora_exec /usr/bin/pandora_server /usr/bin/tentacle_server
2009-09-30 02:00:22 +02:00
rm -Rf /etc/cron.daily/pandora_db
rm -Rf /etc/logrotate.d/pandora
2010-06-09 12:46:06 +02:00
rm -Rf /usr/share/man/man1/pandora_server.1.gz
2010-06-09 13:34:49 +02:00
rm -Rf /usr/share/man/man1/tentacle_server.1.gz
2009-09-30 02:00:22 +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-12-18 19:22:33 +01:00
/usr/bin/pandora_exec
/usr/bin/pandora_server
/usr/bin/tentacle_server
2008-03-19 11:12:45 +01:00
2009-08-19 03:41:25 +02:00
%defattr(755,pandora,root)
2010-05-19 19:09:15 +02:00
/usr/lib/perl5/PandoraFMS/
2009-06-30 11:10:58 +02:00
%{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
2010-07-19 12:49:40 +02:00
/var/spool/pandora/data_in/md5
/var/spool/pandora/data_in/collections
2009-08-19 03:41:25 +02:00
%defattr(750,pandora,root)
/etc/pandora
2009-06-30 11:50:35 +02:00
2010-06-09 13:34:49 +02:00
%defattr(644,pandora,root)
/usr/share/man/man1/pandora_server.1.gz
/usr/share/man/man1/tentacle_server.1.gz