SPECS: php4-mcache.spec - use .ini file in conf.d directory

glen glen at pld-linux.org
Wed Aug 24 00:42:55 CEST 2005


Author: glen                         Date: Tue Aug 23 22:42:55 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use .ini file in conf.d directory

---- Files affected:
SPECS:
   php4-mcache.spec (1.7 -> 1.8) 

---- Diffs:

================================================================
Index: SPECS/php4-mcache.spec
diff -u SPECS/php4-mcache.spec:1.7 SPECS/php4-mcache.spec:1.8
--- SPECS/php4-mcache.spec:1.7	Tue Aug 23 14:42:29 2005
+++ SPECS/php4-mcache.spec	Wed Aug 24 00:42:47 2005
@@ -1,13 +1,14 @@
 # $Revision$, $Date$
 %define		_name		mcache
 %define		php_ver		%(rpm -q --qf '%%{epoch}:%%{version}' php4-devel)
+%define		_sysconfdir	/etc/php4
 
 Summary:	mcache PHP Extension
 Summary(pl):	Rozszerzenie PHP mcache
 Name:		php4-%{_name}
 Version:	1.2.0
 %define		_beta	7
-Release:	0.beta%{_beta}.1
+Release:	0.beta%{_beta}.5
 Epoch:		0
 License:	PHP 2.02
 Group:		Development/Languages/PHP
@@ -16,12 +17,13 @@
 URL:		http://www.klir.com/~johnm/php-mcache/
 BuildRequires:	automake
 BuildRequires:	libmemcache-devel >= 1.3.0
+BuildRequires:	rpmbuild(macros) >= 1.230
 BuildRequires:	php4-devel
 Requires:	php4-common = %{php_ver}
+Requires:	%{_sysconfdir}/conf.d
 Requires(post,preun):	php-common >= 3:4.1
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_sysconfdir	/etc/php4
 %define		extensionsdir	%(php-config --extension-dir 2>/dev/null)
 
 %description
@@ -78,21 +80,28 @@
 %{__make} install \
 	INSTALL_ROOT=$RPM_BUILD_ROOT
 
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
+cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_name}.ini
+; Enable %{_name} extension module
+extension=%{_name}.so
+EOF
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-%{_sbindir}/php4-module-install install %{_name} %{_sysconfdir}/php.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 %{_name} %{_sysconfdir}/php.ini
-fi
+%postun
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service -q httpd restart
 
 %files
 %defattr(644,root,root,755)
 %doc README index.html
 %doc mcache.php
+%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/%{_name}.ini
 %attr(755,root,root) %{extensionsdir}/mcache.so
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
@@ -101,6 +110,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.8  2005/08/23 22:42:47  glen
+- use .ini file in conf.d directory
+
 Revision 1.7  2005/08/23 12:42:29  glen
 - up to 1.2.0-beta7
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/php4-mcache.spec?r1=1.7&r2=1.8&f=u




More information about the pld-cvs-commit mailing list