summaryrefslogtreecommitdiffstats
path: root/php-snuffleupagus.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-snuffleupagus.spec')
-rw-r--r--php-snuffleupagus.spec50
1 files changed, 26 insertions, 24 deletions
diff --git a/php-snuffleupagus.spec b/php-snuffleupagus.spec
index d2e82b7..cd9a69e 100644
--- a/php-snuffleupagus.spec
+++ b/php-snuffleupagus.spec
@@ -1,15 +1,12 @@
# remirepo spec file for php-snuffleupagus
#
# Copyright (c) 2018-2023 Remi Collet
-# License: CC-BY-SA
+# 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
-
%if 0%{?scl:1}
%scl_package php-snuffleupagus
%else
@@ -26,9 +23,11 @@
#global gh_date 20180117
%global pecl_name snuffleupagus
# ZTS is not supported, test suite fails
-# https://github.com/nbs-system/snuffleupagus/issues/123
+# https://github.com/jvoisin/snuffleupagus/issues/123
%global with_zts 0
%global ini_name 40-%{pecl_name}.ini
+%global sources src
+%global _configure ../%{sources}/configure
Summary: Security module for PHP
Name: %{?scl_prefix}php-snuffleupagus
@@ -36,7 +35,7 @@ Version: 0.9.0
%if 0%{?gh_date}
Release: 1%{gh_date}.%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%else
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%endif
License: LGPL-3.0-only
Group: Development/Languages
@@ -75,9 +74,9 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-%patch0 -p1
+%patch -P0 -p1
-cd src
+cd %{sources}
# Sanity check, really often broken
grep PHP_SNUFFLEUPAGUS_VERSION php_snuffleupagus.h
# sed -e '/PHP_SNUFFLEUPAGUS_VERSION/s/0.9.0/0.8.0/' -i php_snuffleupagus.h
@@ -89,9 +88,9 @@ if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-cp -pr src ZTS
+mkdir ZTS
%endif
# Drop in the bit of configuration
@@ -123,19 +122,20 @@ EOF
%build
%{?dtsenable}
-cd src
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
- --with-php-config=%{_bindir}/php-config \
+ --with-php-config=%{__phpconfig} \
--with-libdir=%{_lib} \
--enable-snuffleupagus
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} \
--enable-snuffleupagus
make %{?_smp_mflags}
@@ -147,7 +147,7 @@ make %{?_smp_mflags}
# Install the NTS stuff
-make -C src install INSTALL_ROOT=%{buildroot}
+make -C NTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 %{pecl_name}-default.rules %{buildroot}%{php_inidir}/%{pecl_name}-default.rules
@@ -166,6 +166,8 @@ else
rm src/tests/upload_validation/upload_validation_real.phpt
fi
+cd %{sources}
+
%if "%{php_version}" < "8"
rm -rf src/tests/*php8*/
%endif
@@ -175,7 +177,6 @@ export SP_SKIP_OLD_PHP_CHECK=1
# add extensions used by test suite
TEST_DEPS="-d extension=xml.so -d extension=dom.so -d extension=curl.so -d extension=simplexml.so"
-cd src
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
@@ -185,17 +186,15 @@ cd src
%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n $TEST_DEPS -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="-n $TEST_DEPS -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
%endif
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
- --define extension=$PWD/modules/%{pecl_name}.so \
+ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--define sp.allow_broken_configuration=1 \
--modules | grep %{pecl_name}
@@ -203,9 +202,8 @@ cd ../ZTS
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n $TEST_DEPS -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
%endif
@@ -226,6 +224,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Tue Sep 5 2023 Remi Collet <remi@remirepo.net> - 0.9.0-3
+- add upstream patches for PHP 8.3
+- build out of sources tree
+
* Thu Jan 5 2023 Remi Collet <remi@remirepo.net> - 0.9.0-2
- test build for upstream fix for gh#444