blob: 05e45e18b4ace4512a8cbf92c01472e459961cd7 [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
Cristy1eccad32018-09-09 19:34:39 -040010License: https://imagemagick.org/script/license.php
11Url: https://imagemagick.org/
12Source0: https://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
Cristy57c3b502018-02-23 15:44:14 -050027BuildRequires: autoconf automake libtool-ltdl-devel
cristy3ed852e2009-09-05 21:47:34 +000028
29%description
Cristyf9d4d082015-12-21 09:14:43 -050030ImageMagick® 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 +000031
Cristya8a91092015-11-15 17:59:13 -050032The 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 +000033
Cristya8a91092015-11-15 17:59:13 -050034ImageMagick 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 +000035
Cristya8a91092015-11-15 17:59:13 -050036ImageMagick 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 +000037
Cristya8a91092015-11-15 17:59:13 -050038The 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.
39
Cristy1eccad32018-09-09 19:34:39 -040040The 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 +000041
cristy3ed852e2009-09-05 21:47:34 +000042%package devel
cristy32e78242012-03-06 02:42:46 +000043Summary: Library links and header files for ImageMagick application development
cristy3ed852e2009-09-05 21:47:34 +000044Group: Development/Libraries
Cristy8b5a9602017-03-13 15:30:21 -040045Requires: %{name}%{?_isa} = %{version}-%{release}
cristy88fa8ac2014-08-22 07:43:29 +000046Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
47Requires: bzip2-devel, freetype-devel, libtiff-devel, libjpeg-devel, lcms2-devel
Cristy8b5a9602017-03-13 15:30:21 -040048Requires: libwebp-devel, OpenEXR-devel, openjpeg2-devel, pkgconfig
49Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000050
51%description devel
52ImageMagick-devel contains the library links and header files you'll
53need to develop ImageMagick applications. ImageMagick is an image
54manipulation program.
55
56If you want to create applications that will use ImageMagick code or
57APIs, you need to install ImageMagick-devel as well as ImageMagick.
58You do not need to install it if you just want to use ImageMagick,
59however.
60
cristy72c167c2013-03-20 00:42:46 +000061%package libs
62Summary: ImageMagick libraries to link with
63Group: Applications/Multimedia
64
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
70Group: Applications/Multimedia
Cristy8b5a9602017-03-13 15:30:21 -040071Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy8ae77f52011-02-26 15:20:00 +000072
73%description djvu
74This packages contains a plugin for ImageMagick which makes it possible to
75save and load DjvU files from ImageMagick and libMagickCore using applications.
76
77
cristy4e65ec22012-04-08 01:33:27 +000078%package doc
79Summary: ImageMagick HTML documentation
80Group: Documentation
81
cristy3ed852e2009-09-05 21:47:34 +000082%description doc
83ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +000084commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +000085Note this documentation can also be found on the ImageMagick website:
Cristy1eccad32018-09-09 19:34:39 -040086https://imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +000087
cristy3ed852e2009-09-05 21:47:34 +000088
cristyaafc1922011-03-04 16:59:40 +000089%package perl
cristy3ed852e2009-09-05 21:47:34 +000090Summary: ImageMagick perl bindings
91Group: System Environment/Libraries
Cristy8b5a9602017-03-13 15:30:21 -040092Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000093Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
94
cristy32e78242012-03-06 02:42:46 +000095
cristyaafc1922011-03-04 16:59:40 +000096%description perl
cristy3ed852e2009-09-05 21:47:34 +000097Perl bindings to ImageMagick.
98
99Install ImageMagick-perl if you want to use any perl scripts that use
100ImageMagick.
101
cristy8ae77f52011-02-26 15:20:00 +0000102
cristy3ed852e2009-09-05 21:47:34 +0000103%package c++
104Summary: ImageMagick Magick++ library (C++ bindings)
105Group: System Environment/Libraries
Cristy8b5a9602017-03-13 15:30:21 -0400106Requires: %{name}-libs%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +0000107
108%description c++
109This package contains the Magick++ library, a C++ binding to the ImageMagick
110graphics manipulation library.
111
112Install ImageMagick-c++ if you want to use any applications that use Magick++.
113
114
115%package c++-devel
116Summary: C++ bindings for the ImageMagick library
117Group: Development/Libraries
Cristy8b5a9602017-03-13 15:30:21 -0400118Requires: %{name}-c++%{?_isa} = %{version}-%{release}
119Requires: %{name}-devel%{?_isa} = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +0000120
121%description c++-devel
122ImageMagick-devel contains the static libraries and header files you'll
123need to develop ImageMagick applications using the Magick++ C++ bindings.
124ImageMagick is an image manipulation program.
125
126If you want to create applications that will use Magick++ code
127or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
128ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000129
cristy3ed852e2009-09-05 21:47:34 +0000130You don't need to install it if you just want to use ImageMagick, or if you
131want to develop/compile applications using the ImageMagick C interface,
132however.
133
134
135%prep
136%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
Cristya1280c32016-01-06 08:40:42 -0500137
cristy32e78242012-03-06 02:42:46 +0000138# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000139mkdir Magick++/examples
140cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
141
142%build
143%configure --enable-shared \
cristy88fa8ac2014-08-22 07:43:29 +0000144 --disable-static \
145 --with-modules \
146 --with-perl \
147 --with-x \
148 --with-threads \
149 --with-magick_plus_plus \
cristy88fa8ac2014-08-22 07:43:29 +0000150 --with-wmf \
cristy88fa8ac2014-08-22 07:43:29 +0000151 --with-webp \
152 --with-openexr \
Cristyaf552932018-02-27 10:05:14 -0500153 --with-gslib \
cristy88fa8ac2014-08-22 07:43:29 +0000154 --with-rsvg \
155 --with-xml \
Cristy8b3e1192015-12-16 19:20:39 -0500156 --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 -0500157 --without-dps \
Cristya1280c32016-01-06 08:40:42 -0500158 --without-gcc-arch \
159 --with-jbig \
160 --with-openjp2
cristy88fa8ac2014-08-22 07:43:29 +0000161
cristy8ae77f52011-02-26 15:20:00 +0000162# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000163make
164
165
166%install
cristy88fa8ac2014-08-22 07:43:29 +0000167make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
cristy191c9a62014-08-22 12:14:30 +0000168cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000169rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000170
171# fix weird perl Magick.so permissions
Cristy3a6bd702018-05-28 20:22:53 -0400172chmod -f 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/*/*.so
cristy3ed852e2009-09-05 21:47:34 +0000173
174# perlmagick: fix perl path of demo files
175%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
176
177# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000178find %{buildroot} -name "*.bs" |xargs rm -f
179find %{buildroot} -name ".packlist" |xargs rm -f
180find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000181
182# perlmagick: build files list
183echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000184find %{buildroot}/%{_libdir}/perl* -type f -print \
185 | sed "s@^%{buildroot}@@g" > perl-pkg-files
186find %{buildroot}%{perl_vendorarch} -type d -print \
187 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000188 | grep -v '^%dir %{perl_vendorarch}$' \
189 | grep -v '/auto$' >> perl-pkg-files
190if [ -z perl-pkg-files ] ; then
191 echo "ERROR: EMPTY FILE LIST"
192 exit -1
193fi
194
Cristya1280c32016-01-06 08:40:42 -0500195# fix multilib issues: Rename provided file with platform-bits in name.
196# Create platform independant file inplace of provided and conditionally include required.
197# $1 - filename.h to process.
198function multilibFileVersions(){
199mv $1 ${1%%.h}-%{__isa_bits}.h
200
201local basename=$(basename $1)
202
203cat >$1 <<EOF
204#include <bits/wordsize.h>
205
206#if __WORDSIZE == 32
207# include "${basename%%.h}-32.h"
208#elif __WORDSIZE == 64
209# include "${basename%%.h}-64.h"
210#else
211# error "unexpected value for __WORDSIZE macro"
212#endif
213EOF
214}
215
216multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-config.h
217multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-baseconfig.h
218multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/version.h
219
220
cristy88fa8ac2014-08-22 07:43:29 +0000221%check
222export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
223make %{?_smp_mflags} check
224
cristy72c167c2013-03-20 00:42:46 +0000225%post libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000226
227%post c++ -p /sbin/ldconfig
228
cristy72c167c2013-03-20 00:42:46 +0000229%postun libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000230
231%postun c++ -p /sbin/ldconfig
232
cristy3ed852e2009-09-05 21:47:34 +0000233%files
cristy88fa8ac2014-08-22 07:43:29 +0000234%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog Platforms.txt
cristy3ed852e2009-09-05 21:47:34 +0000235%{_bindir}/[a-z]*
cristybcbacef2012-04-08 01:57:35 +0000236%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000237%{_mandir}/man1/%{name}.*
cristy32e78242012-03-06 02:42:46 +0000238
cristy88fa8ac2014-08-22 07:43:29 +0000239%files libs
cristy88fa8ac2014-08-22 07:43:29 +0000240%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
Cristy15bc0d62015-12-17 12:36:54 -0500241%{_libdir}/libMagickCore-7.Q16HDRI.so.*
242%{_libdir}/libMagickWand-7.Q16HDRI.so.*
cristy88fa8ac2014-08-22 07:43:29 +0000243%{_libdir}/%{name}-%{VERSION}
244%{_datadir}/%{name}-7
Cristy15bc0d62015-12-17 12:36:54 -0500245%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
Cristy8b5a9602017-03-13 15:30:21 -0400246%dir %{_sysconfdir}/%{name}-7
247%config(noreplace) %{_sysconfdir}/%{name}-7/*.xml
cristy3ed852e2009-09-05 21:47:34 +0000248
249%files devel
cristy3ed852e2009-09-05 21:47:34 +0000250%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000251%{_bindir}/MagickWand-config
Cristy15bc0d62015-12-17 12:36:54 -0500252%{_libdir}/libMagickCore-7.Q16HDRI.so
253%{_libdir}/libMagickWand-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000254%{_libdir}/pkgconfig/MagickCore.pc
Cristy15bc0d62015-12-17 12:36:54 -0500255%{_libdir}/pkgconfig/MagickCore-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000256%{_libdir}/pkgconfig/ImageMagick.pc
Cristy15bc0d62015-12-17 12:36:54 -0500257%{_libdir}/pkgconfig/ImageMagick-7.Q16HDRI.pc
cristy88fa8ac2014-08-22 07:43:29 +0000258%{_libdir}/pkgconfig/MagickWand.pc
Cristy15bc0d62015-12-17 12:36:54 -0500259%{_libdir}/pkgconfig/MagickWand-7.Q16HDRI.pc
260%dir %{_includedir}/%{name}-7
cristy88fa8ac2014-08-22 07:43:29 +0000261%{_includedir}/%{name}-7/MagickCore
262%{_includedir}/%{name}-7/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000263%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000264%{_mandir}/man1/MagickWand-config.*
265
cristy8ae77f52011-02-26 15:20:00 +0000266%files djvu
Cristy15bc0d62015-12-17 12:36:54 -0500267%{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000268
cristy3ed852e2009-09-05 21:47:34 +0000269%files doc
cristy88fa8ac2014-08-22 07:43:29 +0000270%doc %{_datadir}/doc/%{name}-7
271%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000272%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000273
274%files c++
cristy3ed852e2009-09-05 21:47:34 +0000275%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
276%doc www/Magick++/COPYING
Cristy15bc0d62015-12-17 12:36:54 -0500277%{_libdir}/libMagick++-7.Q16HDRI.so.*
cristy3ed852e2009-09-05 21:47:34 +0000278
279%files c++-devel
cristy3ed852e2009-09-05 21:47:34 +0000280%doc Magick++/examples
281%{_bindir}/Magick++-config
cristy88fa8ac2014-08-22 07:43:29 +0000282%{_includedir}/%{name}-7/Magick++
283%{_includedir}/%{name}-7/Magick++.h
Cristy15bc0d62015-12-17 12:36:54 -0500284%{_libdir}/libMagick++-7.Q16HDRI.so
cristy88fa8ac2014-08-22 07:43:29 +0000285%{_libdir}/pkgconfig/Magick++.pc
Cristy15bc0d62015-12-17 12:36:54 -0500286%{_libdir}/pkgconfig/Magick++-7.Q16HDRI.pc
cristy3ed852e2009-09-05 21:47:34 +0000287%{_mandir}/man1/Magick++-config.*
288
289%files perl -f perl-pkg-files
cristy3ed852e2009-09-05 21:47:34 +0000290%{_mandir}/man3/*
291%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
292
cristy3ed852e2009-09-05 21:47:34 +0000293%changelog
294* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000295- Port of Redhat's RPM script to support ImageMagick.