From e81839095c18a05323552c7ca8332c767d6ba2af Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 24 Apr 2019 16:19:41 +0200 Subject: cleanup --- php-zstd.spec | 101 +++++++++------------------------------------------------- 1 file changed, 15 insertions(+), 86 deletions(-) (limited to 'php-zstd.spec') diff --git a/php-zstd.spec b/php-zstd.spec index 18809c0..19e9545 100644 --- a/php-zstd.spec +++ b/php-zstd.spec @@ -1,3 +1,6 @@ +# Fedora spec file for php-zstd +# without SCL compatibility from: +# # remirepo spec file for php-zstd # # Copyright (c) 2018-2019 Remi Collet @@ -7,97 +10,38 @@ # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - -%if 0%{?scl:1} -%global sub_prefix %{scl_prefix} -%scl_package php-zstd -%else -%global pkg_name %{name} -%endif - -%if 0%{?fedora} >= 99 || 0%{?rhel} >= 99 -%global with_libzstd 1 -%else -%global with_libzstd 0 -%endif -%global zstdver 1.4.0 - %global gh_commit d4fa116c59d7fd31c2fb242b0ad8ad02bdeccd67 %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 Summary: Zstd Extension for PHP -Name: %{?sub_prefix}php-%{pecl_name} +Name: php-%{pecl_name} Version: 0.7.3 -%if 0%{?gh_date:1} -Release: 1%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -%else -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -%endif -%if %{?with_libzstd} +Release: 1 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 - -BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel -%if %{?with_libzstd} -BuildRequires: libzstd-devel >= %{zstdver} -%else -Provides: bundled(libzstd) = %{zstdver} -%endif +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz -Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} -Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} - -%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -%if "%{php_version}" > "7.1" -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 -%if "%{php_version}" > "7.3" -Obsoletes: php73u-%{pecl_name} <= %{version} -Obsoletes: php73w-%{pecl_name} <= %{version} -%endif -%endif +BuildRequires: gcc +BuildRequires: php-devel +BuildRequires: pkgconfig(libzstd) -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter shared private -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} %description This extension allows Zstd compression. -Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. - %package devel Summary: %{name} developer files (header) Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{?scl_prefix}php-devel%{?_isa} -Provides: %{?scl_prefix}php-%{pecl_name}-devel = %{version}-%{release} -Provides: %{?scl_prefix}php-%{pecl_name}-devel%{?_isa} = %{version}-%{release} +Requires: php-devel%{?_isa} %description devel These are the files needed to compile programs using %{name}. @@ -108,14 +52,9 @@ These are the files needed to compile programs using %{name}. mv %{gh_project}-%{gh_commit} NTS cd NTS -# replace symlink -rm LICENSE-zstd -mv zstd/LICENSE LICENSE-libzstd -%if %{?with_libzstd} # Use the system library rm -r zstd -%endif # Sanity check, really often broken extver=$(sed -n '/#define PHP_ZSTD_EXT_VERSION/{s/.* "//;s/".*$//;p}' php_zstd.h) @@ -144,9 +83,7 @@ cd NTS %{_bindir}/phpize %configure \ --with-php-config=%{_bindir}/php-config \ -%if %{?with_libzstd} --with-libzstd \ -%endif --with-libdir=%{_lib} \ --enable-zstd make %{?_smp_mflags} @@ -156,9 +93,7 @@ cd ../ZTS %{_bindir}/zts-phpize %configure \ --with-php-config=%{_bindir}/zts-php-config \ -%if %{?with_libzstd} --with-libzstd \ -%endif --with-libdir=%{_lib} \ --enable-zstd make %{?_smp_mflags} @@ -182,12 +117,6 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %check export REPORT_EXIT_STATUS=1 -%if %{?with_libzstd} -ver=$(pkg-config libzstd --modversion) -if [ "$ver" != "%{zstdver}" ] ; then -export REPORT_EXIT_STATUS=0 -fi -%endif cd NTS : Minimal load test for NTS extension @@ -217,9 +146,6 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %files %{!?_licensedir:%global license %%doc} %license NTS/LICENSE -%if ! %{?with_libzstd} -%license NTS/LICENSE-libzstd -%endif %doc NTS/README.md %config(noreplace) %{php_inidir}/%{ini_name} @@ -241,6 +167,9 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %changelog +* Wed Apr 24 2019 Remi Collet - 0.7.3-1 +- cleanup for Fedora review + * Wed Apr 24 2019 Remi Collet - 0.7.3-1 - update to 0.7.3 -- cgit