From ea8663682975738b00e003dd7ce818c6ceaf7894 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 1 Oct 2024 08:18:38 +0200 Subject: fix [-Wincompatible-pointer-types] since 8.1 using patch from from https://github.com/beberlei/env/pull/10 --- php-pecl-env.spec | 63 +++++++++++++------------------------------------------ 1 file changed, 15 insertions(+), 48 deletions(-) (limited to 'php-pecl-env.spec') diff --git a/php-pecl-env.spec b/php-pecl-env.spec index cda9714..6fc42e2 100644 --- a/php-pecl-env.spec +++ b/php-pecl-env.spec @@ -11,30 +11,24 @@ %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name env -%if "%{php_version}" < "5.6" -%global ini_name %{pecl_name}.ini -%else %global ini_name 40-%{pecl_name}.ini -%endif %global sources %{pecl_name}-%{version} %global _configure ../%{sources}/configure Summary: Load environment variables Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 0.2.1 -Release: 12%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 13%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT URL: https://pecl.php.net/package/%{pecl_name} Source: https://pecl.php.net/get/%{sources}.tgz Patch0: %{pecl_name}-pr4.patch -Patch1: %{pecl_name}-pr8.patch Patch2: %{pecl_name}-pr10.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc -# ignore min PHP version 5.5 (as work with 5.4) BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear @@ -46,20 +40,6 @@ 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 "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -# Other third party repo stuff -%if "%{php_version}" > "7.3" -Obsoletes: php73-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.0" -Obsoletes: php80-pecl-%{pecl_name} <= %{version} -%endif -%endif - - %description Based on 12Factor Application rules this extension allows you to load environment variables into every PHP request, @@ -74,12 +54,11 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO # Remove test file to avoid regsitration 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} %patch -P0 -p1 -b .pr4 -%patch -P1 -p1 -b .pr8 %patch -P2 -p1 -b .pr10 # Check upstream version (often broken) @@ -106,13 +85,16 @@ mkdir NTS ZTS 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-env \ --with-libdir=%{_lib} \ --with-php-config=%{__phpconfig} -make %{?_smp_mflags} + +%make_build %if %{with_zts} cd ../ZTS @@ -120,14 +102,15 @@ cd ../ZTS --enable-env \ --with-libdir=%{_lib} \ --with-php-config=%{__ztsphpconfig} -make %{?_smp_mflags} + +%make_build %endif %install %{?dtsenable} -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS # Install XML package description install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml @@ -136,7 +119,7 @@ install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml install -Dpm644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} %if %{with_zts} -make -C ZTS install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -Dpm644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -176,28 +159,8 @@ REPORT_EXIT_STATUS=1 \ %endif -%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 - - %files -%{?_licensedir:%license %{sources}/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -211,6 +174,10 @@ fi %changelog +* Tue Oct 1 2024 Remi Collet - 0.2.1-13 +- fix [-Wincompatible-pointer-types] since 8.1 using patch from + from https://github.com/beberlei/env/pull/10 + * Fri Sep 1 2023 Remi Collet - 0.2.1-12 - build out of sources tree -- cgit