Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > deecb6b6a05b8293e284be1ad9b5f073 > files > 39

xymon-4.3.17-5.1.mga5.src.rpm

Name:             xymon
Version:          4.3.17
%define subrel	  1
Release:          %mkrel 5
Summary:          A system for monitoring servers and networks
Group:            Monitoring
License:          GPLv2
URL:              http://xymon.sourceforge.net/
Source0:          http://prdownloads.sourceforge.net/xymon/%{name}-%{version}.tar.gz
# Extracted FHS moves, a few fixes and these sources from:
# http://terabithia.org/rpms/xymon/f20/xymon-4.3.17-1.fc20.src.rpm
Source1:          xymonlaunch.default
Source2:          xymon-client.default
Source3:          xymon.README.terabithia
Source4:          xymon.service
Source5:          xymon-tmpfiles.conf
Source6:          xymon.sections.mounts
Source7:          xymon.sections.meminfo
Source8:          xymon.sections.vmstats
Source9:          xymon.sections.ipcs
Source10:         xymonreports.daily.task
Source11:         xymonreports.weekly.task
Source12:         xymonreports.monthly.task
Source13:         xymon-README.install.urpmi
Source14:         xymon-README.4.3.17.update.urpmi

Patch1:           xymon-4.3.17-first-fhs-moves.patch
Patch2:           xymon-4.3.17-disable-client-and-multiserv.patch
Patch3:           xymon-4.3.17-set-client-home.patch
Patch4:           xymon-4.3.17-remove-slash-from-alias.patch
Patch5:           xymon-4.3.17-pid-control-and-logging.patch
Patch6:           xymon-4.3.17-user-libs.patch
Patch7:           xymon-4.3.17-log-fetch.patch
Patch8:           xymon-4.3.17-noenv-and-timeout.patch
Patch9:           xymon-4.3.17-use-timeout-and-retries.patch
Patch10:          xymon-4.3.17-run-directory.patch
Patch11:          xymon-4.3.17-fix-multiclient-lockup.patch
Patch12:          xymon-4.3.17-run-directory-tasks.patch
Patch13:          xymon-4.3.17-remove-nohup.patch
Patch14:          xymon-4.3.17-environ-path-fix.patch
Patch15:          xymon-4.3.17-www-cache-dir.patch
Patch16:          xymon-4.3.17-stop-core-flood.patch
Patch17:          xymon-4.3.17-mdstat-support.patch
Patch18:	  xymon-4.3.17-acknowledge-overflow.patch
Patch19:	  xymon-4.3.17-CVE-2016-2054.patch
Patch20:	  xymon-4.3.17-CVE-2016-2055-doc.patch
Patch21:	  xymon-4.3.17-CVE-2016-2055.patch
Patch22:	  xymon-4.3.17-CVE-2016-2056-adduser.patch
Patch23:	  xymon-4.3.17-CVE-2016-2056-htpasswd.patch
Patch24:	  xymon-4.3.17-CVE-2016-2057.patch
Patch25:	  xymon-4.3.17-CVE-2016-2058-1.patch
Patch26:	  xymon-4.3.17-CVE-2016-2058-2.patch
Patch27:	  xymon-4.3.17-CVE-2016-2058-3.patch

BuildRequires:    c-ares-devel >= 1.10.0
BuildRequires:    openssl-devel
BuildRequires:    pcre-devel
BuildRequires:    rrdtool-devel
BuildRequires:    openldap-devel
BuildRequires:    net-snmp-devel
BuildRequires:    systemd
Requires:         apache
Requires:         fping
Requires:         ntp
Requires(pre):    apache
Requires(post):   systemd
Requires(preun):  systemd
Requires(postun): systemd
Recommends:         syslog-daemon
Recommends:         logrotate
Conflicts:        xymon-client < %{version}
Requires:         xymon-client >= %{version}

%description
Xymon monitors your hosts, your network services, and anything else you
configure it to do via extensions. Xymon will periodically generate
requests to network services - HTTP, FTP, SMTP and so on - and record if
the service is responding as expected. Through the use of agents
installed on the servers (the xymon-client package), you can also
monitor local disk utilization, log files and processes.

Xymon is the successor to the BBGEN toolkit, which has been available as
an add-on to Big Brother since late 2002. It was also previously known
as Hobbit. If you have used BBGEN before, Xymon will seem quite
familiar.

You should install this package if you want this machine to monitor 
services running on other machines.

%package client
Summary:        The reporting client service for the Xymon monitoring system
Group:          Monitoring

%description client
This package contains a client/agent for the Xymon monitor. Clients
report data about the local system to the monitor, allowing it to check
on the status of the system load, file system utilization, processes that
must be running, and so forth.

If you want to perform local threshold configuration (rarely needed),
you'll also need to install the xymon-client-local package.

# xymon server directories
%define xymonServerRoot           %{_datadir}/%{name}
%define xymonServerConfDir        %{_sysconfdir}/%{name}
%define xymonServerLibexec        %{_libexecdir}/%{name}
# xymon client directories
%define clientName                %{name}-client
%define xymonClientRoot           %{_datadir}/%{clientName}
%define xymonClientConfDir        %{_sysconfdir}/%{clientName}
%define xymonClientLibexec        %{_libexecdir}/%{clientName}
%define localClientDirectory      %{_prefix}/local/share/%{clientName}
# xymon server web directories
%define wwwDirectory              %{_localstatedir}/www/%{name}
%define wwwCacheDirectory         %{_localstatedir}/cache/%{name}
%define wwwStaticDirectory        %{xymonServerRoot}/static
%define webDirectory              %{xymonServerConfDir}/web
%define tmpDirectoryServer        %{_localstatedir}/lib/%{name}/tmp
# xymon common directories
%define logDirectory              %{_localstatedir}/log/%{name}
%define libDirectory              %{_localstatedir}/lib/%{name}
%define runDirectory              /run/%{name}
%define tmpDirectoryClient        /dev/shm

%prep
%setup -q
%apply_patches

%build
# Convert remaining configure-time tweaked paths to their fixed equivalents.
# eg, /usr/share/xymon/etc/tasks.cfg is now:
#     /etc/xymon/tasks.cfg
find -type f > tmp.flist
find xymond/ xymongen/ xymonnet/ xymonproxy/ -type f > tmp.slist
xargs -r %{__perl} -p \
        -e 's#\@XYMONTOPDIR\@/server/bin/xymond\b#%{_sbindir}/xymond#g;'        \
        -e 's#\@XYMONTOPDIR\@/server/bin/xymonlaunch\b#%{_sbindir}/xymonlaunch#g;'      \
        -e 's#\@XYMONTOPDIR\@/server/bin#%{xymonServerLibexec}#g;'       \
        -e 's#\@XYMONTOPDIR\@/server/etc#%{xymonServerConfDir}#g;'       \
        -e 's#\@XYMONTOPDIR\@/server/ext#%{xymonServerConfDir}/ext#g;' \
        -e 's#\@XYMONTOPDIR\@/client/bin/xymonlaunch\b#%{_sbindir}/xymonlaunch#g;'      \
        -e 's#\@XYMONTOPDIR\@/client/bin#%{xymonClientLibexec}#g;'       \
        -e 's#\@XYMONTOPDIR\@/client/etc#%{xymonClientConfDir}#g;'       \
        -e 's#\@XYMONTOPDIR\@/client/ext#%{xymonClientRoot}/ext#g;'     \
        -e 's#\@XYMONTOPDIR\@/client"#%{xymonClientRoot}"#g;'           \
                -i < tmp.flist
xargs -r %{__perl} -p \
        -e 's#\@XYMONHOME\@/bin#%{xymonServerLibexec}#g;' \
        -e 's#\@XYMONHOME\@/etc#%{xymonServerConfDir}#g;' \
        -e 's#\@XYMONHOME\@/ext#%{xymonServerConfDir}/ext#g;' \
                -i < tmp.slist
rm -f tmp.flist tmp.slist
# Remove any patch debris from the /docs/ directory
find docs/manpages/ -type f | grep -v .html$ | xargs -r rm

# Remove hard-coded compiler options so we can use our own in the build system
%{__sed} -e 's/^CC/#CC/g; s/^CFLAGS/#CFLAGS/g;' -i build/Makefile.Linux

export  CC="gcc" \
        CFLAGS="%{optflags} -pthread" \
        USEXYMONPING=n \
        USERFPING=%{_sbindir}/fping \
        ENABLESSL=y \
        SSLOK=YES \
        ENABLELDAP=y \
        ENABLELDAPSSL=y \
        CONFTYPE=server \
        XYMONUSER=xymon \
        XYMONTOPDIR=%{xymonServerRoot} \
        XYMONVAR=%{libDirectory} \
        XYMONHOSTURL=/xymon \
        CGIDIR=%{xymonServerRoot}/cgi-bin \
        XYMONCGIURL=/xymon-cgi \
        SECURECGIDIR=%{xymonServerRoot}/cgi-secure \
        SECUREXYMONCGIURL=/xymon-seccgi \
        HTTPDGID=apache \
        XYMONLOGDIR=%{logDirectory} \
        XYMONRUNDIR=%{runDirectory}     \
        XYMONHOSTNAME=localhost \
        XYMONHOSTIP=127.0.0.1 \
        MANROOT=%{_mandir} \
        INSTALLBINDIR=%{xymonServerLibexec} \
        INSTALLETCDIR=%{xymonServerConfDir} \
        INSTALLEXTDIR=%{xymonServerConfDir}/ext \
        INSTALLWEBDIR=%{webDirectory} \
        INSTALLTMPDIR=%{tmpDirectoryServer} \
        INSTALLWWWDIR=%{wwwDirectory} \
        INSTALLSTATICWWWDIR=%{wwwStaticDirectory} \
        SNMP=1

# this is not gnu autoconf -- can't use macro
./configure
make PKGBUILD=1

%install
install -d %{buildroot}%{wwwCacheDirectory}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_sbindir}
make PKGBUILD=1 INSTALLROOT=%{buildroot} install

install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
# Fix a utf8 warning from rpmlint
iconv --from=ISO-8859-1 --to=UTF-8 CREDITS > CREDITS.utf8 && \
      touch -r CREDITS CREDITS.utf8 && mv CREDITS.utf8 CREDITS

# Move client home directory to /usr/share/xymon-client
mv %{buildroot}%{xymonServerRoot}/client %{buildroot}%{xymonClientRoot}
ln -s %{xymonClientRoot} %{buildroot}%{xymonServerRoot}/client

# Handled below
rm -f %{buildroot}%{xymonClientRoot}/{local,sections}/README
install -m 644 %{SOURCE3} README.terabithia
install -m 644 %{SOURCE13} README.install.urpmi
install -m 644 %{SOURCE14} README.4.3.17.update.urpmi

# Install init systemd unit file.
# NB: the systemd "xymon" service file is unified -- it runs xymonlaunch,
#   which will look in the package-designated location for a xymonserver.cfg
#   and then a xymonclient.cfg file. There is no xymon/xymon-client service difference.
#
# Remove installed run scripts
rm -f %{buildroot}%{xymonServerLibexec}/xymon-client.init
rm -f %{buildroot}%{xymonServerLibexec}/xymon.sh
rm -f %{buildroot}%{xymonClientRoot}/runclient.sh
rm -f %{buildroot}%{xymonServerRoot}/xymon.sh

# Install xymon unit file
install -d %{buildroot}%{_unitdir}
install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/xymon.service
install -d %{buildroot}%{_tmpfilesdir}
install -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf

# Install the apache config and touch htpasswd files
touch %{buildroot}%{xymonServerConfDir}/xymonpasswd
touch %{buildroot}%{xymonServerConfDir}/xymongroups
install -d %{buildroot}%{_sysconfdir}/httpd/conf/sites.d

# Convert config to apache 2.4 format
%{__sed} -e 's/Indexes FollowSymLinks.*/FollowSymLinks/;' \
         -e 's/Order allow,deny/Require all granted/; s/Allow from all//;' \
         -e 's/ Includes//;' \
         %{buildroot}%{xymonServerConfDir}/xymon-apache.conf > \
           %{buildroot}%{_sysconfdir}/httpd/conf/sites.d/%{name}.conf
rm -f %{buildroot}%{xymonServerConfDir}/xymon-apache.conf

touch %{buildroot}%{xymonServerConfDir}/snmphosts.cfg

# Certs = config files
install -d %{buildroot}%{xymonServerConfDir}/certs
ln -s %{xymonServerConfDir}/certs %{buildroot}%{xymonServerRoot}/certs

# Dynamically create these directories if/when needed
rmdir %{buildroot}%{wwwDirectory}/{html,notes,rep,snap,wml} 
rmdir %{buildroot}%{libDirectory}/logs                # this is for [storestatus], not /var/log/xymon

# we've moved the positions of some of these directories
%{__sed} -e 's#\$XYMONWWWDIR/rep#%{wwwCacheDirectory}/rep#g;'    \
         -e 's#\$XYMONWWWDIR/snap#%{wwwCacheDirectory}/snap#g;'  \
         -e 's#\$XYMONHOME/static#%{wwwStaticDirectory}#g;'      \
         -e 's#\$XYMONHOME/www#%{wwwDirectory}#g;'               \
         -i %{buildroot}%{xymonServerConfDir}/xymonserver.cfg


# logrotate scripts for servers and clients
# make sure we kill xymonlaunch, which is the only constant -- it's been patched to HUP as needed
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 rpm/xymon.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/xymon
%{__sed} -e 's#/var/log/xymon/\*.log#%{logDirectory}/*.log#;' \
         -e 's#/etc/init.d/xymon rotate#killall -HUP xymonlaunch >/dev/null 2>/dev/null#;' \
         -i %{buildroot}%{_sysconfdir}/logrotate.d/xymon
cp -fp %{buildroot}%{_sysconfdir}/logrotate.d/xymon %{buildroot}%{_sysconfdir}/logrotate.d/xymon-client

# sysconfig files:
#       -- xymonlaunch used for runtime for servers and clients
#       -- xymon-client used for specifying client destination addresses
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/xymonlaunch
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{clientName}

mv -f %{buildroot}%{wwwStaticDirectory}/gifs/README README.gifs
find %{buildroot}%{wwwStaticDirectory} -type f | xargs -r chmod 644

# disable "clientupdate", which won't/shouldn't work on RPM systems
rmdir %{buildroot}%{xymonServerRoot}/download/
rm -f %{buildroot}%{xymonClientRoot}/bin/clientupdate
rm -f %{buildroot}%{_mandir}/*/clientupdate.*


# remove unneeded HOME variables
%{__sed} -e 's#\$XYMONHOME/bin#%{xymonClientLibexec}#g;' \
         -e 's#\$XYMONHOME/etc#%{xymonClientConfDir}#g;' \
         -e 's#\$XYMONHOME/#%{xymonClientRoot}/#g;'      \
         -i %{buildroot}%{xymonClientRoot}/etc/xymonclient.cfg %{buildroot}%{xymonClientRoot}/bin/xymonclient.sh

%{__sed} -e 's#\$XYMONHOME/bin#%{xymonServerLibexec}#g;' \
         -e 's#\$XYMONHOME/etc#%{xymonServerConfDir}#g;' \
         -i %{buildroot}%{xymonServerConfDir}/xymonserver.cfg

# Since environment is always set, full pathnames aren't needed
%{__sed} -e 's#CMD \$XYMONCLIENTHOME/bin/#CMD #g;'  \
         -e 's#CMD %{xymonClientLibexec}/#CMD #g;'  \
         -e 's#CMD \$XYMONHOME/ext/#CMD %{xymonServerConfDir}/ext/#g;' \
         -e 's#CMD \$XYMONHOME/bin/#CMD #g;'        \
         -e 's#\$XYMONHOME/logs#%{logDirectory}#g;' \
         -i %{buildroot}%{xymonServerConfDir}/tasks.cfg

%{__sed} -e 's#CMD \$XYMONCLIENTHOME/bin/#CMD #g;'                           \
         -e 's#CMD \$XYMONCLIENTHOME/ext/#CMD %{xymonClientConfDir}/ext/#g;' \
         -e 's#\$XYMONCLIENTHOME/etc#%{xymonClientConfDir}#g;'               \
         -e 's#CMD %{xymonServerRoot}/client/bin/#CMD #g;'                   \
         -i %{buildroot}%{xymonClientRoot}/etc/clientlaunch.cfg

%{__sed} -e 's#\$XYMONHOME/bin#%{xymonServerLibexec}#g;' \
         -i %{buildroot}%{xymonServerLibexec}/*.sh

if [ -f %{buildroot}%{xymonServerConfDir}/ext/xymonnet-again.sh ] ; then
      %{__sed} -e 's#\$XYMONHOME/bin#%{xymonServerLibexec}#g;' \
               -i %{buildroot}%{xymonServerConfDir}/ext/xymonnet-again.sh 
fi

# Move client-ish client binaries to /usr/bin
pushd %{buildroot}%{xymonClientRoot}
  for this in xymon xymoncfg xymoncmd xymondigest xymongrep logfetch msgcache; do
     mv -f bin/$this %{buildroot}%{_bindir}/$this
     ln -s %{_bindir}/$this bin/$this
  done

# Move server-ish client binaries to /usr/sbin
  for this in xymonlaunch; do
     mv -f bin/$this %{buildroot}%{_sbindir}/$this
     ln -s %{_sbindir}/$this bin/$this
  done

# Put the rest of the home directory in their proper places
  mv -f bin %{buildroot}%{xymonClientLibexec}
  mv -f etc %{buildroot}%{xymonClientConfDir}
  ln -s %{xymonClientLibexec}  bin
  ln -s %{xymonClientConfDir}  etc
  rmdir local logs
  ln -s %{logDirectory} logs
popd

# Move server-ish server binaries to /usr/sbin
# (xymonlaunch overwrites "server-ish client binaries" above)
pushd %{buildroot}%{xymonServerLibexec}
  for this in xymond xymonlaunch; do
     mv -f $this %{buildroot}%{_sbindir}/$this
     ln -s %{_sbindir}/$this $this
  done
popd

# Make sure XYMONTMP and PATH are always set properly
%{__sed} -e 's#XYMONTMP=".*"#XYMONTMP="%{tmpDirectoryServer}"#g;' \
         -i %{buildroot}%{xymonServerConfDir}/xymonserver.cfg
%{__sed} -e 's#XYMONTMP=".*"#XYMONTMP="%{tmpDirectoryClient}"#g;' \
         -i %{buildroot}%{xymonClientConfDir}/xymonclient.cfg
%{__sed} -e 's#PATH="#PATH="%{xymonServerLibexec}:#' \
         -i %{buildroot}%{xymonServerConfDir}/xymonserver.cfg
%{__sed} -e 's#PATH="#PATH="%{xymonClientLibexec}:#' \
         -i %{buildroot}%{xymonClientConfDir}/xymonclient.cfg

# Shamelessly steal the mandrake logging slot
%{__sed} -e 's/mandrake/mageia/' -i %{buildroot}%{xymonServerConfDir}/client-local.cfg

# Now that XYMOMTMP is hard-coded to where we need it; remove extraneous symlinks which RPM complains about
rmdir %{buildroot}%{xymonClientRoot}/tmp
rm -f %{buildroot}%{xymonServerRoot}/tmp

# Big Brother compatibility symlinks
ln -s xymon %{buildroot}%{_bindir}/bb
ln -s xymoncmd %{buildroot}%{_bindir}/bbcmd
ln -s %{_bindir}/xymon %{buildroot}%{xymonClientLibexec}/bb
ln -s %{_bindir}/xymoncmd %{buildroot}%{xymonClientLibexec}/bbcmd
ln -s xymon.1 %{buildroot}%{_mandir}/man1/bb.1
ln -s xymoncmd.1 %{buildroot}%{_mandir}/man1/bbcmd.1

# Since it's writable by apache, move critical.cfg out of /etc/xymon
install -d %{buildroot}%{libDirectory}/configs/
mv %{buildroot}%{xymonServerConfDir}/critical.cfg %{buildroot}%{libDirectory}/configs/critical.cfg
rm -f %{buildroot}%{xymonServerConfDir}/critical.cfg.bak
ln -s %{libDirectory}/configs/critical.cfg %{buildroot}%{xymonServerConfDir}/critical.cfg
mv %{buildroot}%{xymonClientRoot}/ext %{buildroot}%{xymonClientConfDir}/ext
ln -s %{xymonClientConfDir}/ext %{buildroot}%{xymonClientRoot}/ext

# Create /etc/xymon*/*.d/ configuration directories
# For the server
for THIS in alerts analysis graphs combo protocols tasks; do
    install -d %{buildroot}%{xymonServerConfDir}/${THIS}.d
done

# For the client
install -d %{buildroot}%{xymonClientConfDir}/client.d

echo "
# Include add-on modules -- do not confuse with /local/ scripts, 
# which are tests inserted directly into the client report
directory %{xymonClientConfDir}/client.d" >> %{buildroot}%{xymonClientConfDir}/clientlaunch.cfg

# Add sections to client
install -m 755 %{SOURCE6} %{buildroot}%{xymonClientRoot}/sections/mounts
install -m 755 %{SOURCE7} %{buildroot}%{xymonClientRoot}/sections/meminfo
install -m 755 %{SOURCE8} %{buildroot}%{xymonClientRoot}/sections/vmstats
install -m 755 %{SOURCE9} %{buildroot}%{xymonClientRoot}/sections/ipcs

# Automatic periodic SLA reports (daily/weekly/monthly)
install -m 644 %{SOURCE10} %{buildroot}%{xymonServerConfDir}/tasks.d/dailyreport
install -m 644 %{SOURCE11} %{buildroot}%{xymonServerConfDir}/tasks.d/weeklyreport
install -m 644 %{SOURCE12} %{buildroot}%{xymonServerConfDir}/tasks.d/monthlyreport


%pre
if [ $1 -eq 2 ]; then
   # old service needs manual stop
   [[ -e %{__service} ]] && %{__service} %{name} stop 2> /dev/null || :
fi
# Add xymon user, if needed
%_pre_useradd %{name} %{xymonServerRoot} /dev/null


%pre client
if [ $1 -eq 2 ]; then
   # old service needs manual stop
   [[ -e %{__service} ]] && %{__service} %{clientName} stop 2> /dev/null || :
fi
# Add xymon user, if needed
%_pre_useradd %{name} %{xymonServerRoot} /dev/null


%preun
%_preun_unit xymon

%preun client
%_preun_unit xymon


%post
if [ "$1" -eq 2 ]; then
   # Use settings from previous version hosts file
   if [ -f "%{xymonServerConfDir}/bb-hosts" ]; then
      %{__cat} "%{xymonServerConfDir}/bb-hosts" | \
      %{__sed} -e 's/bb-hosts/hosts.cfg/g' > "%{xymonServerConfDir}/hosts.cfg"
   fi 
fi

# Remove references to old server location in xymonserver.cfg
%{__sed} -e 's#/usr/share/xymon/server#/usr/share/xymon#' -i %{xymonServerConfDir}/xymonserver.cfg

# Create symbolic link for backward compatibility
if [ ! -e "%{xymonServerRoot}/server" ] ; then
   %{__ln_s} "%{xymonServerRoot}" "%{xymonServerRoot}/server" || :
fi
# add unit file or init script; restart if already running
%_post_unit xymon

%post client
if [ "$1" -eq 2 ]; then
   # Update old client enviroment file
   %{__sed} -e 's/HOBBIT/XYMON/g' -i "%{_sysconfdir}/sysconfig/%{clientName}"
fi

%_tmpfilescreate %{name}
# add unit file or init script; restart if already running
%_post_unit xymon


%pretrans
# Previous version will leave the /usr/share/xymon/www during upgrade, which
# interferes with creating a symbolic link is same location. It needs to be moved.
if [ -d "%{xymonServerRoot}/www" -a ! -h "%{xymonServerRoot}/www" ]; then
   if [ ! -d "%{wwwDirectory}" ]; then
      %__mkdir -p "%{wwwDirectory}"
   fi
   # Move old gifs and help directory contents to new location to save any custom icons.
   mv -f "%{xymonServerRoot}/www/gifs" "%{wwwDirectory}/"
   mv -f "%{xymonServerRoot}/www/help" "%{wwwDirectory}/"
   # This directory should be empty
   rm -rf "%{xymonServerRoot}/www"
   %{__ln_s} "%{wwwDirectory}" "%{xymonServerRoot}/www" 
fi

%posttrans
# See note on 4.3.17 upgrade in post
if [ ! -e "%{xymonServerRoot}/server" ] ; then
   %{__ln_s} "%{xymonServerRoot}" "%{xymonServerRoot}/server" || :
fi


%files
%defattr(-,root,root)
%doc README README.CLIENT README.backfeed README.gifs Changes CREDITS RELEASENOTES
%attr(755,xymon,xymon) %{wwwDirectory}
%attr(755,apache,apache) %{wwwCacheDirectory}
%attr(755,xymon,xymon) %dir %{libDirectory}
%attr(755,xymon,xymon) %{libDirectory}/acks
%attr(755,xymon,xymon) %{libDirectory}/d*
%attr(755,xymon,xymon) %{libDirectory}/h*
%attr(755,xymon,xymon) %{libDirectory}/rrd
%attr(755,xymon,xymon) %{libDirectory}/tmp
%attr(755,apache,apache) %dir %{libDirectory}/configs
%config(noreplace) %{_sysconfdir}/httpd/conf/sites.d/xymon.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %{xymonServerConfDir}
%{xymonServerConfDir}/ext
%{xymonServerConfDir}/ext/xymonnet-again.sh
%{xymonServerConfDir}/certs
%{xymonServerConfDir}/*.d
%config(noreplace) %{xymonServerConfDir}/*.cfg
%exclude %{xymonServerConfDir}/snmphosts.cfg
%config(noreplace) %{xymonServerConfDir}/columndoc.csv
%config(noreplace) %ghost %{xymonServerConfDir}/xymonpasswd
%config(noreplace) %ghost %{xymonServerConfDir}/xymongroups
%config(noreplace) %ghost %{xymonServerConfDir}/snmphosts.cfg
%dir %{webDirectory}
%config(noreplace) %{webDirectory}/*
%{xymonServerLibexec}
%{xymonClientLibexec}/xymonclient-*.sh
%exclude %{xymonClientLibexec}/xymonclient.sh
%exclude %{xymonClientLibexec}/xymonclient-linux.sh
%{_sbindir}/xymond
%{xymonServerRoot}/bin
%{xymonServerRoot}/certs
%{xymonServerRoot}/cgi-bin
%{xymonServerRoot}/cgi-secure
%{xymonServerRoot}/client
%{xymonServerRoot}/etc
%{xymonServerRoot}/ext
%{xymonServerRoot}/web
%{xymonServerRoot}/www
%{wwwStaticDirectory}
%attr(755,apache,apache) %ghost %{libDirectory}/configs/critical.cfg*
%{xymonClientRoot}
%{_mandir}/*/*
%exclude %{_mandir}/man1/bb.1.*
%exclude %{_mandir}/man1/bbcmd.1.*
%exclude %{_mandir}/man1/logfetch.1.*
%exclude %{_mandir}/man1/orcaxymon.1.*
%exclude %{_mandir}/man1/xymon.1.*
%exclude %{_mandir}/man1/xymoncfg.1.*
%exclude %{_mandir}/man1/xymoncmd.1.*
%exclude %{_mandir}/man1/xymondigest.1.*
%exclude %{_mandir}/man1/xymongrep.1.*
%exclude %{_mandir}/man5/clientlaunch.cfg.5.*
%exclude %{_mandir}/man5/xymonclient.cfg.5.*
%exclude %{_mandir}/man8/msgcache.8.*
%exclude %{_mandir}/man5/analysis.cfg.5.*
%exclude %{_mandir}/man8/xymond_client.8.*


%files client
%doc README README.CLIENT README.gifs Changes CREDITS RELEASENOTES
%doc README.terabithia client/README-local client/README-sections
%doc README.install.urpmi README.4.3.17.update.urpmi
%attr(755,xymon,xymon) %{logDirectory}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{clientName}
%config(noreplace) %{_sysconfdir}/sysconfig/xymonlaunch
%config(noreplace) %{_sysconfdir}/sysconfig/%{clientName}
%config(noreplace) %{xymonClientConfDir}/*.cfg
%{_bindir}/*
%{xymonClientRoot}
%dir %{xymonClientConfDir}
%{xymonClientConfDir}/ext
%{xymonClientConfDir}/client.d
%{_unitdir}/xymon.service
%{_tmpfilesdir}/%{name}.conf
%{xymonClientLibexec}/bb*
%{xymonClientLibexec}/logfetch
%{xymonClientLibexec}/msgcache
%{xymonClientLibexec}/orcaxymon
%{xymonClientLibexec}/xymon
%{xymonClientLibexec}/xymoncfg
%{xymonClientLibexec}/xymoncmd
%{xymonClientLibexec}/xymondigest
%{xymonClientLibexec}/xymonlaunch
%{xymonClientLibexec}/xymongrep
%{xymonClientLibexec}/xymonclient.sh
%{xymonClientLibexec}/xymonclient-linux.sh
%{_sbindir}/xymonlaunch
%{_mandir}/man1/bb.1.*
%{_mandir}/man1/bbcmd.1.*
%{_mandir}/man1/logfetch.1.*
%{_mandir}/man1/orcaxymon.1.*
%{_mandir}/man1/xymon.1.*
%{_mandir}/man1/xymoncfg.1.*
%{_mandir}/man1/xymoncmd.1.*
%{_mandir}/man1/xymondigest.1.*
%{_mandir}/man1/xymongrep.1.*
%{_mandir}/man5/analysis.cfg.5.*
%{_mandir}/man5/clientlaunch.cfg.5.*
%{_mandir}/man5/xymonclient.cfg.5.*
%{_mandir}/man8/xymond_client.8.*
%{_mandir}/man8/msgcache.8.*


%changelog
* Mon Feb 29 2016 luigiwalser <luigiwalser> 4.3.17-5.1.mga5
+ Revision: 981086
- add patches from debian to fix CVE-2015-205[4-8]

* Fri Jan 30 2015 luigiwalser <luigiwalser> 4.3.17-5.mga5
+ Revision: 812785
- add upstream patch to fix buffer overflow (CVE-2015-1430)

* Sat Oct 18 2014 diogenese <diogenese> 4.3.17-4.mga5
+ Revision: 781470
- Fixed _pre_useradd parameters
- Removed unused sources
- Fixed _pre_useradd parameters
- Removed unused sources

* Wed Oct 15 2014 umeabot <umeabot> 4.3.17-3.mga5
+ Revision: 745886
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 4.3.17-2.mga5
+ Revision: 690808
- Mageia 5 Mass Rebuild

  + tv <tv>
    - s/uggests:/Recommends:/

* Tue Aug 19 2014 diogenese <diogenese> 4.3.17-1.mga5
+ Revision: 665747
- Update xymon from 4.2.3 to 4.3.17.
- Update xymon from 4.2.3 to 4.3.17. Again
- Update xymon from 4.2.3 to 4.3.17

* Sat Oct 19 2013 umeabot <umeabot> 4.2.3-16.mga4
+ Revision: 531795
- Mageia 4 Mass Rebuild

* Sun Aug 11 2013 luigiwalser <luigiwalser> 4.2.3-15.mga4
+ Revision: 465364
- convert apache 2.2 syntax in conf file to apache 2.4 syntax

* Mon Aug 05 2013 tmb <tmb> 4.2.3-14.mga4
+ Revision: 463996
- Guard against directory traversal via hostname (mga #10874, P14, CVE-2013-4173)

* Tue Jun 04 2013 fwang <fwang> 4.2.3-13.mga4
+ Revision: 436913
- rebuild for new libpng

* Mon Jan 14 2013 umeabot <umeabot> 4.2.3-12.mga3
+ Revision: 387536
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sat Dec 01 2012 fwang <fwang> 4.2.3-11.mga3
+ Revision: 323861
- rebuild for new pcre

* Sun Apr 29 2012 colin <colin> 4.2.3-10.mga2
+ Revision: 234197
- Add LSB headers to initscripts (mga#5262)

* Sun Feb 19 2012 pterjan <pterjan> 4.2.3-9.mga2
+ Revision: 210578
- Mageia is notmdk but should require apache, not httpd

  + ahmad <ahmad>
    - imported package xymon