summaryrefslogtreecommitdiffstats
path: root/php-pecl-uopz.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-uopz.spec')
-rw-r--r--php-pecl-uopz.spec130
1 files changed, 69 insertions, 61 deletions
diff --git a/php-pecl-uopz.spec b/php-pecl-uopz.spec
index 74b7f61..9e411ad 100644
--- a/php-pecl-uopz.spec
+++ b/php-pecl-uopz.spec
@@ -7,35 +7,36 @@
# Please, preserve the changelog entries
#
%if 0%{?scl:1}
-%if "%{scl}" == "rh-php56"
-%global sub_prefix more-php56-
-%else
%global sub_prefix %{scl_prefix}
-%endif
-%scl_package php-pecl-uopz
+%scl_package php-pecl-uopz
%endif
-%global with_zts 0%{?__ztsphp:1}
-%global pecl_name uopz
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name uopz
+%global ini_name 05-%{pecl_name}.ini
-%if "%{php_version}" < "5.6"
-# uopz should be loaded before opcache (k as krakjoe)
-%global ini_name k-%{pecl_name}.ini
-%else
-%global ini_name 05-%{pecl_name}.ini
-%endif
+# see https://github.com/krakjoe/uopz/releases
+#global gh_commit c335700be4dc4350605bc4fb1efd8e96ba51b733
+#global gh_short %%(c=ยต%{gh_commit}; echo ${c:0:7})
+#global gh_owner krakjoe
+#global gh_project uopz
Summary: User Operations for Zend
Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 2.0.7
-Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Version: 5.0.1
+Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
+%if 0%{?gh_commit:1}
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
+%else
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+%endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: %{?scl_prefix}php-devel > 5.4
+Patch0: %{pecl_name}-upstream.patch
+
+BuildRequires: %{?scl_prefix}php-devel > 7
BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
@@ -57,13 +58,19 @@ Obsoletes: php53-pecl-%{pecl_name} <= %{version}
Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
Obsoletes: php54-pecl-%{pecl_name} <= %{version}
Obsoletes: php54w-pecl-%{pecl_name} <= %{version}
-%if "%{php_version}" > "5.5"
Obsoletes: php55u-pecl-%{pecl_name} <= %{version}
Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "5.6"
Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
+%if "%{php_version}" > "7.1"
+Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
%endif
%endif
@@ -97,7 +104,21 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
+%if 0%{?gh_commit:1}
+mv %{gh_project}-%{gh_commit} NTS
+# Temporary, until released on PECL
+%{__php} -r '
+ $pkg = simplexml_load_file("NTS/package.xml");
+ $pkg->date = "2016-04-12";
+ $pkg->version->release = "%{version}";
+ $pkg->version->release = "%{version}";
+ $pkg->stability->release = "beta";
+ $pkg->stability->api = "beta";
+ $pkg->asXML("package.xml");
+'
+%else
mv %{pecl_name}-%{version} NTS
+%endif
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
@@ -105,7 +126,7 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
-#sed -e /PHP_UOPZ_VERSION/s/2.0.0/%{version}/ -i uopz.h
+%patch0 -p1 -b .upstream
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_UOPZ_VERSION/{s/.* "//;s/".*$//;p}' uopz.h)
@@ -116,39 +137,14 @@ fi
cd ..
# Create configuration files
-cat << EOF | tee NTS/%{ini_name}
+cat << EOF | tee %{ini_name}
; Enable '%{summary}' extension module
-%if "%{php_version}" > "5.5"
-zend_extension=%{pecl_name}.so
-%else
-zend_extension=%{php_extdir}/%{pecl_name}.so
-%endif
-
-; Configuration
-; http://php.net/manual/en/uopz.configuration.php
-;uopz.overloads=0
-;uopz.backup=1
-;uopz.fixup=0
+extension=%{pecl_name}.so
EOF
%if %{with_zts}
# Duplicate source tree for NTS / ZTS build
cp -pr NTS ZTS
-
-cat << EOF | tee ZTS/%{ini_name}
-; Enable '%{summary}' extension module
-%if "%{php_version}" > "5.5"
-zend_extension=%{pecl_name}.so
-%else
-zend_extension=%{php_ztsextdir}/%{pecl_name}.so
-%endif
-
-; Configuration
-; http://php.net/manual/en/uopz.configuration.php
-;uopz.overloads=0
-;uopz.backup=1
-;uopz.fixup=0
-EOF
%endif
@@ -169,19 +165,17 @@ make %{?_smp_mflags}
%install
-rm -rf %{buildroot}
-
make -C NTS install INSTALL_ROOT=%{buildroot}
# install config file
-install -D -m 644 NTS/%{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
+install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
# Install XML package description
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
make -C ZTS install INSTALL_ROOT=%{buildroot}
-install -D -m 644 ZTS/%{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
+install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
@@ -214,12 +208,12 @@ fi
cd NTS
: Minimal load test for NTS extension
%{__php} --no-php-ini \
- --define zend_extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
+ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d zend_extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php
@@ -228,24 +222,19 @@ REPORT_EXIT_STATUS=1 \
cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
- --define zend_extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
+ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \
-TEST_PHP_ARGS="-n -d zend_extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{_bindir}/zts-php -n run-tests.php
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -260,6 +249,25 @@ rm -rf %{buildroot}
%changelog
+* Fri Jun 23 2017 Remi Collet <remi@fedoraproject.org> - 5.0.1-5
+- add upstream patch for PHP 7.2
+
+* Thu Dec 1 2016 Remi Collet <remi@fedoraproject.org> - 5.0.1-4
+- rebuild with PHP 7.1.0 GA
+
+* Wed Sep 14 2016 Remi Collet <remi@fedoraproject.org> - 5.0.1-3
+- rebuild for PHP 7.1 new API version
+
+* Thu Jun 9 2016 Remi Collet <remi@fedoraproject.org> - 5.0.1-2
+- add upstream patch for PHP 7.1
+
+* Wed Apr 13 2016 Remi Collet <remi@fedoraproject.org> - 5.0.1-1
+- update to 5.0.1
+
+* Wed Apr 13 2016 Remi Collet <remi@fedoraproject.org> - 5.0.0-1
+- update to 5.0.0 for PHP 7
+- sources from github (not yet released on pecl)
+
* Tue Mar 8 2016 Remi Collet <remi@fedoraproject.org> - 2.0.7-2
- adapt for F24