SPECS: template-php4-pecl.spec - use confdir based php

glen glen at pld-linux.org
Thu Aug 25 10:26:54 CEST 2005


Author: glen                         Date: Thu Aug 25 08:26:54 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use confdir based php

---- Files affected:
SPECS:
   template-php4-pecl.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SPECS/template-php4-pecl.spec
diff -u SPECS/template-php4-pecl.spec:1.1 SPECS/template-php4-pecl.spec:1.2
--- SPECS/template-php4-pecl.spec:1.1	Thu Aug 25 10:22:25 2005
+++ SPECS/template-php4-pecl.spec	Thu Aug 25 10:26:49 2005
@@ -1,6 +1,7 @@
 # $Revision$, $Date$
 %define		_modname	-
 %define		_status		-
+%define		_sysconfdir	/etc/php4
 
 Summary:	%{_modname} -
 Summary(pl):	%{_modname} -
@@ -12,13 +13,13 @@
 Source0:	http://pecl.php.net/get/%{_modname}-%{version}.tgz
 URL:		http://pecl.php.net/package/Modname/
 BuildRequires:	libtool
-BuildRequires:	php-devel >= 3:5.0.0
-Requires:	php-common >= 3:5.0.0
+BuildRequires:	php4-devel
+Requires:	%{_sysconfdir}/conf.d
+%requires_eq_to php4-common php4-devel
 Obsoletes:	php-pear-%{_modname}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_sysconfdir	/etc/php
-%define		extensionsdir	%{_libdir}/php
+%define		extensionsdir	%(php-config --extension-dir 2>/dev/null)
 
 %description
 
@@ -42,21 +43,29 @@
 install -d $RPM_BUILD_ROOT%{extensionsdir}
 
 install %{_modname}-%{version}/modules/%{_modname}.so $RPM_BUILD_ROOT%{extensionsdir}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
+cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_name}.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_php4.conf ] || %service -q apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.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_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}/{CREDITS,EXPERIMENTAL}
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/%{_modname}.ini
 %attr(755,root,root) %{extensionsdir}/%{_modname}.so
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
@@ -65,6 +74,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2005/08/25 08:26:49  glen
+- use confdir based php
+
 Revision 1.1  2005/08/25 08:22:25  glen
 - copy of template-php-pecl.spec
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/template-php4-pecl.spec?r1=1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list