%define pia_ver 3.1
+%define php_min_version 5.2.13-10
+%include /usr/lib/rpm/macros.php
Summary: Cacti is a PHP frontend for rrdtool
Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
Name: cacti
-Version: 0.8.8a
+Version: 0.8.8f
Release: 1
License: GPL v2
Group: Applications/WWW
Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
-# Source0-md5: a4da682dab9a88a2e0edb1728bf531ae
+# Source0-md5: 8d90642b362f80c46c489c5531e2ba90
Source2: %{name}.crontab
Source3: %{name}-apache.conf
Source4: %{name}-lighttpd.conf
Patch7: %{name}-ss_disk-array-indices.patch
Patch8: host_name-url.patch
# http://www.cacti.net/download_patches.php
+# Patch100: ..
URL: http://www.cacti.net/
BuildRequires: sed >= 4.0
Requires(postun): /usr/sbin/userdel
Requires: crondaemon
Requires: group(http)
Requires: net-snmp-utils
-Requires: php(core) >= 5.2.13-10
+Requires: php(core) >= %{php_min_version}
Requires: php(mysql)
Requires: php(pcre)
Requires: php(session)
Requires: webserver(indexfile)
Requires: webserver(php)
Suggests: cacti-spine
+Suggests: php-bcmath
+Suggests: php-ftp
Suggests: php-gd
Provides: cacti(pia) = %{pia_ver}
Provides: user(cacti)
Obsoletes: cacti-add_template
Obsoletes: cacti-plugin-update
+%if "%{pld_release}" != "ac"
Conflicts: logrotate < 3.8.0
+%endif
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sysconfdir %{_webapps}/%{_webapp}
%define _appdir /usr/share/%{name}
+# bad depsolver
+%define _noautopear pear
+# optional
+%define _noautophp php-ftp php-bcmath
+
+# put it together for rpmbuild
+%define _noautoreq %{?_noautophp} %{?_noautopear}
+
%description
Cacti is a complete frondend to rrdtool, it stores all of the
nessesary information to create graphs and populate them with data in
%prep
%setup -q
+
# official patches
+%if 0%{?PATCH100:1}
+%patch100 -p1
+%endif
%patch0 -p1
%patch1 -p1
cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+%if "%{pld_release}" == "ac"
+%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+%endif
+
cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
fi
-%{_appdir}/cli/upgrade_database.php || :
-
%postun
if [ "$1" = "0" ]; then
%userremove cacti
fi
+%post setup
+%{_appdir}/cli/upgrade_database.php || :
+
%triggerin -- apache1 < 1.3.37-3, apache1-base
%webapp_register apache %{_webapp}