"Fossies" - the Fresh Open Source Software Archive

Member "pandora_server/pandora_server.redhat.spec" (5 Nov 2021, 8334 Bytes) of package /linux/misc/pandorafms_server-7.0NG.758.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_server.redhat.spec": 7.0NG.757_vs_7.0NG.758.

    1 #
    2 # Pandora FMS Server 
    3 #
    4 %define name        pandorafms_server
    5 %define version     7.0NG.758
    6 %define release     211105
    7 
    8 Summary:            Pandora FMS Server
    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://www.pandorafms.com
   16 Group:              System/Monitoring
   17 Packager:           Sancho Lerena <slerena@artica.es>
   18 Prefix:             %{_datadir}
   19 BuildRoot:          %{_tmppath}/%{name}-buildroot
   20 BuildArchitectures: noarch 
   21 AutoReq:            0
   22 Provides:           %{name}-%{version}
   23 Requires(pre):      shadow-utils
   24 Requires(post,preun): /sbin/chkconfig /sbin/service
   25 Requires:           coreutils
   26 Requires:           perl(DBI) perl(DBD::mysql)
   27 Requires:           perl(HTTP::Request::Common) perl(LWP::Simple) perl(LWP::UserAgent)
   28 Requires:           perl(XML::Simple) perl(XML::Twig) net-snmp-utils
   29 Requires:           perl(NetAddr::IP) net-snmp net-tools
   30 Requires:           perl(IO::Socket::INET6) perl(IO::Socket::SSL) perl(Net::Telnet)
   31 Requires:           fping nmap sudo perl(JSON)
   32 Requires:           perl(Time::HiRes) perl(Encode::Locale)
   33 Requires:           perl perl(Sys::Syslog) perl(HTML::Entities) perl(Geo::IP)
   34 
   35 %description
   36 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.
   37 
   38 %prep
   39 rm -rf $RPM_BUILD_ROOT
   40 
   41 %setup -q -n pandora_server
   42 
   43 %build
   44 
   45 %install
   46 
   47 rm -rf $RPM_BUILD_ROOT
   48 mkdir -p $RPM_BUILD_ROOT%{_bindir}/
   49 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/
   50 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pandora/
   51 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tentacle/
   52 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in
   53 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/conf
   54 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/md5
   55 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/collections
   56 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/netflow
   57 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/trans
   58 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/commands
   59 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/pandora/
   60 mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
   61 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
   62 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
   63 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/
   64 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/pandora/.ssh
   65 mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/
   66 
   67 # All binaries go to %{_bindir}
   68 cp -aRf bin/pandora_server $RPM_BUILD_ROOT%{_bindir}/
   69 cp -aRf bin/pandora_exec $RPM_BUILD_ROOT%{_bindir}/
   70 install -m 0755 bin/tentacle_server $RPM_BUILD_ROOT%{_bindir}/
   71 
   72 cp -aRf conf/* $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
   73 cp -aRf util $RPM_BUILD_ROOT%{prefix}/pandora_server/
   74 cp -aRf util/pandora_ha.pl $RPM_BUILD_ROOT/usr/bin/pandora_ha
   75 cp -aRf lib/* $RPM_BUILD_ROOT/usr/lib/perl5/
   76 
   77 install -m 0755 util/pandora_server $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/
   78 install -m 0755 util/tentacle_serverd $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/
   79 
   80 install -m 0444 man/man1/pandora_server.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/
   81 install -m 0444 man/man1/tentacle_server.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/
   82 
   83 rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/PandoraFMS
   84 rm -f $RPM_BUILD_ROOT%{prefix}/pandora_server/util/recon_scripts/PandoraFMS
   85 
   86 if [ ! -f $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server ] ; then
   87    install -m 0644 util/pandora_server_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server
   88 fi
   89 install -m 0640 conf/pandora_server.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/pandora/pandora_server.conf.new
   90 install -m 0640 conf/tentacle_server.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/tentacle/tentacle_server.conf.new
   91 
   92 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d
   93 chmod 0750 $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d
   94 cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d/pandora
   95 Defaults:root !requiretty
   96 EOF
   97 chmod 0440 $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d/pandora
   98 
   99 cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/pandora_db
  100 #!/bin/bash
  101 %__perl %{prefix}/pandora_server/util/pandora_db.pl %{_sysconfdir}/pandora/pandora_server.conf
  102 EOF
  103 chmod 0755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/pandora_db
  104 
  105 %clean
  106 rm -fr $RPM_BUILD_ROOT
  107 
  108 %pre
  109 getent passwd pandora >/dev/null || \
  110     /usr/sbin/useradd -d %{prefix}/pandora_server -s /sbin/nologin -M -g 0 pandora
  111 
  112 exit 0
  113 
  114 %post
  115 # Initial installation
  116 # Run when not uninstalling
  117 if [ "$1" -ge 1 ]
  118 then
  119         if [ `command -v systemctl` ]
  120         then
  121                 echo "Copying new version for tentacle_serverd service"
  122                 cp -f /usr/share/pandora_server/util/tentacle_serverd.service /usr/lib/systemd/system/
  123                 chmod -x /usr/lib/systemd/system/tentacle_serverd.service
  124         # Enable the services on SystemD
  125                 systemctl enable tentacle_serverd.service     
  126         else
  127                 /sbin/chkconfig --add tentacle_serverd
  128                 /sbin/chkconfig tentacle_serverd on 
  129         fi
  130 
  131         /sbin/chkconfig --add pandora_server
  132         /sbin/chkconfig pandora_server on 
  133 
  134         systemctl enable pandora_server.service
  135 
  136         echo "Pandora FMS Server configuration is %{_sysconfdir}/pandora/pandora_server.conf"
  137         echo "Pandora FMS Server main directory is %{prefix}/pandora_server/"
  138         echo "The manual can be reached at: man pandora or man pandora_server"
  139         echo "Pandora FMS Documentation is in: http://pandorafms.org"
  140         echo " "
  141 fi
  142 
  143 # This will avoid config files overwritting on UPGRADES.
  144 # Main configuration file
  145 if [ ! -e "/etc/pandora/pandora_server.conf" ]
  146 then
  147         echo "Creating a new version of Pandora FMS Server config file at /etc/pandora/pandora_server.conf"
  148         cat /etc/pandora/pandora_server.conf.new > /etc/pandora/pandora_server.conf
  149 else
  150         # Do a copy of current .conf, just in case.
  151         echo "An existing version of pandora_server.conf is found."
  152         cat /etc/pandora/pandora_server.conf > /etc/pandora/pandora_server.conf.old
  153 fi
  154 # Tentacle server
  155 if [ ! -e "/etc/tentacle/tentacle_server.conf" ]
  156 then
  157         echo "Creating a new version of Tentacle Server config file at /etc/tentacle/tentacle_server.conf"
  158         cat /etc/tentacle/tentacle_server.conf.new > /etc/tentacle/tentacle_server.conf
  159 fi
  160 
  161 echo "Don't forget to start Tentacle Server daemon if you want to receive"
  162 echo "data using tentacle"
  163 
  164 if [ "$1" -gt 1 ]
  165 then
  166 
  167       echo "If Tentacle Server daemon was running with init.d script,"
  168       echo "please stop it manually and start the service with systemctl"
  169 
  170 fi
  171 
  172 %preun
  173 
  174 # Upgrading
  175 if [ "$1" = "1" ]; then
  176         exit 0
  177 fi
  178 
  179 /sbin/service pandora_server stop >/dev/null 2>&1 || :
  180 /sbin/service tentacle_serverd stop >/dev/null 2>&1 || :
  181 /sbin/chkconfig --del pandora_server
  182 /sbin/chkconfig --del tentacle_serverd
  183 
  184 exit 0
  185 
  186 %files
  187 %defattr(750,root,root)
  188 %doc AUTHORS COPYING README
  189 %{_sysconfdir}/rc.d/init.d/pandora_server
  190 %{_sysconfdir}/rc.d/init.d/tentacle_serverd
  191 %{_sysconfdir}/cron.hourly/pandora_db
  192 %config(noreplace) %{_sysconfdir}/sudoers.d/pandora
  193 %config(noreplace) %{_sysconfdir}/logrotate.d/pandora_server
  194 
  195 %defattr(755,pandora,root)
  196 %{prefix}/pandora_server
  197 /usr/lib/perl5/PandoraFMS
  198 
  199 %{_mandir}/man1/pandora_server.1.gz
  200 %{_mandir}/man1/tentacle_server.1.gz
  201 
  202 %defattr(750,pandora,root)
  203 %{_bindir}/pandora_exec
  204 %{_bindir}/pandora_server
  205 %{_bindir}/tentacle_server
  206 %{_bindir}/pandora_ha
  207 
  208 %dir %{_sysconfdir}/pandora
  209 %dir %{_localstatedir}/spool/pandora
  210 
  211 %defattr(-,pandora,root, 754)
  212 %dir %{_localstatedir}/log/pandora
  213 
  214 %defattr(600,root,root)
  215 /etc/pandora/pandora_server.conf.new
  216 
  217 %defattr(664,root,root)
  218 /etc/tentacle/tentacle_server.conf.new
  219 
  220 %defattr(-,pandora,apache,2770)
  221 %{_localstatedir}/spool/pandora
  222 %{_localstatedir}/spool/pandora/data_in
  223 %{_localstatedir}/spool/pandora/data_in/md5
  224 %{_localstatedir}/spool/pandora/data_in/collections
  225 %{_localstatedir}/spool/pandora/data_in/conf
  226 %{_localstatedir}/spool/pandora/data_in/netflow
  227 %{_localstatedir}/spool/pandora/data_in/trans
  228 %{_localstatedir}/spool/pandora/data_in/commands