"Fossies" - the Fresh Open Source Software Archive

Member "unix/pandora_agent.redhat.spec" (15 Sep 2021, 5159 Bytes) of package /linux/misc/pandorafms_agent_unix-7.0NG.757.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) RPM Spec source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "pandora_agent.redhat.spec": 7.0NG.756_vs_7.0NG.757.

    1 #
    2 #Pandora FMS Linux Agent
    3 #
    4 %define name        pandorafms_agent_unix
    5 %define version     7.0NG.757
    6 %define release     210915
    7 
    8 Summary:            Pandora FMS Linux agent, PERL version
    9 Name:               %{name}
   10 Version:            %{version}
   11 Release:            %{release}
   12 License:            GPL
   13 Vendor:             ArticaST <http://www.artica.es>
   14 Source0:            %{name}-%{version}.tar.gz
   15 URL:                http://pandorafms.org
   16 Group:              System/Monitoring
   17 Packager:           Sancho Lerena <slerena@artica.es>
   18 Prefix:             /usr/share
   19 BuildRoot:          %{_tmppath}/%{name}-%{version}-buildroot
   20 BuildArch:          noarch
   21 Requires(pre):      shadow-utils
   22 Requires(post):     chkconfig /bin/ln
   23 Requires(preun):    chkconfig /bin/rm /usr/sbin/userdel
   24 Requires:           coreutils unzip
   25 Requires:           util-linux procps grep
   26 Requires:           /sbin/ip /bin/awk
   27 Requires:           perl perl(Sys::Syslog) perl(IO::Compress::Zip)
   28 # Required by plugins
   29 #Requires:           sh-utils sed passwd net-tools rpm
   30 AutoReq:            0
   31 Provides:           %{name}-%{version}
   32 
   33 %description
   34 Pandora FMS agent for unix. Pandora FMS is an OpenSource full-featured monitoring software.
   35 
   36 %prep
   37 rm -rf $RPM_BUILD_ROOT
   38 
   39 %setup -q -n unix
   40 
   41 %build
   42 
   43 %install
   44 rm -rf $RPM_BUILD_ROOT
   45 mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/
   46 mkdir -p $RPM_BUILD_ROOT/usr/bin/
   47 mkdir -p $RPM_BUILD_ROOT/usr/sbin/
   48 mkdir -p $RPM_BUILD_ROOT/etc/pandora/
   49 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
   50 mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
   51 mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
   52 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
   53 cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/
   54 cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/
   55 cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/
   56 cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/
   57 cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/rc.d/init.d/pandora_agent_daemon
   58 cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
   59 cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
   60 
   61 cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
   62 
   63 install -m 0644 pandora_agent_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_agent
   64 
   65 if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
   66     rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
   67 fi
   68 
   69 %clean
   70 rm -Rf $RPM_BUILD_ROOT
   71 
   72 %pre
   73 getent passwd pandora >/dev/null || \
   74     /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
   75 exit 0
   76 chown pandora:root /var/log/pandora
   77 
   78 %post
   79 if [ ! -d /etc/pandora ] ; then
   80     mkdir -p /etc/pandora
   81 fi
   82 
   83 if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then
   84     cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf
   85 fi
   86 
   87 if [ ! -f /etc/pandora/pandora_agent.conf ] ; then
   88     ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf
   89 else
   90     [[ ! -f /etc/pandora/pandora_agent.conf.rpmnew ]] && ln -s /usr/share/pandora_agent/pandora_agent.conf.rpmnew /etc/pandora/pandora_agent.conf.rpmnew
   91 fi
   92 
   93 if [ ! -e /etc/pandora/plugins ]; then
   94     ln -s /usr/share/pandora_agent/plugins /etc/pandora
   95 fi
   96 
   97 if [ ! -e /etc/pandora/collections ]; then
   98     mkdir -p /usr/share/pandora_agent/collections
   99     ln -s /usr/share/pandora_agent/collections /etc/pandora
  100 fi
  101 
  102 if [ ! -e /etc/pandora/commands ]; then
  103     mkdir -p /usr/share/pandora_agent/commands
  104     ln -s /usr/share/pandora_agent/commands /etc/pandora
  105 fi
  106 
  107 mkdir -p /var/spool/pandora/data_out
  108 if [ ! -d /var/log/pandora ]; then
  109     mkdir -p /var/log/pandora
  110 fi
  111 
  112 if [ `command -v systemctl` ];
  113 then
  114     echo "Copying new version of pandora_agent_daemon service"
  115     cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/
  116     chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service
  117 # Enable the services on SystemD
  118     systemctl enable pandora_agent_daemon.service
  119 else
  120     /sbin/chkconfig --add pandora_agent_daemon
  121     /sbin/chkconfig pandora_agent_daemon on
  122 fi
  123 
  124 if [ "$1" -gt 1 ]
  125 then
  126 
  127       echo "If Pandora Agent daemon was running with init.d script,"
  128       echo "please stop it manually and start the service with systemctl"
  129 
  130 fi
  131 
  132 
  133 %preun
  134 
  135 # Upgrading
  136 if [ "$1" = "1" ]; then
  137     exit 0
  138 fi
  139 
  140 /sbin/chkconfig --del pandora_agent_daemon 
  141 /etc/rc.d/init.d/pandora_agent_daemon stop >/dev/null 2>&1 || :
  142 
  143 # Remove symbolic links
  144 pushd /etc/pandora
  145 for f in pandora_agent.conf plugins collections
  146 do
  147     [ -L $f ] && rm -f $f
  148 done
  149 exit 0
  150 
  151 %files
  152 %defattr(750,root,root)
  153 /usr/bin/pandora_agent
  154 
  155 %defattr(755,pandora,root)
  156 %{prefix}/pandora_agent
  157 
  158 %defattr(755,root,root)
  159 /usr/bin/pandora_agent_exec
  160 /usr/bin/tentacle_client
  161 /etc/rc.d/init.d/pandora_agent_daemon
  162 
  163 %defattr(644,root,root)
  164 /usr/share/man/man1/pandora_agent.1.gz
  165 /usr/share/man/man1/tentacle_client.1.gz
  166 %config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent