# https://www.imagemagick.org/discourse-server/viewtopic.php?f=4&t=26801
#
# Conditional build:
+%bcond_without tests
# - features:
%bcond_without cxx # Magick++ library
%bcond_without opencl # OpenCL computing support
%bcond_without fpx # FlashPIX module (which uses fpx library)
%bcond_without flif # FLIF (Free Lossless Image Format) module (which uses flif library)
%bcond_without graphviz # dot module (which uses GraphViz libraries)
+%bcond_without heif # HEIC module (which uses libheif library)
%bcond_without libjxl # JPEG-XL module
%bcond_without openjpeg # JPEG2000 module (which uses openjpeg 2 library)
%bcond_without wmf # WMF module (which uses libwmf library)
%define libpng_ver 2:1.6.34
%define ver 7.1.1
-%define pver 8
+%define pver 31
Summary: Image display, conversion, and manipulation under X
Summary(de.UTF-8): Darstellen, Konvertieren und Bearbeiten von Grafiken unter X
Summary(es.UTF-8): Exhibidor, convertidor y manipulador de imágenes bajo X
Summary(uk.UTF-8): Перегляд, конвертування та обробка зображень під X Window
Name: ImageMagick
Version: %{ver}%{?pver:.%{pver}}
-Release: 2
+Release: 1
Epoch: 1
License: Apache-like
Group: X11/Applications/Graphics
-Source0: https://www.imagemagick.org/download/releases/%{name}-%{ver}-%{pver}.tar.xz
-# Source0-md5: b0a7b899d96f7d85a894db9b3b481b18
-Patch0: config.patch
+Source0: https://download.imagemagick.org/archive/releases/%{name}-%{ver}-%{pver}.tar.lz
+# Source0-md5: 70ca8d5bed3e99dd9b828571b78825d8
+Patch0: %{name}-perl.patch
Patch1: %{name}-link.patch
Patch2: %{name}-libpath.patch
Patch3: %{name}-ldflags.patch
Patch4: %{name}-lt.patch
Patch5: %{name}-OpenCL.patch
-Patch6: %{name}-autotrace.patch
URL: https://imagemagick.org/
%{?with_opencl:BuildRequires: OpenCL-devel}
%{?with_exr:BuildRequires: OpenEXR-devel >= 1.0.6}
BuildRequires: autoconf >= 2.69
BuildRequires: automake >= 1:1.12
-%{?with_autotrace:BuildRequires: autotrace-devel >= 0.31.1}
+%{?with_autotrace:BuildRequires: autotrace-devel >= 0.31.2}
BuildRequires: bzip2-devel >= 1.0.1
%{?with_djvu:BuildRequires: djvulibre-devel >= 3.5.0}
BuildRequires: expat-devel >= 1.95.7
BuildRequires: lcms2-devel >= 2.0
%{?with_fpx:BuildRequires: libfpx-devel >= 1.2.0.4-3}
%{?with_openmp:BuildRequires: libgomp-devel}
-BuildRequires: libheif-devel >= 1.4.0
+%{?with_heif:BuildRequires: libheif-devel >= 1.4.0}
BuildRequires: libjpeg-devel >= 6b
%{?with_libjxl:BuildRequires: libjxl-devel >= 0.7.0}
BuildRequires: liblqr-devel >= 0.1.0
%{?with_wmf:BuildRequires: libwmf-devel >= 2:0.2.2}
BuildRequires: libxml2-devel >= 2.0
BuildRequires: libzip-devel >= 1.0.0
+BuildRequires: lzip
%{?with_openjpeg:BuildRequires: openjpeg2-devel >= 2.1.0}
BuildRequires: pango-devel >= 1:1.28.1
BuildRequires: perl-devel >= 1:5.8.1
BuildRequires: pkgconfig >= 1:0.20
+BuildRequires: rpm-build >= 4.6
BuildRequires: rpm-perlprov >= 4.1-13
BuildRequires: rpmbuild(macros) >= 1.745
BuildRequires: tar >= 1:1.22
#BuildRequires: txt2html
BuildRequires: xorg-lib-libX11-devel
BuildRequires: xorg-lib-libXext-devel
-BuildRequires: xz
BuildRequires: xz-devel >= 2.9.0
BuildRequires: zlib-devel >= 1.0.0
BuildRequires: zstd-devel >= 1.0.0
Summary: ImageMagick documentation
Summary(pl.UTF-8): Dokumentacja do ImageMagick
Group: Documentation
+BuildArch: noarch
%description doc
Documentation for ImageMagick.
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch6 -p1 -R
find -type f | xargs grep -l '/usr/local/bin/perl' | xargs %{__sed} -i -e 's=!/usr/local/bin/perl=!%{__perl}='
--with-gs-font-dir=%{_fontsdir}/Type1 \
--with-gslib%{!?with_gs:=no} \
--with-gvc%{!?with_graphviz:=no} \
+ --with-heic%{!?with_heif:=no} \
--with-jxl%{!?with_libjxl:=no} \
--with-magick_plus_plus%{!?with_cxx:=no} \
--with-openexr%{!?with_exr:=no} \
%{__make} -j1
%{__sed} -i -e 's,/%{name}-%{ver}/,/%{name}-doc-%{version}/,' utilities/*.1
+%{?with_tests:%{__make} check}
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-perl-%{version}
%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Image/Magick/.packlist
%{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
# packaged as %doc
-%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{mver}/{LICENSE,NEWS.txt}
+%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{mver}/LICENSE
# obsoleted by pkg-config
%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
%{modulesdir}/coders/fpx.la
%endif
+%if %{with heif}
%files coder-heic
%defattr(644,root,root,755)
# R: libheif
%attr(755,root,root) %{modulesdir}/coders/heic.so
%{modulesdir}/coders/heic.la
+%endif
%files coder-jbig
%defattr(644,root,root,755)