blob: de9d1b15c7f76f47c9fa1c1655ebe951f9a22703 [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
cristy88fa8ac2014-08-22 07:43:29 +000014Requires: %{name}-libs = %{version}-%{release}
15
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
19BuildRequires: ghostscript-devel, djvulibre-devel
20BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
21BuildRequires: libX11-devel, libXext-devel, libXt-devel
cristy88fa8ac2014-08-22 07:43:29 +000022BuildRequires: lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
23BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel
Cristya1280c32016-01-06 08:40:42 -050024BuildRequires: jbigkit-devel
25BuildRequires: openjpeg2-devel >= 2.1.0
cristy3ed852e2009-09-05 21:47:34 +000026
27%description
Cristyf9d4d082015-12-21 09:14:43 -050028ImageMagick® 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 +000029
Cristya8a91092015-11-15 17:59:13 -050030The 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 +000031
Cristya8a91092015-11-15 17:59:13 -050032ImageMagick 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 +000033
Cristya8a91092015-11-15 17:59:13 -050034ImageMagick 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 +000035
Cristya8a91092015-11-15 17:59:13 -050036The 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.
37
Cristy64599592016-11-04 22:32:09 -040038The 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 +000039
cristy3ed852e2009-09-05 21:47:34 +000040%package devel
cristy32e78242012-03-06 02:42:46 +000041Summary: Library links and header files for ImageMagick application development
cristy3ed852e2009-09-05 21:47:34 +000042Group: Development/Libraries
43Requires: %{name} = %{version}-%{release}
cristy88fa8ac2014-08-22 07:43:29 +000044Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
45Requires: bzip2-devel, freetype-devel, libtiff-devel, libjpeg-devel, lcms2-devel
46Requires: libwebp-devel, OpenEXR-devel, jasper-devel, pkgconfig
cristy72c167c2013-03-20 00:42:46 +000047Requires: %{name}-libs = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000048
49%description devel
50ImageMagick-devel contains the library links and header files you'll
51need to develop ImageMagick applications. ImageMagick is an image
52manipulation program.
53
54If you want to create applications that will use ImageMagick code or
55APIs, you need to install ImageMagick-devel as well as ImageMagick.
56You do not need to install it if you just want to use ImageMagick,
57however.
58
cristy72c167c2013-03-20 00:42:46 +000059%package libs
60Summary: ImageMagick libraries to link with
61Group: Applications/Multimedia
62
63%description libs
64This packages contains a shared libraries to use within other applications.
65
cristy8ae77f52011-02-26 15:20:00 +000066%package djvu
67Summary: DjVu plugin for ImageMagick
68Group: Applications/Multimedia
69Requires: %{name} = %{version}-%{release}
70
71%description djvu
72This packages contains a plugin for ImageMagick which makes it possible to
73save and load DjvU files from ImageMagick and libMagickCore using applications.
74
75
cristy4e65ec22012-04-08 01:33:27 +000076%package doc
77Summary: ImageMagick HTML documentation
78Group: Documentation
79
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:
Cristy64599592016-11-04 22:32:09 -040084https://www.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
89Group: System Environment/Libraries
90Requires: %{name} = %{version}-%{release}
91Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
92
cristy32e78242012-03-06 02:42:46 +000093
cristyaafc1922011-03-04 16:59:40 +000094%description perl
cristy3ed852e2009-09-05 21:47:34 +000095Perl bindings to ImageMagick.
96
97Install ImageMagick-perl if you want to use any perl scripts that use
98ImageMagick.
99
cristy8ae77f52011-02-26 15:20:00 +0000100
cristy3ed852e2009-09-05 21:47:34 +0000101%package c++
102Summary: ImageMagick Magick++ library (C++ bindings)
103Group: System Environment/Libraries
104Requires: %{name} = %{version}-%{release}
105
106%description c++
107This package contains the Magick++ library, a C++ binding to the ImageMagick
108graphics manipulation library.
109
110Install ImageMagick-c++ if you want to use any applications that use Magick++.
111
112
113%package c++-devel
114Summary: C++ bindings for the ImageMagick library
115Group: Development/Libraries
116Requires: %{name}-c++ = %{version}-%{release}
117Requires: %{name}-devel = %{version}-%{release}
118
119%description c++-devel
120ImageMagick-devel contains the static libraries and header files you'll
121need to develop ImageMagick applications using the Magick++ C++ bindings.
122ImageMagick is an image manipulation program.
123
124If you want to create applications that will use Magick++ code
125or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
126ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000127
cristy3ed852e2009-09-05 21:47:34 +0000128You don't need to install it if you just want to use ImageMagick, or if you
129want to develop/compile applications using the ImageMagick C interface,
130however.
131
132
133%prep
134%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
Cristya1280c32016-01-06 08:40:42 -0500135
cristy32e78242012-03-06 02:42:46 +0000136# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000137mkdir Magick++/examples
138cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
139
140%build
141%configure --enable-shared \
cristy88fa8ac2014-08-22 07:43:29 +0000142 --disable-static \
143 --with-modules \
144 --with-perl \
145 --with-x \
146 --with-threads \
147 --with-magick_plus_plus \
148 --with-gslib \
149 --with-wmf \
cristy88fa8ac2014-08-22 07:43:29 +0000150 --with-webp \
151 --with-openexr \
152 --with-rsvg \
153 --with-xml \
Cristy8b3e1192015-12-16 19:20:39 -0500154 --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 -0500155 --without-dps \
156 --without-gcc-arch \
157 --with-jbig \
158 --with-openjp2
cristy88fa8ac2014-08-22 07:43:29 +0000159
cristy8ae77f52011-02-26 15:20:00 +0000160# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000161make
162
163
164%install
cristy88fa8ac2014-08-22 07:43:29 +0000165make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
cristy191c9a62014-08-22 12:14:30 +0000166cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000167rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000168
169# fix weird perl Magick.so permissions
cristy10067ee2013-03-20 11:59:05 +0000170chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/*/*.so
cristy3ed852e2009-09-05 21:47:34 +0000171
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
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}
221make %{?_smp_mflags} check
222
cristy72c167c2013-03-20 00:42:46 +0000223%post libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000224
225%post c++ -p /sbin/ldconfig
226
cristy72c167c2013-03-20 00:42:46 +0000227%postun libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000228
229%postun c++ -p /sbin/ldconfig
230
cristy3ed852e2009-09-05 21:47:34 +0000231%files
cristy88fa8ac2014-08-22 07:43:29 +0000232%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog Platforms.txt
cristy3ed852e2009-09-05 21:47:34 +0000233%{_bindir}/[a-z]*
cristybcbacef2012-04-08 01:57:35 +0000234%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000235%{_mandir}/man1/%{name}.*
cristy32e78242012-03-06 02:42:46 +0000236
cristy88fa8ac2014-08-22 07:43:29 +0000237%files libs
cristy88fa8ac2014-08-22 07:43:29 +0000238%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
Cristy15bc0d62015-12-17 12:36:54 -0500239%{_libdir}/libMagickCore-7.Q16HDRI.so.*
240%{_libdir}/libMagickWand-7.Q16HDRI.so.*
cristy88fa8ac2014-08-22 07:43:29 +0000241%{_libdir}/%{name}-%{VERSION}
242%{_datadir}/%{name}-7
Cristy15bc0d62015-12-17 12:36:54 -0500243%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
cristy88fa8ac2014-08-22 07:43:29 +0000244%{_sysconfdir}/%{name}-7
cristy3ed852e2009-09-05 21:47:34 +0000245
246%files devel
cristy3ed852e2009-09-05 21:47:34 +0000247%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000248%{_bindir}/MagickWand-config
Cristy15bc0d62015-12-17 12:36:54 -0500249%{_libdir}/libMagickCore-7.Q16HDRI.so
250%{_libdir}/libMagickWand-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000251%{_libdir}/pkgconfig/MagickCore.pc
Cristy15bc0d62015-12-17 12:36:54 -0500252%{_libdir}/pkgconfig/MagickCore-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000253%{_libdir}/pkgconfig/ImageMagick.pc
Cristy15bc0d62015-12-17 12:36:54 -0500254%{_libdir}/pkgconfig/ImageMagick-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000255%{_libdir}/pkgconfig/MagickWand.pc
Cristy15bc0d62015-12-17 12:36:54 -0500256%{_libdir}/pkgconfig/MagickWand-7.Q16HDRI.pc
257%dir %{_includedir}/%{name}-7
cristy88fa8ac2014-08-22 07:43:29 +0000258%{_includedir}/%{name}-7/MagickCore
259%{_includedir}/%{name}-7/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000260%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000261%{_mandir}/man1/MagickWand-config.*
262
cristy8ae77f52011-02-26 15:20:00 +0000263%files djvu
Cristy15bc0d62015-12-17 12:36:54 -0500264%{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000265
cristy3ed852e2009-09-05 21:47:34 +0000266%files doc
cristy88fa8ac2014-08-22 07:43:29 +0000267%doc %{_datadir}/doc/%{name}-7
268%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000269%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000270
271%files c++
cristy3ed852e2009-09-05 21:47:34 +0000272%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
273%doc www/Magick++/COPYING
Cristy15bc0d62015-12-17 12:36:54 -0500274%{_libdir}/libMagick++-7.Q16HDRI.so.*
cristy3ed852e2009-09-05 21:47:34 +0000275
276%files c++-devel
cristy3ed852e2009-09-05 21:47:34 +0000277%doc Magick++/examples
278%{_bindir}/Magick++-config
cristy88fa8ac2014-08-22 07:43:29 +0000279%{_includedir}/%{name}-7/Magick++
280%{_includedir}/%{name}-7/Magick++.h
Cristy15bc0d62015-12-17 12:36:54 -0500281%{_libdir}/libMagick++-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000282%{_libdir}/pkgconfig/Magick++.pc
Cristy15bc0d62015-12-17 12:36:54 -0500283%{_libdir}/pkgconfig/Magick++-7.Q16HDRI.pc
cristy3ed852e2009-09-05 21:47:34 +0000284%{_mandir}/man1/Magick++-config.*
285
286%files perl -f perl-pkg-files
cristy3ed852e2009-09-05 21:47:34 +0000287%{_mandir}/man3/*
288%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
289
cristy3ed852e2009-09-05 21:47:34 +0000290%changelog
291* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000292- Port of Redhat's RPM script to support ImageMagick.