diff options
author | Remi Collet <remi@remirepo.net> | 2023-09-01 15:11:56 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-09-01 15:11:56 +0200 |
commit | b8d8c9ad9b6c1f2f4421974bb1cb6ad79088517f (patch) | |
tree | cd12d01a52a9f4b7bbcd19e14de79ffae2f8c7c7 | |
parent | 4a9dfd90e9de0b9be3491654ffddcc576d574ee8 (diff) |
-rw-r--r-- | php-pecl-sdl-mixer.spec | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/php-pecl-sdl-mixer.spec b/php-pecl-sdl-mixer.spec index 78658eb..96739b0 100644 --- a/php-pecl-sdl-mixer.spec +++ b/php-pecl-sdl-mixer.spec @@ -1,18 +1,13 @@ # remirepo spec file for php-pecl-sdl-mixer # -# Copyright (c) 2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2022-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 - -%if 0%{?scl:1} -%scl_package php-pecl-sdl-mixer -%endif +%{?scl:%scl_package php-pecl-sdl-mixer} %bcond_with tests %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} @@ -21,15 +16,17 @@ %global upstream_version 0.4.0 #global upstream_prever RC1 +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure Summary: Binding of SDL_mixer for PHP Name: %{?scl_prefix}php-pecl-sdl-mixer Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: zlib URL: https://pecl.php.net/package/%{pecl_name} -Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -44,7 +41,6 @@ Requires: %{?scl_prefix}php-sdl%{?_isa} >= 2.5.0 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Supplements: %{?scl_prefix}php-sdl%{?_isa} %endif -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-%{pecl_name} = %{version} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} @@ -54,14 +50,6 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -# Other third party repo stuff -Obsoletes: php80-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "8.1" -Obsoletes: php81-pecl-%{pecl_name} <= %{version} -%endif -%endif - %description SDL_mixer extension for PHP provides the binding of functions for audio @@ -72,14 +60,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -mv %{pecl_name}-%{upstream_version}%{?upstream_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 +cd %{sources} # Check version as upstream often forget to update this extver=$(sed -n '/define PHP_SDL_MIXER_VERSION/{s/.* "//;s/".*$//;p}' src/php_sdl_mixer.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then @@ -88,10 +75,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:-dev} fi cd .. - +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif @@ -104,15 +90,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 @@ -133,13 +120,13 @@ make -C ZTS install INSTALL_ROOT=%{buildroot} # Documentation for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do [ -f NTS/$i ] && install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +do [ -f %{sources}/$i ] && install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done %check : Minimal load test for NTS extension -%{_bindir}/php --no-php-ini \ +%{__php} --no-php-ini \ --define extension=sdl \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep -i '^%{pecl_name}$' @@ -154,7 +141,7 @@ done %endif %if %{with tests} -cd NTS +cd %{sources} : Run upstream test suite # ignore deprecated (in SDL 2.5.0) TEST_PHP_ARGS="-n -d error_reporting=24575 -d extension=sdl -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ @@ -183,7 +170,7 @@ fi %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -195,6 +182,9 @@ fi %changelog +* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 0.4.0-2 +- build out of sources tree + * Tue Mar 15 2022 Remi Collet <remi@remirepo.net> - 0.4.0-1 - update to 0.4.0 - drop all patches, all merged upstream |