File dba-imagemagick-7.1.1.44.spec of Package dba-imagemagick-7.1.1.44

%define real_name imagemagick
%define	version	7.1.1
%define vers 711
%define patchlevel 44
%define prefix    /DBA/%{real_name}/%{version}.%{patchlevel}

%if 0%{?centos_version} > 800
%global __strip /bin/true
%endif

Name:		dba-imagemagick-%{vers}%{patchlevel}
Version:	%{version}
Release:	1
Summary:	An X application for displaying and manipulating images
Group:		Applications/Multimedia
License:	ImageMagick
Url:		http://www.imagemagick.org/
Source0:	https://imagemagick.org/archive/releases/ImageMagick-%{version}-%{patchlevel}.tar.xz
Source1:        https://imagemagick.org/archive/releases/ImageMagick-%{version}-%{patchlevel}.tar.xz.asc
Source2:        filter-provides.sh
Source3:        filter-requires.sh
Source4:        %{real_name}-rpmlintrc

%define _use_internal_dependency_generator 0
%define __find_provides %{SOURCE2}
%define __find_requires %{SOURCE3}


BuildRoot:	%{_tmppath}/%{name}-%{version}-%{patchlevel}-build

%if 0%{?suse_version} >= 1200
BuildRequires: -post-build-checks
%endif

#BuildRequires:  cpp gcc-c++ libstdc++-devel
#BuildRequires:	bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
#BuildRequires:	libtiff-devel, zlib-devel, perl-devel >= 5.8.1
BuildRequires:	libtool-ltdl-devel
#BuildRequires:	libX11-devel, libXext-devel, libXt-devel
#BuildRequires:	libxml2-devel, librsvg2-devel

BuildRequires:  chrpath
BuildRequires:  perl(ExtUtils::MakeMaker)
#BuildRequires:  dejavu-fonts
#BuildRequires:  fdupes
BuildRequires:  gcc-c++
#BuildRequires:  libjbig-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libtool
%if 0%{?rhel_version} >= 700
BuildRequires:  libwmf
%else
BuildRequires:  libwmf-devel
%endif
BuildRequires:  pkgconfig
BuildRequires:  xdg-utils
BuildRequires:  xz-devel
BuildRequires:  zip
BuildRequires:  pkgconfig(OpenEXR)
#BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(fftw3)
BuildRequires:  pkgconfig(freetype2)
#BuildRequires:  pkgconfig(ijs)
BuildRequires:  pkgconfig(lcms2)
BuildRequires:  pkgconfig(libexif)
#BuildRequires:  pkgconfig(libheif)
BuildRequires:  pkgconfig(libopenjp2) >= 2.1.0
BuildRequires:  pkgconfig(libraw)
BuildRequires:  pkgconfig(librsvg-2.0)
BuildRequires:  pkgconfig(libtiff-4) >= 4.0.3
BuildRequires:  pkgconfig(libwebp)
BuildRequires:  pkgconfig(libwebpmux)
BuildRequires:  pkgconfig(libxml-2.0)
#BuildRequires:  pkgconfig(lqr-1)
BuildRequires:  pkgconfig(pango)
%if 0%{?suse_version} > 1500
BuildRequires:  pkgconfig(libjxl)
%endif

#!BuildIgnore: urw-base35-fonts

%description
ImageMagick is an image display and manipulation tool for the X
Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF,
and Photo CD image formats. It can resize, rotate, sharpen, color
reduce, or add special effects to an image, and when finished you can
either save the completed work in the original format or a different
one. ImageMagick also includes command line programs for creating
animated or transparent .gifs, creating composite images, creating
thumbnail images, and more.

ImageMagick is one of your choices if you need a program to manipulate
and display images. If you want to develop your own applications
which use ImageMagick code or APIs, you need to install
ImageMagick-devel as well.


%package perl
Summary: ImageMagick perl bindings
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{patchlevel}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $perl_version))

%description perl
Perl bindings to ImageMagick.

Install ImageMagick-perl if you want to use any perl scripts that use
ImageMagick.


%package c++
Summary: ImageMagick Magick++ library (C++ bindings)
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{patchlevel}

%description c++
This package contains the Magick++ library, a C++ binding to the ImageMagick
graphics manipulation library.

Install ImageMagick-c++ if you want to use any applications that use Magick++.

%package devel
Summary:        Development files for ImageMagick's C interface
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}-%{patchlevel}
Requires:       glibc-devel

%description devel
ImageMagick is a robust collection of tools and libraries to read,
write, and manipulate an image in many image formats, including popular
formats like TIFF, JPEG, PNG, PDF, PhotoCD, and GIF. With ImageMagick,
you can create images dynamically, making it suitable for Web
applications. You can also resize, rotate, sharpen, color-reduce, or
add special effects to an image and save your completed work in many
different image formats. Image processing operations are available from
the command line as well as through C, C++, and Perl-based programming
interfaces.


%prep
%setup -q -n ImageMagick-%{version}-%{patchlevel}

%{__chmod} +x %{SOURCE2}
%{__chmod} +x %{SOURCE3}

%build
export PREFIX=%{prefix}
#EXEC-PREFIX
%configure \
  --prefix=%{prefix} \
  --exec-prefix=%{prefix} \
  --disable-silent-rules \
  --enable-shared \
  --without-frozenpaths \
  --with-magick_plus_plus \
  --with-modules \
  --with-threads \
  --with-gs-font-dir=%{_datadir}/fonts/ghostscript \
  --with-perl \
  --with-perl-options="INSTALLDIRS=vendor INSTALLVENDORARCH=%{perl_vendorarch}" \
  --disable-static \
  --with-gvc \
  --with-fftw \
  --with-lcms \
  --with-jbig \
  --with-openjp2 \
  --with-openexr \
  --with-rsvg \
  --with-webp \
  --with-wmf \
  --with-quantum-depth=16 \
  --without-gcc-arch \
  --enable-pipes=no \
  --enable-reproducible-build=yes \
  --disable-openmp 



# Disable rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
# don't build together, PerlMagick could be miscompiled when using parallel build[1]
# [1] http://pkgs.fedoraproject.org/cgit/ImageMagick.git/tree/ImageMagick.spec
%make_build all
%make_build -j1 perl-build

%install
# prevent rpath problem on suse
export NO_BRP_CHECK_RPATH=true

rm -rf %{buildroot}

make "DESTDIR=$RPM_BUILD_ROOT" install
mv -t %{buildroot}%{_sysconfdir}/ImageMagick* %{buildroot}%{_datadir}/ImageMagick*/*.xml

# symlink header file relative to /usr/include/ImageMagick-7/
# so that inclusions like wand/*.h and magick/*.h work
ln -s ./MagickCore %{buildroot}%{_includedir}/ImageMagick-7/magick
ln -s ./MagickWand %{buildroot}%{_includedir}/ImageMagick-7/wand

rm -r %{buildroot}%{_datadir}/doc/ImageMagick-7/
rm %{buildroot}%{_libdir}/*.la
rm %{buildroot}%{_libdir}/ImageMagick-7.1.1/modules-Q16HDRI/coders/*.la

# remove RPATH from perl module
%if 0%{?suse_version}
perl_module=$(find %{buildroot}%{_prefix}/lib/perl5 -name '*.so')
%else
perl_module=$(find %{buildroot}%{_prefix}/lib64/perl5 -name '*.so')
%endif
chmod 755 $perl_module
chrpath -d $perl_module
chmod 555 $perl_module
%if 0%{?suse_version}
%perl_process_packlist
%endif

%{__mkdir_p} %{buildroot}%{prefix}
mv %{buildroot}/etc %{buildroot}%{prefix}/
mv %{buildroot}/usr/bin %{buildroot}%{prefix}/bin
mv %{buildroot}/usr/include %{buildroot}%{prefix}/include
%if 0%{?suse_version}
mv %{buildroot}/usr/lib64 %{buildroot}%{prefix}/lib
mv %{buildroot}/usr/lib/perl5 %{buildroot}%{prefix}/lib/
%else
mv %{buildroot}/usr/lib64 %{buildroot}%{prefix}/lib
%endif
mv %{buildroot}/usr/share %{buildroot}%{prefix}/share

%clean
rm -rf %{buildroot}


%post -p /sbin/ldconfig

%post c++ -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%postun c++ -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%dir %{prefix}
%{prefix}/bin
%{prefix}/etc
%{prefix}/include
%{prefix}/lib
%{prefix}/share
%exclude %{prefix}/share/man/man3

%files perl
%defattr(-,root,root,-)
%dir %{prefix}
%{prefix}/share/man/man3
%{prefix}/lib/perl5

%changelog
* Wed Mar 05 2025 Dennis Hampe <dennis.hampe@bertelsmann.de>
- inital version
openSUSE Build Service is sponsored by