SPECS: template-php-pecl.spec - conf.d support

adamg adamg at pld-linux.org
Fri Aug 26 18:15:45 CEST 2005


Author: adamg                        Date: Fri Aug 26 16:15:45 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- conf.d support

---- Files affected:
SPECS:
   template-php-pecl.spec (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: SPECS/template-php-pecl.spec
diff -u SPECS/template-php-pecl.spec:1.10 SPECS/template-php-pecl.spec:1.11
--- SPECS/template-php-pecl.spec:1.10	Sat Aug  7 19:47:11 2004
+++ SPECS/template-php-pecl.spec	Fri Aug 26 18:15:39 2005
@@ -1,6 +1,8 @@
 # $Revision$, $Date$
 %define		_modname	-
 %define		_status		-
+%define		_sysconfdir	/etc/php
+%define		extensionsdir	$(php-config --extension-dir 2>/dev/null)
 
 Summary:	%{_modname} -
 Summary(pl):	%{_modname} -
@@ -13,13 +15,11 @@
 URL:		http://pecl.php.net/package/Modname/
 BuildRequires:	libtool
 BuildRequires:	php-devel >= 3:5.0.0
-Requires:	php-common >= 3:5.0.0
+Requires:	%{_sysconfdir}/conf.d
+%requires_eq_to php-common php-devel
 Obsoletes:	php-pear-%{_modname}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_sysconfdir	/etc/php
-%define		extensionsdir	%{_libdir}/php
-
 %description
 
 In PECL status of this extension is: %{_status}.
@@ -39,24 +39,31 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{extensionsdir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{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_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 +72,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.11  2005/08/26 16:15:39  adamg
+- conf.d support
+
 Revision 1.10  2004/08/07 17:47:11  adamg
 - ok, let's force php5 for pecl extensions
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/template-php-pecl.spec?r1=1.10&r2=1.11&f=u




More information about the pld-cvs-commit mailing list