summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-recode.spec44
1 files changed, 19 insertions, 25 deletions
diff --git a/php-pecl-recode.spec b/php-pecl-recode.spec
index c86e643..4f151d0 100644
--- a/php-pecl-recode.spec
+++ b/php-pecl-recode.spec
@@ -7,12 +7,7 @@
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-recode
-%else
-%global _root_bindir %{_bindir}
-%global _root_libexecdir %{_libexecdir}
-%endif
+%{?scl:%scl_package php-pecl-recode}
%bcond_without tests
@@ -28,11 +23,13 @@
%global uplower DEV
# After 20-xml
%global ini_name 30-%{pecl_name}.ini
+%global sources %{gh_project}-%{gh_commit}
+%global _configure ../%{sources}/configure
Summary: A module for PHP applications for using the recode library
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: %{upver}%{?uplower:~%{uplower}}%{?gh_date:.%{gh_date}}
-Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
@@ -73,9 +70,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}
# Check version as upstream often forget to update this
extver=$(sed -n '/#define PHP_RECODE_VERSION/{s/.* "//;s/".*$//;p}' php_recode.h)
if test "x${extver}" != "x%{upver}%{?rcver}%{?gh_date:-dev}"; then
@@ -90,10 +86,9 @@ cat << 'EOF' | tee %{ini_name}
extension=%{pecl_name}
EOF
-
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
@@ -106,15 +101,16 @@ peclconf() {
--with-php-config=$1
}
-cd NTS
-%{_bindir}/phpize
-peclconf %{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+peclconf %{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-peclconf %{_bindir}/zts-php-config
+peclconf %{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -134,16 +130,14 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%check
-cd NTS
+cd %{sources}
: Minimal load test for NTS extension
-%{_bindir}/php --no-php-ini \
+%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%if %{with_zts}
-cd ../ZTS
-
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
@@ -152,8 +146,6 @@ cd ../ZTS
%endif
%if %{with tests}
-cd ../NTS
-
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
: ignore test failing with recode 3.7
rm tests/001.phpt
@@ -162,7 +154,6 @@ rm tests/001.phpt
: Run upstream test suite
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 -q --show-diff
%endif
@@ -171,7 +162,7 @@ REPORT_EXIT_STATUS=1 \
%files
%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE
+%license %{sources}/LICENSE
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -183,6 +174,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 1.0.0~DEV.20190723-9
+- build out of sources tree
+
* Thu Aug 24 2023 Remi Collet <remi@remirepo.net> - 1.0.0~DEV.20190723-8
- F39 build