SPECS: php-mmcache.spec - conf.d and php api version support; rel 6

glen glen at pld-linux.org
Thu Sep 15 20:39:33 CEST 2005


Author: glen                         Date: Thu Sep 15 18:39:33 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- conf.d and php api version support; rel 6

---- Files affected:
SPECS:
   php-mmcache.spec (1.30 -> 1.31) 

---- Diffs:

================================================================
Index: SPECS/php-mmcache.spec
diff -u SPECS/php-mmcache.spec:1.30 SPECS/php-mmcache.spec:1.31
--- SPECS/php-mmcache.spec:1.30	Wed Sep  7 16:14:52 2005
+++ SPECS/php-mmcache.spec	Thu Sep 15 20:39:28 2005
@@ -2,30 +2,27 @@
 %define		_name		mmcache
 %define		_pkgname	turck-mmcache
 %define		php_ver		%(rpm -q --qf '%%{epoch}:%%{version}' php-devel)
+%define		_sysconfdir	/etc/php
+%define		extensionsdir	%{_libdir}/php
 
 Summary:	Turck MMCache extension module for PHP
 Summary(pl):	Moduł Turck MMCache dla PHP
 Name:		php-%{_name}
 Version:	2.4.6
-Release:	5
-Epoch:		0
+Release:	6
 License:	GPL
 Group:		Libraries
 Vendor:		Turck Software
 Source0:	http://dl.sourceforge.net/%{_pkgname}/%{_pkgname}-%{version}.tar.gz
 # Source0-md5:	bcf671bec2e8b009e9b2d8f8d2574041
 URL:		http://turck-mmcache.sourceforge.net
-BuildRequires:	php-devel >= 4.1
-BuildRequires:	libtool
+BuildRequires:	php-devel >= 3:5.0.0
+BuildRequires:	rpmbuild(macros) >= 1.238
+%{?requires_php_extension}
 Requires:	apache >= 1.3
-Requires:	php = %{php_ver}
 Requires:	php-zlib
-Requires(post,preun):	php-common >= 4.1
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		_sysconfdir	/etc/php
-%define		extensionsdir	%{_libdir}/php
-
 %description
 Turck MMCache is a PHP Accelerator & Encoder. It increases performance
 of PHP scripts by caching them in compiled state, so that the overhead
@@ -48,9 +45,7 @@
 Summary(pl):	Osobny loader plików Turck MMCache
 Group:		Libraries
 Requires:	apache >= 1.3
-Requires(post,preun):	php-common >= 4.1
-Requires:	php >= %{php_ver}
-Requires:	php <= %{php_ver}-999
+%{?requires_php_extension}
 Provides:	TurckLoader = %{epoch}:%{version}-%{release}
 
 %description TurckLoader
@@ -103,48 +98,70 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{extensionsdir}
-install -d $RPM_BUILD_ROOT%{_bindir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/conf.d,%{extensionsdir},%{_bindir}}
 
 install ./modules/mmcache.so $RPM_BUILD_ROOT%{extensionsdir}
 install ./encoder.php $RPM_BUILD_ROOT%{_bindir}
-
+install ./mmcache_password.php $RPM_BUILD_ROOT%{_bindir}
+install ./mmcache.php $RPM_BUILD_ROOT%{_bindir}
 install ./TurckLoader/modules/TurckLoader.so $RPM_BUILD_ROOT%{extensionsdir}
 
+cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_name}.ini
+; Enable %{_name} extension module
+extension=%{_name}.so
+EOF
+
+cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/TurckLoader.ini
+; Enable TurkLoader
+extension=TurkLoader.so
+EOF
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-%{_sbindir}/php-module-install install mmcache %{_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}/php-module-install remove mmcache %{_sysconfdir}/php.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
 
 %post TurckLoader
-%{_sbindir}/php-module-install install TurckLoader %{_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 TurckLoader
-if [ "$1" = "0" ]; then
-	%{_sbindir}/php-module-install remove TurckLoader %{_sysconfdir}/php.ini
+%postun TurckLoader
+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
 
+%triggerpostun -- %{name} <= 2.4.6-5
+%{_sbindir}/php-module-install remove mmcache %{_sysconfdir}/php.ini
+
+%triggerpostun TurckLoader -- %{name}-TurckLoader <= 2.4.6-5
+%{_sbindir}/php-module-install remove TurckLoader %{_sysconfdir}/php.ini
+
 %files
 %defattr(644,root,root,755)
 %doc CREDITS EXPERIMENTAL README TODO
 %attr(755,root,root) %{extensionsdir}/mmcache.so
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{_name}.ini
 %attr(755,root,root) %{_bindir}/encoder.php
 
 %files TurckLoader
 %defattr(644,root,root,755)
 %doc CREDITS EXPERIMENTAL
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/TurckLoader.ini
 %attr(755,root,root) %{extensionsdir}/TurckLoader.so
 
 %files webinterface
 %defattr(644,root,root,755)
-# FIXME: czy tak rzeczywiście powinno/może być??
-%doc mmcache{,_password}.php
+%attr(755,root,root) %{_bindir}/mmcache.php
+%attr(755,root,root) %{_bindir}/mmcache_password.php
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -152,6 +169,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.31  2005/09/15 18:39:28  glen
+- conf.d and php api version support; rel 6
+
 Revision 1.30  2005/09/07 14:14:52  glen
 - phpize already calls aclocal/autoconf
 
@@ -184,9 +204,9 @@
 Revision 1.21  2004/06/23 12:59:56  pzurowski
 - release 0.9
 - strict php requires (from apache's error_log):
-	PHP Warning:  [Turck MMCache] This build of "Turck MMCache" was
-	compiled for PHP version 4.3.4. Rebuild it for your PHP version
-	(4.3.7) or download precompiled binaries.\n in Unknown on line 0
+  PHP Warning:  [Turck MMCache] This build of "Turck MMCache" was
+  compiled for PHP version 4.3.4. Rebuild it for your PHP version
+  (4.3.7) or download precompiled binaries.\n in Unknown on line 0
 
 Revision 1.20  2004/06/07 19:58:48  zergin
 - added missing BR: libtool
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/php-mmcache.spec?r1=1.30&r2=1.31&f=u




More information about the pld-cvs-commit mailing list