blob: fd297fa188cb9a3bd6588be303bf29e13fd79054 [file] [log] [blame]
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001%global VERSION @PACKAGE_BASE_VERSION@
2%global Patchlevel @MAGICK_PATCHLEVEL_VERSION@
cristy3ed852e2009-09-05 21:47:34 +00003
cristy3c9e6e52014-10-08 16:33:07 +00004
cristy32e78242012-03-06 02:42:46 +00005Name: @PACKAGE_NAME@
cristy3c9e6e52014-10-08 16:33:07 +00006Version: %{VERSION}
7Release: %{Patchlevel}
cristy32e78242012-03-06 02:42:46 +00008Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images.
Cristy1eccad32018-09-09 19:34:39 -04009License: https://imagemagick.org/script/license.php
10Url: https://imagemagick.org/
11Source0: https://imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
cristy3ed852e2009-09-05 21:47:34 +000012
cristy32e78242012-03-06 02:42:46 +000013BuildRoot: %{_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
Cristy8b5a9602017-03-13 15:30:21 -040016BuildRequires: perl-generators
Elliott Hughes5d41fba2021-04-12 16:36:42 -070017BuildRequires: ghostscript-devel
18BuildRequires: djvulibre-devel
19BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
cristy32e78242012-03-06 02:42:46 +000020BuildRequires: libX11-devel, libXext-devel, libXt-devel
Elliott Hughes5d41fba2021-04-12 16:36:42 -070021BuildRequires: lcms2-devel, libxml2-devel, librsvg2-devel
22BuildRequires: fftw-devel, ilmbase-devel, OpenEXR-devel, libwebp-devel
Cristya1280c32016-01-06 08:40:42 -050023BuildRequires: jbigkit-devel
24BuildRequires: openjpeg2-devel >= 2.1.0
Elliott Hughes5d41fba2021-04-12 16:36:42 -070025BuildRequires: 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}
cristy3ed852e2009-09-05 21:47:34 +000033
34%description
Cristyf9d4d082015-12-21 09:14:43 -050035ImageMagick® 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.
cristy3ed852e2009-09-05 21:47:34 +000036
Cristya8a91092015-11-15 17:59:13 -050037The 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.
cristy32e78242012-03-06 02:42:46 +000038
Cristya8a91092015-11-15 17:59:13 -050039ImageMagick utilizes multiple computational threads to increase performance and can read, process, or write mega-, giga-, or tera-pixel image sizes.
cristy32e78242012-03-06 02:42:46 +000040
Cristya8a91092015-11-15 17:59:13 -050041ImageMagick 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.
cristy8ae77f52011-02-26 15:20:00 +000042
Cristya8a91092015-11-15 17:59:13 -050043The 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
Cristy1eccad32018-09-09 19:34:39 -040045The 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.
cristy4a478472010-06-05 01:59:10 +000046
cristy3ed852e2009-09-05 21:47:34 +000047%package devel
cristy32e78242012-03-06 02:42:46 +000048Summary: Library links and header files for ImageMagick application development
Cristy8b5a9602017-03-13 15:30:21 -040049Requires: %{name}%{?_isa} = %{version}-%{release}
Cristy8b5a9602017-03-13 15:30:21 -040050Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000051
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
cristy72c167c2013-03-20 00:42:46 +000062%package libs
63Summary: ImageMagick libraries to link with
cristy72c167c2013-03-20 00:42:46 +000064
65%description libs
66This packages contains a shared libraries to use within other applications.
67
cristy8ae77f52011-02-26 15:20:00 +000068%package djvu
69Summary: DjVu plugin for ImageMagick
Cristy8b5a9602017-03-13 15:30:21 -040070Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy8ae77f52011-02-26 15:20:00 +000071
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
cristy4e65ec22012-04-08 01:33:27 +000077%package doc
78Summary: ImageMagick HTML documentation
cristy4e65ec22012-04-08 01:33:27 +000079
cristy3ed852e2009-09-05 21:47:34 +000080%description doc
81ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +000082commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +000083Note this documentation can also be found on the ImageMagick website:
Cristy1eccad32018-09-09 19:34:39 -040084https://imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +000085
cristy3ed852e2009-09-05 21:47:34 +000086
cristyaafc1922011-03-04 16:59:40 +000087%package perl
cristy3ed852e2009-09-05 21:47:34 +000088Summary: ImageMagick perl bindings
Cristy8b5a9602017-03-13 15:30:21 -040089Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000090Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
91
cristy32e78242012-03-06 02:42:46 +000092
cristyaafc1922011-03-04 16:59:40 +000093%description perl
cristy3ed852e2009-09-05 21:47:34 +000094Perl bindings to ImageMagick.
95
96Install ImageMagick-perl if you want to use any perl scripts that use
97ImageMagick.
98
cristy8ae77f52011-02-26 15:20:00 +000099
cristy3ed852e2009-09-05 21:47:34 +0000100%package c++
101Summary: ImageMagick Magick++ library (C++ bindings)
Cristy8b5a9602017-03-13 15:30:21 -0400102Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +0000103
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
Cristy8b5a9602017-03-13 15:30:21 -0400113Requires: %{name}-c++%{?_isa} = %{version}-%{release}
114Requires: %{name}-devel%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +0000115
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.
cristy32e78242012-03-06 02:42:46 +0000124
cristy3ed852e2009-09-05 21:47:34 +0000125You 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}
Cristya1280c32016-01-06 08:40:42 -0500132
cristy32e78242012-03-06 02:42:46 +0000133# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000134mkdir Magick++/examples
135cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
136
137%build
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700138autoconf -f -i
139export CFLAGS="%{optflags} -DIMPNG_SETJMP_IS_THREAD_SAFE"
cristy3ed852e2009-09-05 21:47:34 +0000140%configure --enable-shared \
cristy88fa8ac2014-08-22 07:43:29 +0000141 --disable-static \
142 --with-modules \
143 --with-perl \
144 --with-x \
145 --with-threads \
146 --with-magick_plus_plus \
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700147 --with-gslib \
cristy88fa8ac2014-08-22 07:43:29 +0000148 --with-wmf \
cristy88fa8ac2014-08-22 07:43:29 +0000149 --with-webp \
150 --with-openexr \
151 --with-rsvg \
152 --with-xml \
Cristy8b3e1192015-12-16 19:20:39 -0500153 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/MagickCore/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
Cristyd02c72b2018-01-12 20:39:03 -0500154 --without-dps \
Cristya1280c32016-01-06 08:40:42 -0500155 --without-gcc-arch \
156 --with-jbig \
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700157 --with-openjp2 \
158 --with-raw \
159 --with-lqr \
160 --with-gvc \
161 --with-raqm
cristy88fa8ac2014-08-22 07:43:29 +0000162
cristy8ae77f52011-02-26 15:20:00 +0000163# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000164make
165
166
167%install
cristy88fa8ac2014-08-22 07:43:29 +0000168make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
cristy191c9a62014-08-22 12:14:30 +0000169cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000170rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000171
cristy3ed852e2009-09-05 21:47:34 +0000172# 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
cristy72182d82012-03-19 00:37:22 +0000176find %{buildroot} -name "*.bs" |xargs rm -f
177find %{buildroot} -name ".packlist" |xargs rm -f
178find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000179
180# perlmagick: build files list
181echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000182find %{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" \
cristy3ed852e2009-09-05 21:47:34 +0000186 | 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
Cristya1280c32016-01-06 08:40:42 -0500193# 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
cristy88fa8ac2014-08-22 07:43:29 +0000219%check
220export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700221%make_build check
cristy88fa8ac2014-08-22 07:43:29 +0000222
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700223%ldconfig_scriptlets libs
224%ldconfig_scriptlets c++
cristy3ed852e2009-09-05 21:47:34 +0000225
cristy3ed852e2009-09-05 21:47:34 +0000226%files
Cristy96ab5162020-09-25 14:03:19 +0000227%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog
cristy3ed852e2009-09-05 21:47:34 +0000228%{_bindir}/[a-z]*
cristybcbacef2012-04-08 01:57:35 +0000229%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000230%{_mandir}/man1/%{name}.*
cristy32e78242012-03-06 02:42:46 +0000231
cristy88fa8ac2014-08-22 07:43:29 +0000232%files libs
cristy88fa8ac2014-08-22 07:43:29 +0000233%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
Cristy15bc0d62015-12-17 12:36:54 -0500234%{_libdir}/libMagickCore-7.Q16HDRI.so.*
235%{_libdir}/libMagickWand-7.Q16HDRI.so.*
cristy88fa8ac2014-08-22 07:43:29 +0000236%{_libdir}/%{name}-%{VERSION}
237%{_datadir}/%{name}-7
Cristy15bc0d62015-12-17 12:36:54 -0500238%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
Cristy8b5a9602017-03-13 15:30:21 -0400239%dir %{_sysconfdir}/%{name}-7
240%config(noreplace) %{_sysconfdir}/%{name}-7/*.xml
cristy3ed852e2009-09-05 21:47:34 +0000241
242%files devel
cristy3ed852e2009-09-05 21:47:34 +0000243%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000244%{_bindir}/MagickWand-config
Cristy15bc0d62015-12-17 12:36:54 -0500245%{_libdir}/libMagickCore-7.Q16HDRI.so
246%{_libdir}/libMagickWand-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000247%{_libdir}/pkgconfig/MagickCore.pc
Cristy15bc0d62015-12-17 12:36:54 -0500248%{_libdir}/pkgconfig/MagickCore-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000249%{_libdir}/pkgconfig/ImageMagick.pc
Cristy15bc0d62015-12-17 12:36:54 -0500250%{_libdir}/pkgconfig/ImageMagick-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000251%{_libdir}/pkgconfig/MagickWand.pc
Cristy15bc0d62015-12-17 12:36:54 -0500252%{_libdir}/pkgconfig/MagickWand-7.Q16HDRI.pc
253%dir %{_includedir}/%{name}-7
cristy88fa8ac2014-08-22 07:43:29 +0000254%{_includedir}/%{name}-7/MagickCore
255%{_includedir}/%{name}-7/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000256%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000257%{_mandir}/man1/MagickWand-config.*
258
cristy8ae77f52011-02-26 15:20:00 +0000259%files djvu
Cristy15bc0d62015-12-17 12:36:54 -0500260%{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000261
cristy3ed852e2009-09-05 21:47:34 +0000262%files doc
cristy88fa8ac2014-08-22 07:43:29 +0000263%doc %{_datadir}/doc/%{name}-7
264%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000265%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000266
267%files c++
cristy3ed852e2009-09-05 21:47:34 +0000268%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
269%doc www/Magick++/COPYING
Cristy15bc0d62015-12-17 12:36:54 -0500270%{_libdir}/libMagick++-7.Q16HDRI.so.*
cristy3ed852e2009-09-05 21:47:34 +0000271
272%files c++-devel
cristy3ed852e2009-09-05 21:47:34 +0000273%doc Magick++/examples
274%{_bindir}/Magick++-config
cristy88fa8ac2014-08-22 07:43:29 +0000275%{_includedir}/%{name}-7/Magick++
276%{_includedir}/%{name}-7/Magick++.h
Cristy15bc0d62015-12-17 12:36:54 -0500277%{_libdir}/libMagick++-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000278%{_libdir}/pkgconfig/Magick++.pc
Cristy15bc0d62015-12-17 12:36:54 -0500279%{_libdir}/pkgconfig/Magick++-7.Q16HDRI.pc
cristy3ed852e2009-09-05 21:47:34 +0000280%{_mandir}/man1/Magick++-config.*
281
282%files perl -f perl-pkg-files
cristy3ed852e2009-09-05 21:47:34 +0000283%{_mandir}/man3/*
284%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
285
cristy3ed852e2009-09-05 21:47:34 +0000286%changelog
287* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000288- Port of Redhat's RPM script to support ImageMagick.