%define _modname tcpwrap
%define _status stable
+%define _sysconfdir /etc/php
+%define extensionsdir %(php-config --extension-dir 2>/dev/null)
+
Summary: %{_modname} - tcpwrapper bindings
Summary(pl): %{_modname} - dowi±zania tcpwrapper
Name: php-pecl-%{_modname}
# Source0-md5: ed68d289c6ce0155b2bd6e62b6ed0996
URL: http://pecl.php.net/package/tcpwrap/
BuildRequires: libwrap-devel
-BuildRequires: php-devel
-Requires: php-common
+BuildRequires: php-devel >= 3:5.0.0
+BuildRequires: rpmbuild(macros) >= 1.238
+%{?requires_php_extension}
+Requires: %{_sysconfdir}/conf.d
Obsoletes: php-pear-%{_modname}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _sysconfdir /etc/php
-%define extensionsdir %{_libdir}/php
-
%description
This package handles /etc/hosts.allow and /etc/hosts.deny files.
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{extensionsdir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/conf.d,%{extensionsdir}}
install %{_modname}-%{version}/modules/%{_modname}.so $RPM_BUILD_ROOT%{extensionsdir}
+cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_modname}.ini
+; Enable %{_modname} extension module
+extension=%{_modname}.so
+EOF
%clean
rm -rf $RPM_BUILD_ROOT
%post
-%{_sbindir}/php-module-install install %{_modname} %{_sysconfdir}/php-cgi.ini
+[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
-%preun
-if [ "$1" = "0" ]; then
- %{_sbindir}/php-module-install remove %{_modname} %{_sysconfdir}/php-cgi.ini
+%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
fi
%files
%defattr(644,root,root,755)
%doc %{_modname}-%{version}/{CREDITS,EXPERIMENTAL}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{_modname}.ini
%attr(755,root,root) %{extensionsdir}/%{_modname}.so