mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2014-02-24 Sancho Lerena <slerena@artica.es>
* pandorafms-agent.spec: Lots of changes to adapt spec to fedora standards. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9460 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
264ce748d4
commit
8c59df9e43
@ -1,3 +1,7 @@
|
|||||||
|
2014-02-24 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
|
* pandorafms-agent.spec: Lots of changes to adapt spec to fedora standards.
|
||||||
|
|
||||||
2014-02-01 Sancho Lerena <slerena@artica.es>
|
2014-02-01 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* fedora_official_specs: Added new directory to maintain the official specs
|
* fedora_official_specs: Added new directory to maintain the official specs
|
||||||
|
@ -1,144 +1,105 @@
|
|||||||
#
|
Name: pandorafms-agent
|
||||||
# spec file for package pandorafms-agent
|
Version: 5.0
|
||||||
#
|
Release: 140223.sp3%{?dist}
|
||||||
# Pandora FMS Linux Agent
|
Summary: Host/service/network agent for Pandora FMS monitoring system
|
||||||
# Copyright (c) 2014 Sancho Lerena
|
License: GPLv2
|
||||||
# Licensed under GPL2 terms.
|
Vendor: Artica <http://www.artica.es>
|
||||||
# Please send bugfixes or comments to slerena@gmail.com
|
Source: http://code.pandorafms.com/static_download/pandorafms_agent_unix-5.0SP3.tar.gz
|
||||||
|
#Source: %{name}-%{version}.tar.gz
|
||||||
#
|
#Source0: http://code.pandorafms.com/static_download/pandorafms_agent_unix-5.0SP3.tar.gz
|
||||||
%define name pandorafms-agent
|
URL: http://pandorafms.com
|
||||||
%define version 5.0
|
Group: Applications/System
|
||||||
%define release 140201.sp3
|
#Prefix: /usr/share
|
||||||
|
#BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||||
Summary: Linux agent monitoring for Pandora FMS
|
BuildArch: noarch
|
||||||
Name: %{name}
|
Requires(pre): /bin/sed /bin/grep
|
||||||
Version: %{version}
|
Requires(pre): shadow-utils
|
||||||
Release: %{release}
|
Requires: coreutils unzip
|
||||||
License: GPL
|
Requires(preun): initscripts, chkconfig
|
||||||
Vendor: ArticaST <http://www.artica.es>
|
Requires(post): initscripts, chkconfig
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Requires(postun): initscripts
|
||||||
URL: http://pandorafms.com
|
|
||||||
Group: System/Monitoring
|
|
||||||
Packager: Sancho Lerena <slerena@gmail.es>
|
|
||||||
Prefix: /usr/share
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
|
||||||
BuildArch: noarch
|
|
||||||
Requires(pre): /bin/sed /bin/grep /usr/sbin/useradd
|
|
||||||
Requires: coreutils unzip
|
|
||||||
AutoReq: 0
|
|
||||||
Provides: %{name}-%{version}
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Pandora FMS agent for unix. Pandora FMS is an OpenSource full-featured monitoring software.
|
Pandora FMS agent for unix. Pandora FMS is a full-featured monitoring software.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%setup -q -n unix
|
%setup -q -n unix
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/bin/
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/pandora/
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
|
|
||||||
cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/init.d/pandora_agent_daemon
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/init.d/pandora_agent_daemon
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
|
|
||||||
|
|
||||||
# Checking old config file (if exists)
|
rm -rf %{buildroot}
|
||||||
if [ -f /etc/pandora/pandora_agent.conf ] ; then
|
mkdir -p %{buildroot}/usr/bin/
|
||||||
mv /etc/pandora/pandora_agent.conf /etc/pandora/pandora_agent.conf.backup
|
mkdir -p %{buildroot}/etc/pandora/
|
||||||
fi
|
mkdir -p %{buildroot}/etc/init.d/
|
||||||
|
mkdir -p %{buildroot}/var/log/pandora/
|
||||||
|
mkdir -p %{buildroot}/usr/share/man/man1/
|
||||||
|
|
||||||
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
|
install -m 0755 pandora_agent %{buildroot}%{_bindir}/pandora_agent
|
||||||
|
install -m 0755 pandora_agent_exec %{buildroot}%{_bindir}/pandora_agent_exec
|
||||||
|
install -m 0755 tentacle_client %{buildroot}%{_bindir}/tentacle_client
|
||||||
|
install -m 0755 pandora_agent_daemon %{buildroot}/etc/init.d/pandora_agent_daemon
|
||||||
|
install -m 0644 man/man1/pandora_agent.1.gz %{buildroot}/usr/share/man/man1/pandora_agent.1.gz
|
||||||
|
install -m 0644 man/man1/tentacle_client.1.gz %{buildroot}/usr/share/man/man1/tentacle_client.1.gz
|
||||||
|
install -m 0600 Linux/pandora_agent.conf %{buildroot}/etc/pandora/pandora_agent.conf
|
||||||
|
install -d -m 0755 %{buildroot}/etc/pandora/plugins
|
||||||
|
install -d -m 0755 %{buildroot}/etc/pandora/collections
|
||||||
|
|
||||||
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
|
# Copying all plugins inside plugin directory and set 755 perms on them
|
||||||
rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
|
cp plugins/* %{buildroot}/etc/pandora/plugins
|
||||||
fi
|
chmod 755 %{buildroot}/etc/pandora/plugins/*
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -Rf $RPM_BUILD_ROOT
|
rm -Rf %{buildroot}
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
getent passwd pandora >/dev/null || \
|
getent passwd pandora >/dev/null || \
|
||||||
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
|
/usr/sbin/useradd -d /etc/pandora -s /bin/false -M -g 0 pandora
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%post
|
%post
|
||||||
if [ ! -d /etc/pandora ] ; then
|
|
||||||
mkdir -p /etc/pandora
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then
|
if [ $1 -eq 1 ]; then
|
||||||
cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf
|
# Initial installation. Needed to start pandora agent
|
||||||
|
mkdir -p /var/spool/pandora/data_out
|
||||||
|
/sbin/chkconfig --add pandora_agent_daemon
|
||||||
|
/sbin/chkconfig pandora_agent_daemon on
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /etc/pandora/pandora_agent.conf ] ; then
|
|
||||||
ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf
|
|
||||||
else
|
|
||||||
ln -s /usr/share/pandora_agent/pandora_agent.conf.rpmnew /etc/pandora/pandora_agent.conf.rpmnew
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e /etc/pandora/plugins ]; then
|
|
||||||
ln -s /usr/share/pandora_agent/plugins /etc/pandora
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e /etc/pandora/collections ]; then
|
|
||||||
ln -s /usr/share/pandora_agent/collections /etc/pandora
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p /var/spool/pandora/data_out
|
|
||||||
/sbin/chkconfig --add pandora_agent_daemon
|
|
||||||
/sbin/chkconfig pandora_agent_daemon on
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
|
|
||||||
# Upgrading
|
# package removal, not upgrade
|
||||||
if [ "$1" = "1" ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
exit 0
|
/sbin/chkconfig --del pandora_agent_daemon
|
||||||
|
/etc/init.d/pandora_agent_daemon stop
|
||||||
|
/usr/sbin/userdel pandora
|
||||||
|
rm -Rf /var/log/pandora/pandora_agent* 2> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/sbin/chkconfig --del pandora_agent_daemon
|
|
||||||
/etc/init.d/pandora_agent_daemon stop
|
|
||||||
rm /etc/init.d/pandora_agent_daemon
|
|
||||||
/usr/sbin/userdel pandora
|
|
||||||
rm -Rf /etc/pandora/pandora_agent.conf
|
|
||||||
rm -Rf /var/log/pandora/pandora_agent* 2> /dev/null
|
|
||||||
rm -Rf /usr/share/pandora_agent
|
|
||||||
rm -Rf /usr/share/man/man1/pandora_agent.1.gz
|
|
||||||
rm -Rf /usr/share/man/man1/tentacle_client.1.gz
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(750,pandora,root)
|
%defattr(750,pandora,root)
|
||||||
/usr/bin/pandora_agent
|
/usr/bin/pandora_agent
|
||||||
/usr/bin/pandora_agent_exec
|
/usr/bin/pandora_agent_exec
|
||||||
|
/usr/bin/tentacle_client
|
||||||
|
/etc/init.d/pandora_agent_daemon
|
||||||
|
|
||||||
%defattr(-,pandora,root,770)
|
%defattr(-,pandora,root,770)
|
||||||
/var/log/pandora/
|
/var/log/pandora/
|
||||||
|
|
||||||
%defattr(755,pandora,root)
|
%defattr(600,pandora,root)
|
||||||
/usr/bin/tentacle_client
|
/etc/pandora/pandora_agent.conf
|
||||||
/etc/init.d/pandora_agent_daemon
|
/etc/pandora/collections
|
||||||
%docdir %{prefix}/pandora_agents/docs
|
/etc/pandora/plugins
|
||||||
%{prefix}/pandora_agent
|
|
||||||
|
|
||||||
%defattr(644,pandora,root)
|
%config /etc/pandora/pandora_agent.conf
|
||||||
|
|
||||||
|
%doc
|
||||||
/usr/share/man/man1/pandora_agent.1.gz
|
/usr/share/man/man1/pandora_agent.1.gz
|
||||||
/usr/share/man/man1/tentacle_client.1.gz
|
/usr/share/man/man1/tentacle_client.1.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sat Feb 01 2014 - slerena@gmail.com
|
* Sun Feb 23 2014 Sancho Lerena <slerena at gmail.com> - 5.0
|
||||||
|
- Several changes on SPEC to comply with Fedora standards. This one pass rpmlint
|
||||||
|
|
||||||
|
* Sat Feb 01 2014 Sancho Lerena <slerena at gmail.com> - 5.0
|
||||||
- First version, after re-re-re-reading the fedora contributor guidelines :)
|
- First version, after re-re-re-reading the fedora contributor guidelines :)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user