blob: 6fabafb7f2bdef10b19aa03863eae77758e1f4c7 [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@
5Version: %{VERSION}
6Release: %{Patchlevel}
7Summary: 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
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
16BuildRequires: ghostscript-devel, djvulibre-devel
17BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
18BuildRequires: libX11-devel, libXext-devel, libXt-devel
19BuildRequires: lcms-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
cristy3ed852e2009-09-05 21:47:34 +000020
21%description
cristy32e78242012-03-06 02:42:46 +000022ImageMagick is a software suite to create, edit, and compose bitmap images. It
23can read, convert and write images in a variety of formats (about 100)
24including DPX, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
25and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear
26and transform images, adjust image colors, apply various special effects,
27or draw text, lines, polygons, ellipses and Bézier curves.
cristy3ed852e2009-09-05 21:47:34 +000028
cristy32e78242012-03-06 02:42:46 +000029The functionality of ImageMagick is typically utilized from the command line
30or you can use the features from programs written in your favorite programming
31language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand
32(C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), nMagick
33(Neko/haXe), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP
34(PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a
35language interface, use ImageMagick to modify or create images automagically
36and dynamically.
37
38ImageMagick is free software delivered as a ready-to-run binary distribution
39or as source code that you may freely use, copy, modify, and distribute in
40both open and proprietary applications. It is distributed under an Apache
412.0-style license, approved by the OSI.
42
43The ImageMagick development process ensures a stable API and ABI. Before
44each ImageMagick release, we perform a comprehensive security assessment that
45includes memory and thread error detection to help prevent exploits.ImageMagick
46is free software delivered as a ready-to-run binary distribution or as source
47code that you may freely use, copy, modify, and distribute in both open and
48proprietary applications. It is distributed under an Apache 2.0-style license,
49approved by the OSI.
cristy8ae77f52011-02-26 15:20:00 +000050
cristy4a478472010-06-05 01:59:10 +000051
cristy3ed852e2009-09-05 21:47:34 +000052%package devel
cristy32e78242012-03-06 02:42:46 +000053Summary: Library links and header files for ImageMagick application development
cristy3ed852e2009-09-05 21:47:34 +000054Group: Development/Libraries
55Requires: %{name} = %{version}-%{release}
56Requires: libX11-devel, libXext-devel, libXt-devel
57Requires: ghostscript-devel
58Requires: bzip2-devel
59Requires: freetype-devel
60Requires: libtiff-devel
61Requires: libjpeg-devel
62Requires: lcms-devel
63Requires: jasper-devel
64Requires: pkgconfig
65
66%description devel
67ImageMagick-devel contains the library links and header files you'll
68need to develop ImageMagick applications. ImageMagick is an image
69manipulation program.
70
71If you want to create applications that will use ImageMagick code or
72APIs, you need to install ImageMagick-devel as well as ImageMagick.
73You do not need to install it if you just want to use ImageMagick,
74however.
75
cristy8ae77f52011-02-26 15:20:00 +000076
cristy32e78242012-03-06 02:42:46 +000077%package doc
78Summary: ImageMagick HTML documentation
79Group: Documentation
80
81
cristy8ae77f52011-02-26 15:20:00 +000082%package djvu
83Summary: DjVu plugin for ImageMagick
84Group: Applications/Multimedia
85Requires: %{name} = %{version}-%{release}
86
87%description djvu
88This packages contains a plugin for ImageMagick which makes it possible to
89save and load DjvU files from ImageMagick and libMagickCore using applications.
90
91
cristy3ed852e2009-09-05 21:47:34 +000092%description doc
93ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +000094commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +000095Note this documentation can also be found on the ImageMagick website:
cristy32e78242012-03-06 02:42:46 +000096http://www.imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +000097
cristy3ed852e2009-09-05 21:47:34 +000098
cristyaafc1922011-03-04 16:59:40 +000099%package perl
cristy3ed852e2009-09-05 21:47:34 +0000100Summary: ImageMagick perl bindings
101Group: System Environment/Libraries
102Requires: %{name} = %{version}-%{release}
103Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
104
cristy32e78242012-03-06 02:42:46 +0000105
cristyaafc1922011-03-04 16:59:40 +0000106%description perl
cristy3ed852e2009-09-05 21:47:34 +0000107Perl bindings to ImageMagick.
108
109Install ImageMagick-perl if you want to use any perl scripts that use
110ImageMagick.
111
cristy8ae77f52011-02-26 15:20:00 +0000112
cristy3ed852e2009-09-05 21:47:34 +0000113%package c++
114Summary: ImageMagick Magick++ library (C++ bindings)
115Group: System Environment/Libraries
116Requires: %{name} = %{version}-%{release}
117
118%description c++
119This package contains the Magick++ library, a C++ binding to the ImageMagick
120graphics manipulation library.
121
122Install ImageMagick-c++ if you want to use any applications that use Magick++.
123
124
125%package c++-devel
126Summary: C++ bindings for the ImageMagick library
127Group: Development/Libraries
128Requires: %{name}-c++ = %{version}-%{release}
129Requires: %{name}-devel = %{version}-%{release}
130
131%description c++-devel
132ImageMagick-devel contains the static libraries and header files you'll
133need to develop ImageMagick applications using the Magick++ C++ bindings.
134ImageMagick is an image manipulation program.
135
136If you want to create applications that will use Magick++ code
137or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
138ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000139
cristy3ed852e2009-09-05 21:47:34 +0000140You don't need to install it if you just want to use ImageMagick, or if you
141want to develop/compile applications using the ImageMagick C interface,
142however.
143
144
145%prep
146%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
147sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000148iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000149touch -r README.txt README.txt.tmp
150mv README.txt.tmp README.txt
cristy32e78242012-03-06 02:42:46 +0000151# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000152mkdir Magick++/examples
153cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
154
155%build
156%configure --enable-shared \
157 --disable-static \
158 --with-modules \
159 --with-perl \
160 --with-x \
161 --with-threads \
162 --with-magick_plus_plus \
163 --with-gslib \
164 --with-wmf \
165 --with-lcms \
166 --with-rsvg \
167 --with-xml \
cristy72182d82012-03-19 00:37:22 +0000168 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \
cristy3ed852e2009-09-05 21:47:34 +0000169 --without-dps \
170 --without-included-ltdl --with-ltdl-include=%{_includedir} \
171 --with-ltdl-lib=%{_libdir}
172# Disable rpath
173sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
174sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
cristy8ae77f52011-02-26 15:20:00 +0000175# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000176make
177
178
179%install
cristy72182d82012-03-19 00:37:22 +0000180rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000181
cristy72182d82012-03-19 00:37:22 +0000182make install DESTDIR=%{buildroot} INSTALL="install -p"
183cp -a www/source %{buildroot}%{_datadir}/doc/%{name}
184rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000185
186# fix weird perl Magick.so permissions
cristy72182d82012-03-19 00:37:22 +0000187chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/Magick.so
cristy3ed852e2009-09-05 21:47:34 +0000188
189# perlmagick: fix perl path of demo files
190%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
191
192# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000193find %{buildroot} -name "*.bs" |xargs rm -f
194find %{buildroot} -name ".packlist" |xargs rm -f
195find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000196
197# perlmagick: build files list
198echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000199find %{buildroot}/%{_libdir}/perl* -type f -print \
200 | sed "s@^%{buildroot}@@g" > perl-pkg-files
201find %{buildroot}%{perl_vendorarch} -type d -print \
202 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000203 | grep -v '^%dir %{perl_vendorarch}$' \
204 | grep -v '/auto$' >> perl-pkg-files
205if [ -z perl-pkg-files ] ; then
206 echo "ERROR: EMPTY FILE LIST"
207 exit -1
208fi
209
cristy3ed852e2009-09-05 21:47:34 +0000210# fix multilib issues
211%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
212%define wordsize 64
213%else
214%define wordsize 32
215%endif
216
cristy72182d82012-03-19 00:37:22 +0000217mv %{buildroot}%{_includedir}/%{name}/magick/magick-config.h \
218 %{buildroot}%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
cristy3ed852e2009-09-05 21:47:34 +0000219
cristy72182d82012-03-19 00:37:22 +0000220cat >%{buildroot}%{_includedir}/%{name}/magick/magick-config.h <<EOF
cristy3ed852e2009-09-05 21:47:34 +0000221#ifndef IMAGEMAGICK_MULTILIB
222#define IMAGEMAGICK_MULTILIB
223
224#include <bits/wordsize.h>
225
226#if __WORDSIZE == 32
227# include "magick-config-32.h"
228#elif __WORDSIZE == 64
229# include "magick-config-64.h"
230#else
231# error "unexpected value for __WORDSIZE macro"
232#endif
233
234#endif
235EOF
236
cristy3ed852e2009-09-05 21:47:34 +0000237%clean
cristy72182d82012-03-19 00:37:22 +0000238rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000239
240%post -p /sbin/ldconfig
241
242%post c++ -p /sbin/ldconfig
243
244%postun -p /sbin/ldconfig
245
246%postun c++ -p /sbin/ldconfig
247
cristy3ed852e2009-09-05 21:47:34 +0000248%files
249%defattr(-,root,root,-)
250%doc QuickStart.txt ChangeLog Platforms.txt
251%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
cristy32e78242012-03-06 02:42:46 +0000252%{_libdir}/libMagickCore.so*
253%{_libdir}/libMagickWand.so*
254%{_libdir}/%{name}-%{VERSION}
cristy3ed852e2009-09-05 21:47:34 +0000255%{_bindir}/[a-z]*
cristy32e78242012-03-06 02:42:46 +0000256%{_sysconfdir}/%{name}
cristy3ed852e2009-09-05 21:47:34 +0000257%{_libdir}/%{name}-%{VERSION}
258%{_datadir}/%{name}-%{VERSION}
cristy32e78242012-03-06 02:42:46 +0000259%{_mandir}/man[145]/[a-zA-Z]*
cristy3ed852e2009-09-05 21:47:34 +0000260%{_mandir}/man1/%{name}.*
cristya90e42c2011-03-04 20:15:33 +0000261%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
cristy32e78242012-03-06 02:42:46 +0000262
cristy3ed852e2009-09-05 21:47:34 +0000263
264%files devel
265%defattr(-,root,root,-)
266%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000267%{_bindir}/MagickWand-config
cristy32e78242012-03-06 02:42:46 +0000268%{_libdir}/libMagickCore.so*
269%{_libdir}/libMagickWand.so*
cristy3ed852e2009-09-05 21:47:34 +0000270%{_libdir}/pkgconfig/MagickCore.pc
271%{_libdir}/pkgconfig/ImageMagick.pc
272%{_libdir}/pkgconfig/MagickWand.pc
cristy3ed852e2009-09-05 21:47:34 +0000273%dir %{_includedir}/%{name}
cristya8736f72011-09-11 02:41:20 +0000274%{_includedir}/%{name}/MagickCore
275%{_includedir}/%{name}/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000276%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000277%{_mandir}/man1/MagickWand-config.*
278
cristy8ae77f52011-02-26 15:20:00 +0000279%files djvu
280%defattr(-,root,root,-)
cristy32e78242012-03-06 02:42:46 +0000281%{_libdir}/%{name}-%{version}/modules-Q16/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000282
cristy3ed852e2009-09-05 21:47:34 +0000283%files doc
284%defattr(-,root,root,-)
cristy32e78242012-03-06 02:42:46 +0000285%doc %{_datadir}/doc/%{name}
cristy8ae77f52011-02-26 15:20:00 +0000286%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000287
288%files c++
289%defattr(-,root,root,-)
290%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
291%doc www/Magick++/COPYING
cristy32e78242012-03-06 02:42:46 +0000292%{_libdir}/libMagick++.so*
cristy3ed852e2009-09-05 21:47:34 +0000293
294%files c++-devel
295%defattr(-,root,root,-)
296%doc Magick++/examples
297%{_bindir}/Magick++-config
298%{_includedir}/%{name}/Magick++
299%{_includedir}/%{name}/Magick++.h
cristy32e78242012-03-06 02:42:46 +0000300%{_libdir}/libMagick++.so*
cristy3ed852e2009-09-05 21:47:34 +0000301%{_libdir}/pkgconfig/Magick++.pc
302%{_libdir}/pkgconfig/ImageMagick++.pc
303%{_mandir}/man1/Magick++-config.*
304
305%files perl -f perl-pkg-files
306%defattr(-,root,root,-)
307%{_mandir}/man3/*
308%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
309
cristy32e78242012-03-06 02:42:46 +0000310
cristy3ed852e2009-09-05 21:47:34 +0000311%changelog
312* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000313- Port of Redhat's RPM script to support ImageMagick.