From caf4d4a3815526c9a9fd7df245110d048a6b9bb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Sep 2005 22:03:28 +0000 Subject: [PATCH] - full conf.d support and unifications Changed files: php4-pecl-runkit.spec -> 1.3 --- php4-pecl-runkit.spec | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/php4-pecl-runkit.spec b/php4-pecl-runkit.spec index 81fd088..e890ebe 100644 --- a/php4-pecl-runkit.spec +++ b/php4-pecl-runkit.spec @@ -1,25 +1,25 @@ %define _modname runkit %define _status beta +%define _sysconfdir /etc/php4 +%define extensionsdir %{_libdir}/php4 Summary: %{_modname} - mangle with user defined functions and classes Summary(pl): %{_modname} - obróbka zdefiniowanych przez u¿ytkownika funkcji i klas Name: php4-pecl-%{_modname} Version: 0.4 -Release: 1 +Release: 2 License: PHP Group: Development/Languages/PHP Source0: http://pecl.php.net/get/%{_modname}-%{version}.tgz # Source0-md5: 05a690f04b7d2c42193f3e0c1bb99a19 URL: http://pecl.php.net/package/runkit/ -BuildRequires: libtool BuildRequires: php4-devel >= 3:4.3.0 -Requires: php4-common >= 3:4.3.0 +BuildRequires: rpmbuild(macros) >= 1.230 +%requires_eq_to php4-common php4-devel +Requires: %{_sysconfdir}/conf.d Obsoletes: php-pear-%{_modname} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -%define _sysconfdir /etc/php4 -%define extensionsdir %{_libdir}/php4 - %description Replace, rename, and remove user defined functions and classes. Define customized superglobal variables for general purpose use. Execute code @@ -46,22 +46,29 @@ phpize %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}/php4-module-install install %{_modname} %{_sysconfdir}/php-cgi.ini +[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart +[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service -q httpd restart -%preun -if [ "$1" = "0" ]; then - %{_sbindir}/php4-module-install remove %{_modname} %{_sysconfdir}/php-cgi.ini +%postun +if [ "$1" = 0 ]; then + [ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart + [ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service -q httpd restart fi %files %defattr(644,root,root,755) %doc %{_modname}-%{version}/README +%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/%{_modname}.ini %attr(755,root,root) %{extensionsdir}/%{_modname}.so -- 2.44.0