1%global VERSION  @PACKAGE_BASE_VERSION@
2%global Patchlevel  @MAGICK_PATCHLEVEL_VERSION@
3
4
5Name:           @PACKAGE_NAME@
6Version:        %{VERSION}
7Release:        %{Patchlevel}
8Summary:        Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition resize, rotate, shear, distort and transform images.
9License:        https://imagemagick.org/script/license.php
10Url:            https://imagemagick.org/
11Source0:        https://imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
12
13BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
14BuildRequires:  bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
15BuildRequires:  libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
16BuildRequires:  perl-generators
17BuildRequires:  ghostscript-devel
18BuildRequires:  djvulibre-devel
19BuildRequires:  libwmf-devel, jasper-devel, libtool-ltdl-devel
20BuildRequires:  libX11-devel, libXext-devel, libXt-devel
21BuildRequires:  lcms2-devel, libxml2-devel, librsvg2-devel
22BuildRequires:  fftw-devel, ilmbase-devel, OpenEXR-devel, libwebp-devel
23BuildRequires:  jbigkit-devel
24BuildRequires:  openjpeg2-devel >= 2.1.0
25BuildRequires:  graphviz-devel >= 2.9.0
26BuildRequires:  libraqm-devel
27BuildRequires:  liblqr-1-devel
28BuildRequires:  LibRaw-devel >= 0.14.8
29BuildRequires:  autoconf automake gcc gcc-c++
30BuildRequires: make
31
32Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
33
34%description
35ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
36
37The functionality of ImageMagick is typically utilized from the command-line or you can use the features from programs written in your favorite language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick (Java), L-Magick (Lisp), Lua (LuaJIT), NMagick (Neko/haXe), Magick.NET (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images dynamically and automagically.
38
39ImageMagick utilizes multiple computational threads to increase performance and can read, process, or write mega-, giga-, or tera-pixel image sizes.
40
41ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. It is distributed under the Apache 2.0 license.
42
43The ImageMagick development process ensures a stable API and ABI. Before each ImageMagick release, we perform a comprehensive security assessment that includes memory error and thread data race detection to prevent security vulnerabilities.
44
45The authoritative ImageMagick web site is https://imagemagick.org. The authoritative source code repository is http://git.imagemagick.org/repos/ImageMagick. We maintain a source code mirror at GitHub.
46
47%package devel
48Summary: Library links and header files for ImageMagick application development
49Requires: %{name}%{?_isa} = %{version}-%{release}
50Requires: %{name}-libs%{?_isa} = %{version}-%{release}
51
52%description devel
53ImageMagick-devel contains the library links and header files you'll
54need to develop ImageMagick applications. ImageMagick is an image
55manipulation program.
56
57If you want to create applications that will use ImageMagick code or
58APIs, you need to install ImageMagick-devel as well as ImageMagick.
59You do not need to install it if you just want to use ImageMagick,
60however.
61
62%package libs
63Summary: ImageMagick libraries to link with
64
65%description libs
66This packages contains a shared libraries to use within other applications.
67
68%package djvu
69Summary: DjVu plugin for ImageMagick
70Requires: %{name}-libs%{?_isa} = %{version}-%{release}
71
72%description djvu
73This packages contains a plugin for ImageMagick which makes it possible to
74save and load DjvU files from ImageMagick and libMagickCore using applications.
75
76
77%package doc
78Summary: ImageMagick HTML documentation
79
80%description doc
81ImageMagick documentation, this package contains usage (for the
82commandline tools) and API (for the libraries) documentation in HTML format.
83Note this documentation can also be found on the ImageMagick website:
84https://imagemagick.org/.
85
86
87%package perl
88Summary: ImageMagick perl bindings
89Requires: %{name}-libs%{?_isa} = %{version}-%{release}
90Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
91
92
93%description perl
94Perl bindings to ImageMagick.
95
96Install ImageMagick-perl if you want to use any perl scripts that use
97ImageMagick.
98
99
100%package c++
101Summary: ImageMagick Magick++ library (C++ bindings)
102Requires: %{name}-libs%{?_isa} = %{version}-%{release}
103
104%description c++
105This package contains the Magick++ library, a C++ binding to the ImageMagick
106graphics manipulation library.
107
108Install ImageMagick-c++ if you want to use any applications that use Magick++.
109
110
111%package c++-devel
112Summary: C++ bindings for the ImageMagick library
113Requires: %{name}-c++%{?_isa} = %{version}-%{release}
114Requires: %{name}-devel%{?_isa} = %{version}-%{release}
115
116%description c++-devel
117ImageMagick-devel contains the static libraries and header files you'll
118need to develop ImageMagick applications using the Magick++ C++ bindings.
119ImageMagick is an image manipulation program.
120
121If you want to create applications that will use Magick++ code
122or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
123ImageMagick.
124
125You don't need to install it if you just want to use ImageMagick, or if you
126want to develop/compile applications using the ImageMagick C interface,
127however.
128
129
130%prep
131%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
132
133# for %%doc
134mkdir Magick++/examples
135cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
136
137%build
138autoconf -f -i
139export CFLAGS="%{optflags} -DIMPNG_SETJMP_IS_THREAD_SAFE"
140%configure --enable-shared \
141        --disable-static \
142        --with-modules \
143        --with-perl \
144        --with-x \
145        --with-threads \
146        --with-magick_plus_plus \
147        --with-gslib \
148        --with-wmf \
149        --with-webp \
150        --with-openexr \
151        --with-rsvg \
152        --with-xml \
153        --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/MagickCore/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
154        --without-dps \
155        --without-gcc-arch \
156        --with-jbig \
157        --with-openjp2 \
158        --with-raw \
159        --with-lqr \
160        --with-gvc \
161        --with-raqm
162
163# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
164make
165
166
167%install
168make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
169cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
170rm %{buildroot}%{_libdir}/*.la
171
172# perlmagick: fix perl path of demo files
173%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
174
175# perlmagick: cleanup various perl tempfiles from the build which get installed
176find %{buildroot} -name "*.bs" |xargs rm -f
177find %{buildroot} -name ".packlist" |xargs rm -f
178find %{buildroot} -name "perllocal.pod" |xargs rm -f
179
180# perlmagick: build files list
181echo "%defattr(-,root,root,-)" > perl-pkg-files
182find %{buildroot}/%{_libdir}/perl* -type f -print \
183        | sed "s@^%{buildroot}@@g" > perl-pkg-files
184find %{buildroot}%{perl_vendorarch} -type d -print \
185        | sed "s@^%{buildroot}@%dir @g" \
186        | grep -v '^%dir %{perl_vendorarch}$' \
187        | grep -v '/auto$' >> perl-pkg-files
188if [ -z perl-pkg-files ] ; then
189    echo "ERROR: EMPTY FILE LIST"
190    exit -1
191fi
192
193# fix multilib issues: Rename provided file with platform-bits in name.
194# Create platform independant file inplace of provided and conditionally include required.
195# $1 - filename.h to process.
196function multilibFileVersions(){
197mv $1 ${1%%.h}-%{__isa_bits}.h
198
199local basename=$(basename $1)
200
201cat >$1 <<EOF
202#include <bits/wordsize.h>
203
204#if __WORDSIZE == 32
205# include "${basename%%.h}-32.h"
206#elif __WORDSIZE == 64
207# include "${basename%%.h}-64.h"
208#else
209# error "unexpected value for __WORDSIZE macro"
210#endif
211EOF
212}
213
214multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-config.h
215multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-baseconfig.h
216multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/version.h
217
218
219%check
220export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
221%make_build check
222
223%ldconfig_scriptlets libs
224%ldconfig_scriptlets c++
225
226%files
227%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog
228%{_bindir}/[a-z]*
229%{_mandir}/man[145]/[a-z]*
230%{_mandir}/man1/%{name}.*
231
232%files libs
233%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
234%{_libdir}/libMagickCore-7.Q16HDRI.so.*
235%{_libdir}/libMagickWand-7.Q16HDRI.so.*
236%{_libdir}/%{name}-%{VERSION}
237%{_datadir}/%{name}-7
238%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
239%dir %{_sysconfdir}/%{name}-7
240%config(noreplace) %{_sysconfdir}/%{name}-7/*.xml
241
242%files devel
243%{_bindir}/MagickCore-config
244%{_bindir}/MagickWand-config
245%{_libdir}/libMagickCore-7.Q16HDRI.so
246%{_libdir}/libMagickWand-7.Q16HDRI.so
247%{_libdir}/pkgconfig/MagickCore.pc
248%{_libdir}/pkgconfig/MagickCore-7.Q16HDRI.pc
249%{_libdir}/pkgconfig/ImageMagick.pc
250%{_libdir}/pkgconfig/ImageMagick-7.Q16HDRI.pc
251%{_libdir}/pkgconfig/MagickWand.pc
252%{_libdir}/pkgconfig/MagickWand-7.Q16HDRI.pc
253%dir %{_includedir}/%{name}-7
254%{_includedir}/%{name}-7/MagickCore
255%{_includedir}/%{name}-7/MagickWand
256%{_mandir}/man1/MagickCore-config.*
257%{_mandir}/man1/MagickWand-config.*
258
259%files djvu
260%{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
261
262%files doc
263%doc %{_datadir}/doc/%{name}-7
264%doc %{_datadir}/doc/%{name}-%{VERSION}
265%doc LICENSE
266
267%files c++
268%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
269%doc www/Magick++/COPYING
270%{_libdir}/libMagick++-7.Q16HDRI.so.*
271
272%files c++-devel
273%doc Magick++/examples
274%{_bindir}/Magick++-config
275%{_includedir}/%{name}-7/Magick++
276%{_includedir}/%{name}-7/Magick++.h
277%{_libdir}/libMagick++-7.Q16HDRI.so
278%{_libdir}/pkgconfig/Magick++.pc
279%{_libdir}/pkgconfig/Magick++-7.Q16HDRI.pc
280%{_mandir}/man1/Magick++-config.*
281
282%files perl -f perl-pkg-files
283%{_mandir}/man3/*
284%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
285
286%changelog
287* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
288-  Port of Redhat's RPM script to support ImageMagick.
289