summaryrefslogtreecommitdiffstats
path: root/php-xz.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-09-04 11:33:25 +0200
committerRemi Collet <remi@php.net>2023-09-04 11:33:25 +0200
commit1cb08a79ca350da8bbbaa6f42864b7c048210f1a (patch)
tree28a83ac8f54018c1ea516a1f52a6518b57ede316 /php-xz.spec
parent5c801427624985d9c9cf94f611e8fd6c4fdc1922 (diff)
build out of sources treeHEADmaster
Diffstat (limited to 'php-xz.spec')
-rw-r--r--php-xz.spec67
1 files changed, 28 insertions, 39 deletions
diff --git a/php-xz.spec b/php-xz.spec
index 9bc26d8..0de509b 100644
--- a/php-xz.spec
+++ b/php-xz.spec
@@ -1,20 +1,15 @@
# remirepo spec file for php-xz
#
-# Copyright (c) 2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2021-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
+%{?scl:%scl_package php-xz}
-%if 0%{?scl:1}
-%scl_package php-xz
-%else
-%global pkg_name %{name}
-%endif
+%bcond_without tests
%global gh_commit be72e636dd7dd8a220cb9b54f2970477dad878a0
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
@@ -23,12 +18,14 @@
%global pecl_name xz
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
+%global sources %{gh_project}-%{gh_commit}
+%global _configure ../%{sources}/configure
Summary: XZ (LZMA2) compression/decompression
Name: %{?scl_prefix}php-%{pecl_name}
Version: 1.1.2
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-License: PHP
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: PHP-3.01
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
@@ -41,21 +38,6 @@ 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 "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-%{pecl_name} <= %{version}
-%endif
-%endif
-
%description
PHP Extension providing XZ (LZMA2) compression/decompression functions.
@@ -65,9 +47,8 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -qc
-mv %{gh_project}-%{gh_commit} NTS
-cd NTS
+cd %{sources}
mv LICENSE.txt LICENSE
# Sanity check, really often broken
@@ -78,9 +59,9 @@ if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Drop in the bit of configuration
@@ -97,19 +78,20 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
- --with-php-config=%{_bindir}/php-config \
+ --with-php-config=%{__phpconfig} \
--with-libdir=%{_lib} \
--with-xz
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
- --with-php-config=%{_bindir}/zts-php-config \
+ --with-php-config=%{__ztsphpconfig} \
--with-libdir=%{_lib} \
--with-xz
make %{?_smp_mflags}
@@ -132,37 +114,41 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%check
-cd NTS
+cd %{sources}
+
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php -q -x --offline --show-diff
+%endif
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php -q -x --offline --show-diff
%endif
+%endif
%files
%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE
-%doc NTS/README.md
+%license %{sources}/LICENSE
+%doc %{sources}/README.md
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -174,6 +160,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 1.1.2-3
+- build out of sources tree
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 1.1.2-2
- rebuild for 8.1.0RC1