blob: 3b7fa83c06dbe659ede7a902e85fbef085f73494 [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
cristy32e78242012-03-06 02:42:46 +00004Name: @PACKAGE_NAME@
cristy88fa8ac2014-08-22 07:43:29 +00005Version: %{VERSION}.%{Patchlevel}
6Release: 4%{?dist}
cristy32e78242012-03-06 02:42:46 +00007Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images.
8Group: Applications/Multimedia
9License: http://www.imagemagick.org/script/license.php
10Url: http://www.imagemagick.org/
11Source0: http://www.imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
cristy3ed852e2009-09-05 21:47:34 +000012
cristy88fa8ac2014-08-22 07:43:29 +000013Requires: %{name}-libs = %{version}-%{release}
14
cristy32e78242012-03-06 02:42:46 +000015BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
16BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
17BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
18BuildRequires: ghostscript-devel, djvulibre-devel
19BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
20BuildRequires: libX11-devel, libXext-devel, libXt-devel
cristy88fa8ac2014-08-22 07:43:29 +000021BuildRequires: lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
22BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel
cristy3ed852e2009-09-05 21:47:34 +000023
24%description
cristy32e78242012-03-06 02:42:46 +000025ImageMagick is a software suite to create, edit, and compose bitmap images. It
26can read, convert and write images in a variety of formats (about 100)
27including DPX, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
28and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear
29and transform images, adjust image colors, apply various special effects,
30or draw text, lines, polygons, ellipses and Bézier curves.
cristy3ed852e2009-09-05 21:47:34 +000031
cristy32e78242012-03-06 02:42:46 +000032The functionality of ImageMagick is typically utilized from the command line
33or you can use the features from programs written in your favorite programming
34language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand
35(C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), nMagick
36(Neko/haXe), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP
37(PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a
38language interface, use ImageMagick to modify or create images automagically
39and dynamically.
40
41ImageMagick is free software delivered as a ready-to-run binary distribution
42or as source code that you may freely use, copy, modify, and distribute in
43both open and proprietary applications. It is distributed under an Apache
442.0-style license, approved by the OSI.
45
46The ImageMagick development process ensures a stable API and ABI. Before
47each ImageMagick release, we perform a comprehensive security assessment that
48includes memory and thread error detection to help prevent exploits.ImageMagick
49is free software delivered as a ready-to-run binary distribution or as source
50code that you may freely use, copy, modify, and distribute in both open and
51proprietary applications. It is distributed under an Apache 2.0-style license,
52approved by the OSI.
cristy8ae77f52011-02-26 15:20:00 +000053
cristy4a478472010-06-05 01:59:10 +000054
cristy3ed852e2009-09-05 21:47:34 +000055%package devel
cristy32e78242012-03-06 02:42:46 +000056Summary: Library links and header files for ImageMagick application development
cristy3ed852e2009-09-05 21:47:34 +000057Group: Development/Libraries
58Requires: %{name} = %{version}-%{release}
cristy88fa8ac2014-08-22 07:43:29 +000059Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
60Requires: bzip2-devel, freetype-devel, libtiff-devel, libjpeg-devel, lcms2-devel
61Requires: libwebp-devel, OpenEXR-devel, jasper-devel, pkgconfig
cristy72c167c2013-03-20 00:42:46 +000062Requires: %{name}-libs = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000063
64%description devel
65ImageMagick-devel contains the library links and header files you'll
66need to develop ImageMagick applications. ImageMagick is an image
67manipulation program.
68
69If you want to create applications that will use ImageMagick code or
70APIs, you need to install ImageMagick-devel as well as ImageMagick.
71You do not need to install it if you just want to use ImageMagick,
72however.
73
cristy72c167c2013-03-20 00:42:46 +000074%package libs
75Summary: ImageMagick libraries to link with
76Group: Applications/Multimedia
77
78%description libs
79This packages contains a shared libraries to use within other applications.
80
cristy8ae77f52011-02-26 15:20:00 +000081%package djvu
82Summary: DjVu plugin for ImageMagick
83Group: Applications/Multimedia
84Requires: %{name} = %{version}-%{release}
85
86%description djvu
87This packages contains a plugin for ImageMagick which makes it possible to
88save and load DjvU files from ImageMagick and libMagickCore using applications.
89
90
cristy4e65ec22012-04-08 01:33:27 +000091%package doc
92Summary: ImageMagick HTML documentation
93Group: Documentation
94
cristy3ed852e2009-09-05 21:47:34 +000095%description doc
96ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +000097commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +000098Note this documentation can also be found on the ImageMagick website:
cristy32e78242012-03-06 02:42:46 +000099http://www.imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +0000100
cristy3ed852e2009-09-05 21:47:34 +0000101
cristyaafc1922011-03-04 16:59:40 +0000102%package perl
cristy3ed852e2009-09-05 21:47:34 +0000103Summary: ImageMagick perl bindings
104Group: System Environment/Libraries
105Requires: %{name} = %{version}-%{release}
106Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
107
cristy32e78242012-03-06 02:42:46 +0000108
cristyaafc1922011-03-04 16:59:40 +0000109%description perl
cristy3ed852e2009-09-05 21:47:34 +0000110Perl bindings to ImageMagick.
111
112Install ImageMagick-perl if you want to use any perl scripts that use
113ImageMagick.
114
cristy8ae77f52011-02-26 15:20:00 +0000115
cristy3ed852e2009-09-05 21:47:34 +0000116%package c++
117Summary: ImageMagick Magick++ library (C++ bindings)
118Group: System Environment/Libraries
119Requires: %{name} = %{version}-%{release}
120
121%description c++
122This package contains the Magick++ library, a C++ binding to the ImageMagick
123graphics manipulation library.
124
125Install ImageMagick-c++ if you want to use any applications that use Magick++.
126
127
128%package c++-devel
129Summary: C++ bindings for the ImageMagick library
130Group: Development/Libraries
131Requires: %{name}-c++ = %{version}-%{release}
132Requires: %{name}-devel = %{version}-%{release}
133
134%description c++-devel
135ImageMagick-devel contains the static libraries and header files you'll
136need to develop ImageMagick applications using the Magick++ C++ bindings.
137ImageMagick is an image manipulation program.
138
139If you want to create applications that will use Magick++ code
140or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
141ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000142
cristy3ed852e2009-09-05 21:47:34 +0000143You don't need to install it if you just want to use ImageMagick, or if you
144want to develop/compile applications using the ImageMagick C interface,
145however.
146
147
148%prep
149%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
150sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000151iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000152touch -r README.txt README.txt.tmp
153mv README.txt.tmp README.txt
cristy32e78242012-03-06 02:42:46 +0000154# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000155mkdir Magick++/examples
156cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
157
158%build
159%configure --enable-shared \
cristy88fa8ac2014-08-22 07:43:29 +0000160 --disable-static \
161 --with-modules \
162 --with-perl \
163 --with-x \
164 --with-threads \
165 --with-magick_plus_plus \
166 --with-gslib \
167 --with-wmf \
168 --with-lcms2 \
169 --with-webp \
170 --with-openexr \
171 --with-rsvg \
172 --with-xml \
173 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
174 --without-dps
175
cristy3ed852e2009-09-05 21:47:34 +0000176# Disable rpath
177sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
178sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
cristy8ae77f52011-02-26 15:20:00 +0000179# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000180make
181
182
183%install
cristy72182d82012-03-19 00:37:22 +0000184rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000185
cristy88fa8ac2014-08-22 07:43:29 +0000186make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
cristy191c9a62014-08-22 12:14:30 +0000187cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000188rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000189
190# fix weird perl Magick.so permissions
cristy10067ee2013-03-20 11:59:05 +0000191chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/*/*.so
cristy3ed852e2009-09-05 21:47:34 +0000192
193# perlmagick: fix perl path of demo files
194%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
195
196# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000197find %{buildroot} -name "*.bs" |xargs rm -f
198find %{buildroot} -name ".packlist" |xargs rm -f
199find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000200
201# perlmagick: build files list
202echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000203find %{buildroot}/%{_libdir}/perl* -type f -print \
204 | sed "s@^%{buildroot}@@g" > perl-pkg-files
205find %{buildroot}%{perl_vendorarch} -type d -print \
206 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000207 | grep -v '^%dir %{perl_vendorarch}$' \
208 | grep -v '/auto$' >> perl-pkg-files
209if [ -z perl-pkg-files ] ; then
210 echo "ERROR: EMPTY FILE LIST"
211 exit -1
212fi
213
cristy88fa8ac2014-08-22 07:43:29 +0000214%check
215export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
216make %{?_smp_mflags} check
217
cristy3ed852e2009-09-05 21:47:34 +0000218%clean
cristy72182d82012-03-19 00:37:22 +0000219rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000220
cristy72c167c2013-03-20 00:42:46 +0000221%post libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000222
223%post c++ -p /sbin/ldconfig
224
cristy72c167c2013-03-20 00:42:46 +0000225%postun libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000226
227%postun c++ -p /sbin/ldconfig
228
cristy3ed852e2009-09-05 21:47:34 +0000229%files
cristy88fa8ac2014-08-22 07:43:29 +0000230%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog Platforms.txt
cristy3ed852e2009-09-05 21:47:34 +0000231%{_bindir}/[a-z]*
cristybcbacef2012-04-08 01:57:35 +0000232%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000233%{_mandir}/man1/%{name}.*
cristy32e78242012-03-06 02:42:46 +0000234
cristy88fa8ac2014-08-22 07:43:29 +0000235%files libs
236%defattr(-,root,root,-)
237%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
238%{_libdir}/libMagickCore-7.Q16.so.2*
239%{_libdir}/libMagickWand-7.Q16.so.2*
240%{_libdir}/%{name}-%{VERSION}
241%{_datadir}/%{name}-7
242%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
243%{_sysconfdir}/%{name}-7
cristy3ed852e2009-09-05 21:47:34 +0000244
245%files devel
246%defattr(-,root,root,-)
247%{_bindir}/MagickCore-config
cristy88fa8ac2014-08-22 07:43:29 +0000248%{_bindir}/Magick-config
cristy3ed852e2009-09-05 21:47:34 +0000249%{_bindir}/MagickWand-config
cristy88fa8ac2014-08-22 07:43:29 +0000250%{_bindir}/Wand-config
251%{_libdir}/libMagickCore-7.Q16.so
252%{_libdir}/libMagickWand-7.Q16.so
253%{_libdir}/pkgconfig/MagickCore.pc
254%{_libdir}/pkgconfig/MagickCore-7.Q16.pc
255%{_libdir}/pkgconfig/ImageMagick.pc
256%{_libdir}/pkgconfig/ImageMagick-7.Q16.pc
257%{_libdir}/pkgconfig/MagickWand.pc
258%{_libdir}/pkgconfig/MagickWand-7.Q16.pc
259%dir %{_includedir}/%{name}-6
260%{_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
266%defattr(-,root,root,-)
cristy88fa8ac2014-08-22 07:43:29 +0000267%{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000268
cristy3ed852e2009-09-05 21:47:34 +0000269%files doc
270%defattr(-,root,root,-)
cristy88fa8ac2014-08-22 07:43:29 +0000271%doc %{_datadir}/doc/%{name}-7
272%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000273%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000274
275%files c++
276%defattr(-,root,root,-)
277%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
278%doc www/Magick++/COPYING
cristy88fa8ac2014-08-22 07:43:29 +0000279%{_libdir}/libMagick++-7.Q16.so.3*
cristy3ed852e2009-09-05 21:47:34 +0000280
281%files c++-devel
282%defattr(-,root,root,-)
283%doc Magick++/examples
284%{_bindir}/Magick++-config
cristy88fa8ac2014-08-22 07:43:29 +0000285%{_includedir}/%{name}-7/Magick++
286%{_includedir}/%{name}-7/Magick++.h
287%{_libdir}/libMagick++-7.Q16.so
288%{_libdir}/pkgconfig/Magick++.pc
289%{_libdir}/pkgconfig/Magick++-7.Q16.pc
290%{_libdir}/pkgconfig/ImageMagick++.pc
291%{_libdir}/pkgconfig/ImageMagick++-7.Q16.pc
cristy3ed852e2009-09-05 21:47:34 +0000292%{_mandir}/man1/Magick++-config.*
293
294%files perl -f perl-pkg-files
295%defattr(-,root,root,-)
296%{_mandir}/man3/*
297%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
298
cristy3ed852e2009-09-05 21:47:34 +0000299%changelog
300* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000301- Port of Redhat's RPM script to support ImageMagick.