blob: 00abd47e2025527b3e997356ac995b966aa30a06 [file] [log] [blame]
cristy0b55dd32010-06-13 19:04:44 +00001%global VERSION @PACKAGE_VERSION@
2%global Patchlevel @PACKAGE_RELEASE@
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.
9Group: Applications/Multimedia
Cristy64599592016-11-04 22:32:09 -040010License: https://www.imagemagick.org/script/license.php
11Url: https://www.imagemagick.org/
12Source0: https://www.imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
cristy3ed852e2009-09-05 21:47:34 +000013
Cristy8b5a9602017-03-13 15:30:21 -040014Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy88fa8ac2014-08-22 07:43:29 +000015
cristy32e78242012-03-06 02:42:46 +000016BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
18BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
Cristy8b5a9602017-03-13 15:30:21 -040019BuildRequires: perl-generators
cristy32e78242012-03-06 02:42:46 +000020BuildRequires: ghostscript-devel, djvulibre-devel
Cristy8b5a9602017-03-13 15:30:21 -040021BuildRequires: libwmf-devel
cristy32e78242012-03-06 02:42:46 +000022BuildRequires: libX11-devel, libXext-devel, libXt-devel
cristy88fa8ac2014-08-22 07:43:29 +000023BuildRequires: lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
24BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel
Cristya1280c32016-01-06 08:40:42 -050025BuildRequires: jbigkit-devel
26BuildRequires: openjpeg2-devel >= 2.1.0
cristy3ed852e2009-09-05 21:47:34 +000027
28%description
Cristyf9d4d082015-12-21 09:14:43 -050029ImageMagick® 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 +000030
Cristya8a91092015-11-15 17:59:13 -050031The 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 +000032
Cristya8a91092015-11-15 17:59:13 -050033ImageMagick 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 +000034
Cristya8a91092015-11-15 17:59:13 -050035ImageMagick 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 +000036
Cristya8a91092015-11-15 17:59:13 -050037The 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.
38
Cristy64599592016-11-04 22:32:09 -040039The authoritative ImageMagick web site is https://www.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 +000040
cristy3ed852e2009-09-05 21:47:34 +000041%package devel
cristy32e78242012-03-06 02:42:46 +000042Summary: Library links and header files for ImageMagick application development
cristy3ed852e2009-09-05 21:47:34 +000043Group: Development/Libraries
Cristy8b5a9602017-03-13 15:30:21 -040044Requires: %{name}%{?_isa} = %{version}-%{release}
cristy88fa8ac2014-08-22 07:43:29 +000045Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
46Requires: bzip2-devel, freetype-devel, libtiff-devel, libjpeg-devel, lcms2-devel
Cristy8b5a9602017-03-13 15:30:21 -040047Requires: libwebp-devel, OpenEXR-devel, openjpeg2-devel, pkgconfig
48Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000049
50%description devel
51ImageMagick-devel contains the library links and header files you'll
52need to develop ImageMagick applications. ImageMagick is an image
53manipulation program.
54
55If you want to create applications that will use ImageMagick code or
56APIs, you need to install ImageMagick-devel as well as ImageMagick.
57You do not need to install it if you just want to use ImageMagick,
58however.
59
cristy72c167c2013-03-20 00:42:46 +000060%package libs
61Summary: ImageMagick libraries to link with
62Group: Applications/Multimedia
63
64%description libs
65This packages contains a shared libraries to use within other applications.
66
cristy8ae77f52011-02-26 15:20:00 +000067%package djvu
68Summary: DjVu plugin for ImageMagick
69Group: Applications/Multimedia
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
79Group: Documentation
80
cristy3ed852e2009-09-05 21:47:34 +000081%description doc
82ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +000083commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +000084Note this documentation can also be found on the ImageMagick website:
Cristy64599592016-11-04 22:32:09 -040085https://www.imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +000086
cristy3ed852e2009-09-05 21:47:34 +000087
cristyaafc1922011-03-04 16:59:40 +000088%package perl
cristy3ed852e2009-09-05 21:47:34 +000089Summary: ImageMagick perl bindings
90Group: System Environment/Libraries
Cristy8b5a9602017-03-13 15:30:21 -040091Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000092Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
93
cristy32e78242012-03-06 02:42:46 +000094
cristyaafc1922011-03-04 16:59:40 +000095%description perl
cristy3ed852e2009-09-05 21:47:34 +000096Perl bindings to ImageMagick.
97
98Install ImageMagick-perl if you want to use any perl scripts that use
99ImageMagick.
100
cristy8ae77f52011-02-26 15:20:00 +0000101
cristy3ed852e2009-09-05 21:47:34 +0000102%package c++
103Summary: ImageMagick Magick++ library (C++ bindings)
104Group: System Environment/Libraries
Cristy8b5a9602017-03-13 15:30:21 -0400105Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +0000106
107%description c++
108This package contains the Magick++ library, a C++ binding to the ImageMagick
109graphics manipulation library.
110
111Install ImageMagick-c++ if you want to use any applications that use Magick++.
112
113
114%package c++-devel
115Summary: C++ bindings for the ImageMagick library
116Group: Development/Libraries
Cristy8b5a9602017-03-13 15:30:21 -0400117Requires: %{name}-c++%{?_isa} = %{version}-%{release}
118Requires: %{name}-devel%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +0000119
120%description c++-devel
121ImageMagick-devel contains the static libraries and header files you'll
122need to develop ImageMagick applications using the Magick++ C++ bindings.
123ImageMagick is an image manipulation program.
124
125If you want to create applications that will use Magick++ code
126or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
127ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000128
cristy3ed852e2009-09-05 21:47:34 +0000129You don't need to install it if you just want to use ImageMagick, or if you
130want to develop/compile applications using the ImageMagick C interface,
131however.
132
133
134%prep
135%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
Cristya1280c32016-01-06 08:40:42 -0500136
cristy32e78242012-03-06 02:42:46 +0000137# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000138mkdir Magick++/examples
139cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
140
141%build
142%configure --enable-shared \
cristy88fa8ac2014-08-22 07:43:29 +0000143 --disable-static \
144 --with-modules \
145 --with-perl \
146 --with-x \
147 --with-threads \
148 --with-magick_plus_plus \
149 --with-gslib \
150 --with-wmf \
cristy88fa8ac2014-08-22 07:43:29 +0000151 --with-webp \
152 --with-openexr \
153 --with-rsvg \
154 --with-xml \
Cristy8b3e1192015-12-16 19:20:39 -0500155 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/MagickCore/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
Cristya1280c32016-01-06 08:40:42 -0500156 --without-dps \
157 --without-gcc-arch \
158 --with-jbig \
159 --with-openjp2
cristy88fa8ac2014-08-22 07:43:29 +0000160
cristy8ae77f52011-02-26 15:20:00 +0000161# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000162make
163
164
165%install
cristy88fa8ac2014-08-22 07:43:29 +0000166make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
cristy191c9a62014-08-22 12:14:30 +0000167cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000168rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000169
170# fix weird perl Magick.so permissions
cristy10067ee2013-03-20 11:59:05 +0000171chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/*/*.so
cristy3ed852e2009-09-05 21:47:34 +0000172
173# perlmagick: fix perl path of demo files
174%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
175
176# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000177find %{buildroot} -name "*.bs" |xargs rm -f
178find %{buildroot} -name ".packlist" |xargs rm -f
179find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000180
181# perlmagick: build files list
182echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000183find %{buildroot}/%{_libdir}/perl* -type f -print \
184 | sed "s@^%{buildroot}@@g" > perl-pkg-files
185find %{buildroot}%{perl_vendorarch} -type d -print \
186 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000187 | grep -v '^%dir %{perl_vendorarch}$' \
188 | grep -v '/auto$' >> perl-pkg-files
189if [ -z perl-pkg-files ] ; then
190 echo "ERROR: EMPTY FILE LIST"
191 exit -1
192fi
193
Cristya1280c32016-01-06 08:40:42 -0500194# fix multilib issues: Rename provided file with platform-bits in name.
195# Create platform independant file inplace of provided and conditionally include required.
196# $1 - filename.h to process.
197function multilibFileVersions(){
198mv $1 ${1%%.h}-%{__isa_bits}.h
199
200local basename=$(basename $1)
201
202cat >$1 <<EOF
203#include <bits/wordsize.h>
204
205#if __WORDSIZE == 32
206# include "${basename%%.h}-32.h"
207#elif __WORDSIZE == 64
208# include "${basename%%.h}-64.h"
209#else
210# error "unexpected value for __WORDSIZE macro"
211#endif
212EOF
213}
214
215multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-config.h
216multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-baseconfig.h
217multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/version.h
218
219
cristy88fa8ac2014-08-22 07:43:29 +0000220%check
221export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
222make %{?_smp_mflags} check
223
cristy72c167c2013-03-20 00:42:46 +0000224%post libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000225
226%post c++ -p /sbin/ldconfig
227
cristy72c167c2013-03-20 00:42:46 +0000228%postun libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000229
230%postun c++ -p /sbin/ldconfig
231
cristy3ed852e2009-09-05 21:47:34 +0000232%files
cristy88fa8ac2014-08-22 07:43:29 +0000233%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog Platforms.txt
cristy3ed852e2009-09-05 21:47:34 +0000234%{_bindir}/[a-z]*
cristybcbacef2012-04-08 01:57:35 +0000235%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000236%{_mandir}/man1/%{name}.*
cristy32e78242012-03-06 02:42:46 +0000237
cristy88fa8ac2014-08-22 07:43:29 +0000238%files libs
cristy88fa8ac2014-08-22 07:43:29 +0000239%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
Cristy15bc0d62015-12-17 12:36:54 -0500240%{_libdir}/libMagickCore-7.Q16HDRI.so.*
241%{_libdir}/libMagickWand-7.Q16HDRI.so.*
cristy88fa8ac2014-08-22 07:43:29 +0000242%{_libdir}/%{name}-%{VERSION}
243%{_datadir}/%{name}-7
Cristy15bc0d62015-12-17 12:36:54 -0500244%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
Cristy8b5a9602017-03-13 15:30:21 -0400245%dir %{_sysconfdir}/%{name}-7
246%config(noreplace) %{_sysconfdir}/%{name}-7/*.xml
cristy3ed852e2009-09-05 21:47:34 +0000247
248%files devel
cristy3ed852e2009-09-05 21:47:34 +0000249%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000250%{_bindir}/MagickWand-config
Cristy15bc0d62015-12-17 12:36:54 -0500251%{_libdir}/libMagickCore-7.Q16HDRI.so
252%{_libdir}/libMagickWand-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000253%{_libdir}/pkgconfig/MagickCore.pc
Cristy15bc0d62015-12-17 12:36:54 -0500254%{_libdir}/pkgconfig/MagickCore-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000255%{_libdir}/pkgconfig/ImageMagick.pc
Cristy15bc0d62015-12-17 12:36:54 -0500256%{_libdir}/pkgconfig/ImageMagick-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000257%{_libdir}/pkgconfig/MagickWand.pc
Cristy15bc0d62015-12-17 12:36:54 -0500258%{_libdir}/pkgconfig/MagickWand-7.Q16HDRI.pc
259%dir %{_includedir}/%{name}-7
cristy88fa8ac2014-08-22 07:43:29 +0000260%{_includedir}/%{name}-7/MagickCore
261%{_includedir}/%{name}-7/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000262%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000263%{_mandir}/man1/MagickWand-config.*
264
cristy8ae77f52011-02-26 15:20:00 +0000265%files djvu
Cristy15bc0d62015-12-17 12:36:54 -0500266%{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000267
cristy3ed852e2009-09-05 21:47:34 +0000268%files doc
cristy88fa8ac2014-08-22 07:43:29 +0000269%doc %{_datadir}/doc/%{name}-7
270%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000271%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000272
273%files c++
cristy3ed852e2009-09-05 21:47:34 +0000274%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
275%doc www/Magick++/COPYING
Cristy15bc0d62015-12-17 12:36:54 -0500276%{_libdir}/libMagick++-7.Q16HDRI.so.*
cristy3ed852e2009-09-05 21:47:34 +0000277
278%files c++-devel
cristy3ed852e2009-09-05 21:47:34 +0000279%doc Magick++/examples
280%{_bindir}/Magick++-config
cristy88fa8ac2014-08-22 07:43:29 +0000281%{_includedir}/%{name}-7/Magick++
282%{_includedir}/%{name}-7/Magick++.h
Cristy15bc0d62015-12-17 12:36:54 -0500283%{_libdir}/libMagick++-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000284%{_libdir}/pkgconfig/Magick++.pc
Cristy15bc0d62015-12-17 12:36:54 -0500285%{_libdir}/pkgconfig/Magick++-7.Q16HDRI.pc
cristy3ed852e2009-09-05 21:47:34 +0000286%{_mandir}/man1/Magick++-config.*
287
288%files perl -f perl-pkg-files
cristy3ed852e2009-09-05 21:47:34 +0000289%{_mandir}/man3/*
290%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
291
cristy3ed852e2009-09-05 21:47:34 +0000292%changelog
293* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000294- Port of Redhat's RPM script to support ImageMagick.