[php-pecl-zendopcache/f18] fix ZTS configuration, adapt for SCL

Remi Collet remi at fedoraproject.org
Mon Jul 15 11:25:09 UTC 2013


commit e3680fb6f1d4699153bdca1a9158b8f1443229c1
Author: Remi Collet <remi at fedoraproject.org>
Date:   Mon Jul 15 13:24:41 2013 +0200

    fix ZTS configuration, adapt for SCL

 opcache.ini               |    2 +-
 php-pecl-zendopcache.spec |   48 ++++++++++++++++++++++++++++----------------
 2 files changed, 31 insertions(+), 19 deletions(-)
---
diff --git a/opcache.ini b/opcache.ini
index ef6e0e0..4a9ac5c 100644
--- a/opcache.ini
+++ b/opcache.ini
@@ -63,7 +63,7 @@ opcache.fast_shutdown=1
 ; The location of the OPcache blacklist file (wildcards allowed).
 ; Each OPcache blacklist file is a text file that holds the names of files
 ; that should not be accelerated.
-opcache.blacklist_filename=/etc/php.d/opcache*.blacklist
+opcache.blacklist_filename=@INIPATH@/opcache*.blacklist
 
 ; Allows exclusion of large files from being cached. By default all files
 ; are cached.
diff --git a/php-pecl-zendopcache.spec b/php-pecl-zendopcache.spec
index 2550cac..9a6980e 100644
--- a/php-pecl-zendopcache.spec
+++ b/php-pecl-zendopcache.spec
@@ -6,6 +6,8 @@
 #
 # Please, preserve the changelog entries
 #
+%{?scl:%scl_package php-pecl-zendopcache}
+%{!?scl:%global pkg_name %{name}}
 %{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}}
 %{!?__php:      %{expand: %%global __php      %{_bindir}/php}}
 %{!?__pecl:     %{expand: %%global __pecl     %{_bindir}/pecl}}
@@ -14,9 +16,9 @@
 %global pecl_name  zendopcache
 %global plug_name  opcache
 
-Name:          php-pecl-%{pecl_name}
+Name:          %{?scl_prefix}php-pecl-%{pecl_name}
 Version:       7.0.2
-Release:       1%{?dist}
+Release:       2%{?dist}
 Summary:       The Zend OPcache
 
 Group:         Development/Libraries
@@ -28,23 +30,23 @@ Source0:       http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
 Source1:       %{plug_name}.ini
 Source2:       %{plug_name}-default.blacklist
 
-BuildRequires: php-devel >= 5.2.0
-BuildRequires: php-pear
+BuildRequires: %{?scl_prefix}php-devel >= 5.2.0
+BuildRequires: %{?scl_prefix}php-pear
 
 Requires(post): %{__pecl}
 Requires(postun): %{__pecl}
-Requires:      php(zend-abi) = %{php_zend_api}
-Requires:      php(api) = %{php_core_api}
+Requires:      %{?scl_prefix}php(zend-abi) = %{php_zend_api}
+Requires:      %{?scl_prefix}php(api) = %{php_core_api}
 
 # Only one opcode cache could be enabled
-Conflicts:     php-eaccelerator
-Conflicts:     php-xcache
+Conflicts:     %{?scl_prefix}php-eaccelerator
+Conflicts:     %{?scl_prefix}php-xcache
 # APC 3.1.15 offer an option to disable opcache
-Conflicts:     php-pecl-apc < 3.1.15
-Provides:      php-pecl(%{plug_name}) = %{version}%{?prever}
-Provides:      php-pecl(%{plug_name})%{?_isa} = %{version}%{?prever}
-Provides:      php-%{plug_name} = %{version}-%{release}
-Provides:      php-%{plug_name}%{?_isa} = %{version}-%{release}
+Conflicts:     %{?scl_prefix}php-pecl-apc < 3.1.15
+Provides:      %{?scl_prefix}php-pecl(%{plug_name}) = %{version}%{?prever}
+Provides:      %{?scl_prefix}php-pecl(%{plug_name})%{?_isa} = %{version}%{?prever}
+Provides:      %{?scl_prefix}php-%{plug_name} = %{version}-%{release}
+Provides:      %{?scl_prefix}php-%{plug_name}%{?_isa} = %{version}-%{release}
 
 # Filter private shared
 %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
@@ -98,23 +100,28 @@ make %{?_smp_mflags}
 
 
 %install
+make -C NTS install INSTALL_ROOT=%{buildroot}
+
+# Configuration file
 install -D -p -m 644 %{SOURCE1} %{buildroot}%{php_inidir}/%{plug_name}.ini
 sed -e 's:@EXTPATH@:%{php_extdir}:' \
+    -e 's:@INIPATH@:%{php_inidir}:' \
     -i %{buildroot}%{php_inidir}/%{plug_name}.ini
 
-make -C NTS install INSTALL_ROOT=%{buildroot}
+# The default Zend OPcache blacklist file
+install -D -p -m 644 %{SOURCE2} %{buildroot}%{php_inidir}/%{plug_name}-default.blacklist
 
 %if %{with_zts}
+make -C ZTS install INSTALL_ROOT=%{buildroot}
+
 install -D -p -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{plug_name}.ini
 sed -e 's:@EXTPATH@:%{php_ztsextdir}:' \
+    -e 's:@INIPATH@:%{php_ztsinidir}:' \
     -i %{buildroot}%{php_ztsinidir}/%{plug_name}.ini
 
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+install -D -p -m 644 %{SOURCE2} %{buildroot}%{php_ztsinidir}/%{plug_name}-default.blacklist
 %endif
 
-# The default Zend OPcache blacklist file
-install -D -p -m 644 %{SOURCE2} %{buildroot}%{php_inidir}/%{plug_name}-default.blacklist
-
 # Install XML package description
 install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
 
@@ -162,6 +169,7 @@ fi
 %{php_extdir}/%{plug_name}.so
 
 %if %{with_zts}
+%config(noreplace) %{php_ztsinidir}/%{plug_name}-default.blacklist
 %config(noreplace) %{php_ztsinidir}/%{plug_name}.ini
 %{php_ztsextdir}/%{plug_name}.so
 %endif
@@ -170,6 +178,10 @@ fi
 
 
 %changelog
+* Mon Jul 15 2013 Remi Collet <rcollet at redhat.com> - 7.0.2-2
+- fix ZTS configuration
+- Adapt for SCL
+
 * Wed Jun  5 2013 Remi Collet <rcollet at redhat.com> - 7.0.2-1
 - update to 7.0.2
 - add spec License = CC-BY-SA


More information about the scm-commits mailing list