blob: 27095f569fd848c8b3c4b3b0e9d0e754c9e6b644 [file] [log] [blame]
cristy4a3e2152011-07-02 00:59:04 +00001%global VERSION 7.0.0
cristy87a7f072011-07-01 00:08:52 +00002%global Patchlevel 0
cristy3ed852e2009-09-05 21:47:34 +00003
4Name: ImageMagick
5Version: %{VERSION}
6Release: %{Patchlevel}
cristy75608612011-02-25 23:44:50 +00007Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images.
cristy3ed852e2009-09-05 21:47:34 +00008Group: Applications/Multimedia
9License: http://www.imagemagick.org/script/license.php
10Url: http://www.imagemagick.org/
cristyc998d052011-03-04 17:16:02 +000011Source0: ftp://ftp.imagemagick.org/pub/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
cristy3ed852e2009-09-05 21:47:34 +000012
13BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
14BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
cristy935c86e2010-06-05 23:50:07 +000015BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
cristy3ed852e2009-09-05 21:47:34 +000016BuildRequires: ghostscript-devel, djvulibre-devel
17BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
18BuildRequires: libX11-devel, libXext-devel, libXt-devel
cristy8ae77f52011-02-26 15:20:00 +000019BuildRequires: lcms-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
cristy3ed852e2009-09-05 21:47:34 +000020
21%description
cristy8ae77f52011-02-26 15:20:00 +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
cristy8ae77f52011-02-26 15:20:00 +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.
cristy3ed852e2009-09-05 21:47:34 +000037
cristy8ae77f52011-02-26 15:20:00 +000038ImageMagick 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.
cristy935c86e2010-06-05 23:50:07 +000042
cristy8ae77f52011-02-26 15:20:00 +000043The 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.
50
cristy935c86e2010-06-05 23:50:07 +000051
cristy3ed852e2009-09-05 21:47:34 +000052%package devel
53Summary: Library links and header files for ImageMagick application development
54Group: 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
cristy3ed852e2009-09-05 21:47:34 +000077%package doc
78Summary: ImageMagick HTML documentation
79Group: Documentation
80
cristy8ae77f52011-02-26 15:20:00 +000081
82%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
94commandline tools) and API (for the libraries) documentation in HTML format.
95Note this documentation can also be found on the ImageMagick website:
cristy8ae77f52011-02-26 15:20:00 +000096http://www.imagemagick.org/.
97
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
cristy75608612011-02-25 23:44:50 +0000102Requires: perl-base
cristy3ed852e2009-09-05 21:47:34 +0000103Requires: %{name} = %{version}-%{release}
104Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
105
cristy8ae77f52011-02-26 15:20:00 +0000106
cristy3ed852e2009-09-05 21:47:34 +0000107%description perl
108Perl bindings to ImageMagick.
109
110Install ImageMagick-perl if you want to use any perl scripts that use
111ImageMagick.
112
cristy8ae77f52011-02-26 15:20:00 +0000113
cristy3ed852e2009-09-05 21:47:34 +0000114%package c++
115Summary: ImageMagick Magick++ library (C++ bindings)
116Group: System Environment/Libraries
117Requires: %{name} = %{version}-%{release}
118
119%description c++
120This package contains the Magick++ library, a C++ binding to the ImageMagick
121graphics manipulation library.
122
123Install ImageMagick-c++ if you want to use any applications that use Magick++.
124
125
126%package c++-devel
127Summary: C++ bindings for the ImageMagick library
128Group: Development/Libraries
129Requires: %{name}-c++ = %{version}-%{release}
130Requires: %{name}-devel = %{version}-%{release}
131
132%description c++-devel
133ImageMagick-devel contains the static libraries and header files you'll
134need to develop ImageMagick applications using the Magick++ C++ bindings.
135ImageMagick is an image manipulation program.
136
137If you want to create applications that will use Magick++ code
138or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
139ImageMagick.
140
141You don't need to install it if you just want to use ImageMagick, or if you
142want to develop/compile applications using the ImageMagick C interface,
143however.
144
145
146%prep
147%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
148sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000149iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000150touch -r README.txt README.txt.tmp
151mv README.txt.tmp README.txt
cristyf8d59ee2011-02-20 18:21:31 +0000152# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000153mkdir Magick++/examples
154cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
155
156%build
157%configure --enable-shared \
158 --disable-static \
159 --with-modules \
160 --with-perl \
161 --with-x \
162 --with-threads \
163 --with-magick_plus_plus \
164 --with-gslib \
165 --with-wmf \
166 --with-lcms \
167 --with-rsvg \
168 --with-xml \
cristy9cf47962011-02-26 22:02:10 +0000169 --with-perl-options='INSTALLDIRS=vendor' \
cristy3ed852e2009-09-05 21:47:34 +0000170 --without-dps \
171 --without-included-ltdl --with-ltdl-include=%{_includedir} \
172 --with-ltdl-lib=%{_libdir}
173# Disable rpath
174sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
175sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
cristy8ae77f52011-02-26 15:20:00 +0000176# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000177make
178
179
180%install
181rm -rf $RPM_BUILD_ROOT
182
183make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
184cp -a www/source $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{VERSION}
185rm $RPM_BUILD_ROOT%{_libdir}/*.la
186
187# fix weird perl Magick.so permissions
cristyb6c017e2010-01-13 19:11:39 +0000188chmod 755 $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Image/Magick/Magick.so
cristy3ed852e2009-09-05 21:47:34 +0000189
190# perlmagick: fix perl path of demo files
191%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
192
193# perlmagick: cleanup various perl tempfiles from the build which get installed
194find $RPM_BUILD_ROOT -name "*.bs" |xargs rm -f
195find $RPM_BUILD_ROOT -name ".packlist" |xargs rm -f
196find $RPM_BUILD_ROOT -name "perllocal.pod" |xargs rm -f
197
198# perlmagick: build files list
199echo "%defattr(-,root,root,-)" > perl-pkg-files
200find $RPM_BUILD_ROOT/%{_libdir}/perl* -type f -print \
201 | sed "s@^$RPM_BUILD_ROOT@@g" > perl-pkg-files
202find $RPM_BUILD_ROOT%{perl_vendorarch} -type d -print \
203 | sed "s@^$RPM_BUILD_ROOT@%dir @g" \
204 | grep -v '^%dir %{perl_vendorarch}$' \
205 | grep -v '/auto$' >> perl-pkg-files
206if [ -z perl-pkg-files ] ; then
207 echo "ERROR: EMPTY FILE LIST"
208 exit -1
209fi
210
cristy3ed852e2009-09-05 21:47:34 +0000211# fix multilib issues
212%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
213%define wordsize 64
214%else
215%define wordsize 32
216%endif
217
218mv $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h \
219 $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
220
221cat >$RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h <<EOF
222#ifndef IMAGEMAGICK_MULTILIB
223#define IMAGEMAGICK_MULTILIB
224
225#include <bits/wordsize.h>
226
227#if __WORDSIZE == 32
228# include "magick-config-32.h"
229#elif __WORDSIZE == 64
230# include "magick-config-64.h"
231#else
232# error "unexpected value for __WORDSIZE macro"
233#endif
234
235#endif
236EOF
237
cristy3ed852e2009-09-05 21:47:34 +0000238%clean
239rm -rf $RPM_BUILD_ROOT
240
241
242%post -p /sbin/ldconfig
243
244%post c++ -p /sbin/ldconfig
245
246%postun -p /sbin/ldconfig
247
248%postun c++ -p /sbin/ldconfig
249
250
251%files
252%defattr(-,root,root,-)
253%doc QuickStart.txt ChangeLog Platforms.txt
254%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
cristy3412d852011-09-13 12:17:53 +0000255%{_libdir}/libMagickCore.so*
256%{_libdir}/libMagickWand.so*
cristy3ed852e2009-09-05 21:47:34 +0000257%{_bindir}/[a-z]*
cristyad378282011-03-28 19:22:19 +0000258%{_sysconfdir}/%{name}
cristy3ed852e2009-09-05 21:47:34 +0000259%{_libdir}/%{name}-%{VERSION}
260%{_datadir}/%{name}-%{VERSION}
cristy3cf8a722011-03-20 23:32:22 +0000261%{_mandir}/man[145]/[a-zA-Z]*
cristy3ed852e2009-09-05 21:47:34 +0000262%{_mandir}/man1/%{name}.*
cristy6c70aec2011-03-04 20:48:09 +0000263%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
cristy3ed852e2009-09-05 21:47:34 +0000264
265
266%files devel
267%defattr(-,root,root,-)
268%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000269%{_bindir}/MagickWand-config
cristy3412d852011-09-13 12:17:53 +0000270%{_libdir}/libMagickCore.so*
271%{_libdir}/libMagickWand.so*
cristy3ed852e2009-09-05 21:47:34 +0000272%{_libdir}/pkgconfig/MagickCore.pc
273%{_libdir}/pkgconfig/ImageMagick.pc
274%{_libdir}/pkgconfig/MagickWand.pc
cristy3ed852e2009-09-05 21:47:34 +0000275%dir %{_includedir}/%{name}
cristy3412d852011-09-13 12:17:53 +0000276%{_includedir}/%{name}/MagickCore
277%{_includedir}/%{name}/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000278%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000279%{_mandir}/man1/MagickWand-config.*
280
cristy8ae77f52011-02-26 15:20:00 +0000281%files djvu
282%defattr(-,root,root,-)
cristybe3c5be2011-03-05 17:35:07 +0000283%{_libdir}/%{name}-%{version}/modules-Q16/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000284
cristy3ed852e2009-09-05 21:47:34 +0000285%files doc
286%defattr(-,root,root,-)
cristy4ebe5f02011-03-27 02:36:01 +0000287%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000288%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000289
290%files c++
291%defattr(-,root,root,-)
292%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
293%doc www/Magick++/COPYING
cristy3412d852011-09-13 12:17:53 +0000294%{_libdir}/libMagick++.so*
cristy3ed852e2009-09-05 21:47:34 +0000295
296%files c++-devel
297%defattr(-,root,root,-)
298%doc Magick++/examples
299%{_bindir}/Magick++-config
300%{_includedir}/%{name}/Magick++
301%{_includedir}/%{name}/Magick++.h
cristy3412d852011-09-13 12:17:53 +0000302%{_libdir}/libMagick++.so*
cristy3ed852e2009-09-05 21:47:34 +0000303%{_libdir}/pkgconfig/Magick++.pc
304%{_libdir}/pkgconfig/ImageMagick++.pc
305%{_mandir}/man1/Magick++-config.*
306
307%files perl -f perl-pkg-files
308%defattr(-,root,root,-)
309%{_mandir}/man3/*
310%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
311
312
313%changelog
314* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000315- Port of Redhat's RPM script to support ImageMagick.