From 27024d187b663885e1d711f3e078908430ead44a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 23 Dec 2019 08:47:35 +0100 Subject: v0.7.7 from pecl --- php-zstd.spec | 58 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 24 deletions(-) (limited to 'php-zstd.spec') diff --git a/php-zstd.spec b/php-zstd.spec index f0f73be..b67542a 100644 --- a/php-zstd.spec +++ b/php-zstd.spec @@ -24,37 +24,27 @@ %endif %global zstdver 1.4.4 -%global gh_commit b4abc3d75257586841bee4067bcc0ec5343f0220 -%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner kjdev -%global gh_project php-ext-zstd -#global gh_date 20160608 %global pecl_name zstd %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global ini_name 40-%{pecl_name}.ini %global buildver %(pkg-config --silence-errors --modversion libzstd 2>/dev/null || echo 65536) -Summary: Zstd Extension for PHP +Summary: Zstandard extension Name: %{?sub_prefix}php-%{pecl_name} -Version: 0.7.5 -%if 0%{?gh_date:1} -Release: 2%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -%else +Version: 0.7.7 Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -%endif %if %{?with_libzstd} License: MIT %else # bundled library is BSD License: MIT and BSD %endif -URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: %{pkg_name}-%{version}-%{gh_short}.tgz -# retrieve a recursive git snapshot with submodule -Source1: makesrc.sh +URL: http://pecl.php.net/package/%{pecl_name} +Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel +BuildRequires: %{?scl_prefix}php-pear %if %{?with_libzstd} BuildRequires: libzstd-devel >= %{zstdver} Requires: libzstd%{?_isa} >= %{buildver} @@ -66,6 +56,11 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} +Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} + %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} %if "%{php_version}" > "7.1" Obsoletes: php71u-%{pecl_name} <= %{version} @@ -93,7 +88,7 @@ Obsoletes: php74w-%{pecl_name} <= %{version} %description -This extension allows Zstd compression. +PHP extension for compression and decompression with Zstandard library. Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. @@ -111,12 +106,12 @@ These are the files needed to compile programs using %{name}. %prep %setup -qc -mv %{gh_project}-%{gh_commit} NTS +mv %{pecl_name}-%{version} NTS + +%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS -# replace symlink -rm LICENSE-zstd -mv zstd/LICENSE LICENSE-libzstd +cp zstd/LICENSE LICENSE-libzstd %if %{?with_libzstd} # Use the system library @@ -178,12 +173,23 @@ make %{?_smp_mflags} make -C NTS install INSTALL_ROOT=%{buildroot} 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} # Install the ZTS stuff make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif +# Test & Documentation +for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//') +do [ -f NTS/tests/$i ] && install -Dpm 644 NTS/tests/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/tests/$i +done +for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done + %check @@ -221,12 +227,12 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %files -%{!?_licensedir:%global license %%doc} -%license NTS/LICENSE +%{?_licensedir:%license NTS/LICENSE} +%doc %{pecl_docdir}/%{pecl_name} +%{pecl_xmldir}/%{name}.xml %if ! %{?with_libzstd} -%license NTS/LICENSE-libzstd +%{?_licensedir:%license NTS/LICENSE-libzstd} %endif -%doc NTS/README.md %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -247,6 +253,10 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %changelog +* Mon Dec 23 2019 Remi Collet - 0.7.7-1 +- update to 0.7.7 +- sources from pecl + * Fri Dec 20 2019 Remi Collet - 0.7.5-1 - update to 0.7.5 with bundled libzstd 1.4.4 -- cgit