%define _modname rrdtool
-%define _sysconfdir /etc/php
-%define extensionsdir %(php-config --extension-dir 2>/dev/null)
Summary: RRDtool PHP module
Summary(pl): Modu³ PHP RRDtool
Name: php-rrdtool
Version: 1.2
-Release: 1
+Release: 2
License: GPL
Group: Applications/Databases
Source0: http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/contrib/php_rrdtool.tgz
BuildRequires: rrdtool-devel >= 1.2.10
BuildRequires: sed >= 4.0
%{?requires_php_extension}
-Requires: %{_sysconfdir}/conf.d
+Requires: php-common >= 4:5.0.4
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir}/conf.d,%{_examplesdir}/%{name}-%{version}}
+install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_examplesdir}/%{name}-%{version}}
%{__make} install \
INSTALL_ROOT=$RPM_BUILD_ROOT
-cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_modname}.ini
+cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{_modname}.ini
; Enable %{_modname} extension module
extension=%{_modname}.so
EOF
rm -rf $RPM_BUILD_ROOT
%post
-[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
+%php_webserver_restart
%postun
if [ "$1" = 0 ]; then
- [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
- [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
+ %php_webserver_restart
fi
%files
%defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{_modname}.ini
-%attr(755,root,root) %{extensionsdir}/%{_modname}.so
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{_modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{_modname}.so