summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--PHPINFO9
-rw-r--r--REFLECTION2
-rw-r--r--apfd-php81.patch38
-rw-r--r--php-pecl-apfd.spec102
5 files changed, 65 insertions, 88 deletions
diff --git a/.gitignore b/.gitignore
index 1ab5c4f..01f0400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
+clog
package-*.xml
*.tgz
+*.tar.bz2
*.tar.gz
*.tar.xz
*.tar.xz.asc
diff --git a/PHPINFO b/PHPINFO
index 6386963..3abe209 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -1,4 +1,11 @@
apfd
-apfd support => enabled
+APFD Support => enabled
+Extension Version => 1.0.3
+
+Content type => Reader => Handler
+multipart/form-data => default => custom
+application/x-www-form-urlencoded => default => default
+text/json => default => custom
+application/json => default => custom
diff --git a/REFLECTION b/REFLECTION
index e505cda..6054c9e 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,3 +1,3 @@
-Extension [ <persistent> extension #119 apfd version 1.0.2 ] {
+Extension [ <persistent> extension #125 apfd version 1.0.3 ] {
}
diff --git a/apfd-php81.patch b/apfd-php81.patch
deleted file mode 100644
index 9b897d4..0000000
--- a/apfd-php81.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 3b75b75ca2c8fde273b244052bb60f9cb4a56072 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Wed, 9 Jun 2021 11:46:36 +0200
-Subject: [PATCH] ignore new "full_path" member in 8.1
-
----
- tests/002.phpt | 3 +++
- tests/003.phpt | 3 +++
- 2 files changed, 6 insertions(+)
-
-diff --git a/tests/002.phpt b/tests/002.phpt
-index e46df77..50ca235 100644
---- a/tests/002.phpt
-+++ b/tests/002.phpt
-@@ -70,6 +70,9 @@ mike
- --FILE--
- <?php
-
-+foreach($_FILES as $i => $v) {
-+ unset($_FILES[$i]['full_path']); // only in 8.1
-+}
- var_dump($_POST, $_FILES);
-
- ?>
-diff --git a/tests/003.phpt b/tests/003.phpt
-index 7cfd9ca..94b8989 100644
---- a/tests/003.phpt
-+++ b/tests/003.phpt
-@@ -70,6 +70,9 @@ mike
- --FILE--
- <?php
-
-+foreach($_FILES as $i => $v) {
-+ unset($_FILES[$i]['full_path']); // only in 8.1
-+}
- var_dump($_POST, $_FILES);
-
- ?>
diff --git a/php-pecl-apfd.spec b/php-pecl-apfd.spec
index 2a7c354..3d5a6c6 100644
--- a/php-pecl-apfd.spec
+++ b/php-pecl-apfd.spec
@@ -3,49 +3,52 @@
#
# Fedora spec file for php-pecl-apfd
#
-# Copyright (c) 2015-2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2015-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-pecl-apfd}
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-apfd
-%endif
+%bcond_without tests
+
+# For PHP < 5.6 and EPEL-9
+%{!?__phpize: %global __phpize %{_bindir}/phpize}
+%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize}
+%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config}
+%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config}
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name apfd
-%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
%if "%{php_version}" < "5.6"
%global ini_name %{pecl_name}.ini
%else
%global ini_name 40-%{pecl_name}.ini
%endif
#global prever RC1
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: Always Populate Form Data
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 1.0.2
-Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-License: BSD
+Name: %{?scl_prefix}php-pecl-%{pecl_name}
+Version: 1.0.3
+Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: BSD-2-Clause
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
-Patch0: %{pecl_name}-php81.patch
-
BuildRequires: %{?dtsprefix}gcc
BuildRequires: make
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
+%if %{with tests}
+BuildRequires: %{?scl_prefix}php-pecl-json-post
+%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -54,19 +57,6 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
# Split off pecl/http
Conflicts: %{?scl_prefix}php-pecl(http) < 2.4
-%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
This tiny extension lets PHP's post handler parse `multipart/form-data` and
@@ -80,16 +70,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{version}%{?prever} NTS
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-cd NTS
-%patch0 -p1
-
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APFD_VERSION/{s/.* "//;s/".*$//;p}' php_apfd.h)
if test "x${extver}" != "x%{version}%{?prever}"; then
@@ -98,9 +85,9 @@ if test "x${extver}" != "x%{version}%{?prever}"; 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
@@ -113,19 +100,20 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--enable-apfd \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--enable-apfd \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -149,7 +137,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/".*$//')
-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
@@ -174,19 +162,23 @@ fi
%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}
+%if %{with tests}
: Upstream test suite for NTS extension
+OPT="-n"
+[ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json.so"
+[ -f %{php_extdir}/json_post.so ] && OPT="$OPT -d extension=json_post.so"
+
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="$OPT -d extension=$PWD/../NTS/modules/%{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}
@@ -196,7 +188,7 @@ cd ../ZTS
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
-%if %{with_tests}
+%if %{with tests}
: Upstream test suite skipped as zts-php-cgi not available
%endif
%endif
@@ -204,7 +196,7 @@ cd ../ZTS
%files
%doc %{pecl_docdir}/%{pecl_name}
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -217,6 +209,20 @@ cd ../ZTS
%changelog
+* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 1.0.3-4
+- rebuild for PHP 8.3.0RC1
+
+* Tue Aug 22 2023 Remi Collet <remi@remirepo.net> - 1.0.3-3
+- enable json extension for 7.4
+
+* Fri Jul 7 2023 Remi Collet <remi@remirepo.net> - 1.0.3-2
+- build out of sources tree
+- enable json_post for test suite
+
+* Tue Oct 5 2021 Remi Collet <remi@remirepo.net> - 1.0.3-1
+- update to 1.0.3
+- drop patch merged upstream
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 1.0.2-5
- rebuild for 8.1.0RC1