summaryrefslogtreecommitdiffstats
path: root/php-pecl-json-post.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-json-post.spec')
-rw-r--r--php-pecl-json-post.spec53
1 files changed, 13 insertions, 40 deletions
diff --git a/php-pecl-json-post.spec b/php-pecl-json-post.spec
index c785419..95c7ce7 100644
--- a/php-pecl-json-post.spec
+++ b/php-pecl-json-post.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-pecl-json-post
#
-# Copyright (c) 2015-2023 Remi Collet
+# Copyright (c) 2015-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -14,23 +14,12 @@
%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 json_post
-%if "%{php_version}" < "5.6"
-# after json
-%global ini_name %{pecl_name}.ini
-%else
# after 40-json.ini
%global ini_name 50-%{pecl_name}.ini
-%endif
#global prever RC2
-%global sources %{pecl_name}-%{version}
+%global sources %{pecl_name}-%{version}%{?prever}
%global _configure ../%{sources}/configure
Summary: JSON POST handler
@@ -39,7 +28,7 @@ Version: 1.1.0
Release: 3%{?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
+Source0: https://pecl.php.net/get/%{sources}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -76,7 +65,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
cd %{sources}
@@ -111,26 +100,30 @@ EOF
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure \
--enable-json-post \
--with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+
+%make_build
%if %{with_zts}
cd ../ZTS
%configure \
--enable-json-post \
--with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -139,7 +132,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -150,26 +143,6 @@ do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-%endif
-
-
%check
OPT="-n"
[ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json.so"
@@ -204,7 +177,7 @@ cd ../ZTS
%files
%doc %{pecl_docdir}/%{pecl_name}
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}