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 --- PHPINFO | 2 +- REFLECTION | 2 +- makesrc.sh | 27 --------------------------- php-zstd.spec | 58 ++++++++++++++++++++++++++++++++++------------------------ 4 files changed, 36 insertions(+), 53 deletions(-) delete mode 100755 makesrc.sh diff --git a/PHPINFO b/PHPINFO index 522d266..1707a7d 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,5 +2,5 @@ zstd Zstd support => enabled -Extension Version => 0.7.5 +Extension Version => 0.7.7 Interface Version => 1.4.4 diff --git a/REFLECTION b/REFLECTION index 53e4ef2..ff44da3 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #99 zstd version 0.7.5 ] { +Extension [ extension #99 zstd version 0.7.7 ] { - Constants [5] { Constant [ int ZSTD_COMPRESS_LEVEL_MIN ] { 1 } diff --git a/makesrc.sh b/makesrc.sh deleted file mode 100755 index ea1e7e8..0000000 --- a/makesrc.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -NAME=$(basename $PWD) -OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) -PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) -VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) -COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) -SHORT=${COMMIT:0:7} - -echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" - -echo "Cloning..." -rm -rf $PROJECT-$COMMIT -git clone --recursive https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT - -echo "Getting commit..." -pushd $PROJECT-$COMMIT -git checkout $COMMIT -popd - -echo "Archiving..." -tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT - -echo "Cleaning..." -rm -rf $PROJECT-$COMMIT - -echo "Done." 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