diff options
Diffstat (limited to 'php-lz4.spec')
-rw-r--r-- | php-lz4.spec | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/php-lz4.spec b/php-lz4.spec index d6f785c..e179810 100644 --- a/php-lz4.spec +++ b/php-lz4.spec @@ -9,9 +9,13 @@ %if 0%{?scl:1} %global sub_prefix %{scl_prefix} %scl_package php-lz4 +%else +%global pkg_name %{name} %endif -%global gh_commit 1cf284648c3e40317ea77a06a5636722bbf2be35 +%global with_liblz4 0 + +%global gh_commit fb61d07a3900e4c0935366b8ac8e08ece192634b %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner kjdev %global gh_project php-ext-lz4 @@ -22,20 +26,25 @@ Summary: LZ4 Extension for PHP Name: %{?sub_prefix}php-lz4 -Version: 0.3.2 +Version: 0.3.3 %if 0%{?gh_date:1} Release: 0.3.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif License: MIT Group: Development/Languages URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz +Source0: %{pkg_name}-%{version}-%{gh_short}.tgz +# retrieve a recursive git snapshot with submodule +Source1: makesrc.sh -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: %{?scl_prefix}php-devel +%if %{?with_liblz4} BuildRequires: lz4-devel +%else +Provides: bundled(lz4) = 1.8.0 +%endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} @@ -63,6 +72,10 @@ Obsoletes: php70w-%{pecl_name} <= %{version} Obsoletes: php71u-%{pecl_name} <= %{version} Obsoletes: php71w-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "7.2" +Obsoletes: php72u-%{pecl_name} <= %{version} +Obsoletes: php72w-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -83,8 +96,10 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO mv %{gh_project}-%{gh_commit} NTS cd NTS +%if %{?with_liblz4} # Use the system library rm -r lz4 +%endif # Sanity check, really often broken extver=$(sed -n '/#define LZ4_EXT_VERSION/{s/.* "//;s/".*$//;p}' php_lz4.h) @@ -107,11 +122,15 @@ EOF %build +%{?dtsenable} + cd NTS %{_bindir}/phpize %configure \ --with-php-config=%{_bindir}/php-config \ +%if %{?with_liblz4} --with-lz4-includedir=/usr \ +%endif --with-libdir=%{_lib} \ --enable-lz4 make %{?_smp_mflags} @@ -121,7 +140,9 @@ cd ../ZTS %{_bindir}/zts-phpize %configure \ --with-php-config=%{_bindir}/zts-php-config \ +%if %{?with_liblz4} --with-lz4-includedir=/usr \ +%endif --with-libdir=%{_lib} \ --enable-lz4 make %{?_smp_mflags} @@ -129,7 +150,8 @@ make %{?_smp_mflags} %install -rm -rf %{buildroot} +%{?dtsenable} + # Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -143,11 +165,6 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %check -: Ignore test relying on some specific LZ4 version -%if 0%{?fedora} < 24 && 0%{?rhel} < 7 -rm ?TS/tests/{001,003,008,011}.phpt -%endif - cd NTS : Minimal load test for NTS extension %{__php} --no-php-ini \ @@ -177,12 +194,7 @@ REPORT_EXIT_STATUS=1 \ %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license NTS/LICENSE %doc NTS/CREDITS @@ -198,6 +210,9 @@ rm -rf %{buildroot} %changelog +* Mon Aug 21 2017 Remi Collet <remi@remirepo.net> - 0.3.3-1 +- update to 0.3.3 with bundled liblz4 version 1.8.0 + * Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 0.3.2-2 - rebuild for PHP 7.2.0beta1 new API |