summaryrefslogtreecommitdiffstats
path: root/php-pecl-rpminfo.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-rpminfo.spec')
-rw-r--r--php-pecl-rpminfo.spec77
1 files changed, 34 insertions, 43 deletions
diff --git a/php-pecl-rpminfo.spec b/php-pecl-rpminfo.spec
index 58d3b05..8f0cadd 100644
--- a/php-pecl-rpminfo.spec
+++ b/php-pecl-rpminfo.spec
@@ -1,7 +1,7 @@
# remirepo spec file for php-pecl-rpminfo
#
-# Copyright (c) 2018-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2018-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
@@ -10,21 +10,24 @@
# we don't want -z defs linker flag
%undefine _strict_symbol_defs_build
+%bcond_without tests
+
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-rpminfo
+%scl_package php-pecl-rpminfo
%else
%global _root_prefix %{_prefix}
%endif
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name rpminfo
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: RPM information
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
+Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 0.6.0
-Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: PHP
+Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
@@ -42,23 +45,6 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
%description
@@ -78,9 +64,7 @@ sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-mv %{pecl_name}-%{version} NTS
-
-cd NTS
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_RPMINFO_VERSION/{s/.* "//;s/".*$//;p}' php_rpminfo.h)
if test "x${extver}" != "x%{version}"; then
@@ -89,9 +73,9 @@ if test "x${extver}" != "x%{version}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -104,25 +88,26 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--enable-rpminfo \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%{__php} --no-php-ini \
--define extension=modules/%{pecl_name}.so \
- --re %{pecl_name} >REFLECTION
+ --re %{pecl_name} >../%{sources}/REFLECTION
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--enable-rpminfo \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -148,7 +133,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') REFLECTION
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -173,34 +158,36 @@ fi
%check
-%if 0%{?fedora} < 33 && 0%{?rhel} < 9 || 0%{?fedora} >= 36
+cd %{sources}
+%if 0%{?fedora} < 37 && 0%{?rhel} < 10
# OLD mock install sqlite db, rpm expect db6 format
# NEW mock install in /usr/lib/sysimage/rpm instead of /var/lib/rpm
-rm ?TS/tests/007-rpmdbinfo.phpt
-rm ?TS/tests/008-rpmdbsearch.phpt
-rm ?TS/tests/013-rpmdbsearch-error.phpt
+rm tests/007-rpmdbinfo.phpt
+rm tests/008-rpmdbsearch.phpt
+rm tests/013-rpmdbsearch-error.phpt
%endif
-cd NTS
# 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" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php --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" \
@@ -208,10 +195,11 @@ NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php --show-diff
%endif
+%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -225,6 +213,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Tue Jun 6 2023 Remi Collet <remi@remirepo.net> - 0.6.0-6
+- build out of sources tree
+
* Thu Sep 1 2022 Remi Collet <remi@remirepo.net> - 0.6.0-5
- rebuild for PHP 8.2.0RC1