- Use _multibuild (prepare to build for php8)

- Use php_cfgdir and php_extdir macros to determine location of files

OBS-URL: https://build.opensuse.org/package/show/server:php:extensions/php-imagick?expand=0&rev=3
This commit is contained in:
Arjen de Korte 2021-02-18 23:11:30 +00:00 committed by Git OBS Bridge
parent ac2ec9d254
commit fe97ee8178
4 changed files with 36 additions and 18 deletions

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>php7</package>
<!--<package>php8</package>-->
</multibuild>

1
php-imagick-rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("invalid-spec-name")

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Feb 18 23:10:08 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>
- Use _multibuild (prepare to build for php8)
- Use php_cfgdir and php_extdir macros to determine location of files
-------------------------------------------------------------------
Fri Jan 8 07:22:07 UTC 2021 - Arjen de Korte <suse+build@de-korte.org>

View File

@ -1,5 +1,5 @@
#
# spec file for package php7-imagick
# spec file for package php-imagick
#
# Copyright (c) 2021 SUSE LLC
#
@ -17,7 +17,20 @@
%define pkg_name imagick
Name: php7-%{pkg_name}
%define flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == ""
%define php_name php
ExclusiveArch: do-not-build
%else
%define php_name %{flavor}
%endif
%if 0%{?suse_version} <= 1500
%define php_extdir %(%{__php_config} --extension-dir)
%define php_cfgdir %{_sysconfdir}/%{php_name}/conf.d
%endif
Name: %{php_name}-%{pkg_name}
Version: 3.4.4
Release: 0
Summary: Wrapper to the ImageMagick library
@ -26,20 +39,17 @@ Group: Productivity/Networking/Web/Servers
URL: https://pecl.php.net/package/imagick
Source0: https://pecl.php.net/get/%{pkg_name}-%{version}.tgz
Source1: %{pkg_name}.ini
Source2: php-%{pkg_name}-rpmlintrc
Patch0: imagick-reproducible.patch
BuildRequires: ImageMagick-devel >= 6.5.3.10
BuildRequires: ghostscript-fonts-std
BuildRequires: php7-devel >= 7.0.1
BuildRequires: %{php_name}-devel >= 7.0.1
BuildRequires: re2c
Conflicts: php7-gmagick
Provides: php-%{pkg_name} = %{version}
Obsoletes: php-%{pkg_name} < %{version}
%if %{?php_zend_api}0
Requires: php(api) = %{php_core_api}
Requires: php(zend-abi) = %{php_zend_api}
%else
%requires_eq php7
%endif
%description
PHP extension to create, modify and obtain meta information of images using
@ -53,31 +63,28 @@ mkdir %{name}
rm tests/229_Tutorial_fxAnalyzeImage_case1.phpt
%build
%{_bindir}/phpize
export CFLAGS="%{optflags} -fvisibility=hidden"
%{__phpize}
%configure --with-%{pkg_name}=%{_usr}
make %{?_smp_mflags}
%make_build
%check
%if 0%{?qemu_user_space_build}
export TEST_TIMEOUT=600
%endif
make %{?_smp_mflags} PHP_EXECUTABLE=%{__php} NO_INTERACTION=1 test \
%make_build PHP_EXECUTABLE=%{__php} NO_INTERACTION=1 test \
|| { for f in tests/*.out; do cat $f; echo '------'; done; exit 1; }
%install
make DESTDIR=%{buildroot} install INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/php7/conf.d
install --mode=0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/php7/conf.d/%{pkg_name}.ini
# remove not used header file(s)
rm -rf %{buildroot}/%{_includedir}/php7/ext/%{pkg_name}/
make install-modules INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{php_cfgdir}
install --mode=0644 %{SOURCE1} %{buildroot}%{php_cfgdir}/%{pkg_name}.ini
%files
%defattr(-,root,root,-)
%{_libdir}/php7/extensions/%{pkg_name}.so
%config(noreplace) %{_sysconfdir}/php7/conf.d/%{pkg_name}.ini
%license LICENSE
%doc ChangeLog CREDITS
%config(noreplace) %{_sysconfdir}/php7/conf.d/%{pkg_name}.ini
%{php_extdir}/%{pkg_name}.so
%changelog