blob: 65b039e0cf23fbcf794182b779562d71446f8070 [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
4Name: @PACKAGE_NAME@
cristye79668f2011-11-15 02:03:55 +00005Version: %{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/
cristyd0be5ce2011-11-15 01:17:02 +000011Source0: http://www.imagemagick.org/download/%{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
cristy4a478472010-06-05 01:59:10 +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.
cristy4a478472010-06-05 01:59:10 +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
cristy4a478472010-06-05 01:59:10 +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
102Requires: %{name} = %{version}-%{release}
103Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
104
cristy8ae77f52011-02-26 15:20:00 +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.
139
140You 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
cristyf8d59ee2011-02-20 18:21:31 +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 \
cristy9cf47962011-02-26 22:02:10 +0000168 --with-perl-options='INSTALLDIRS=vendor' \
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
180rm -rf $RPM_BUILD_ROOT
181
182make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
cristye79668f2011-11-15 02:03:55 +0000183cp -a www/source $RPM_BUILD_ROOT%{_datadir}/doc/%{name}
cristy3ed852e2009-09-05 21:47:34 +0000184rm $RPM_BUILD_ROOT%{_libdir}/*.la
185
186# fix weird perl Magick.so permissions
cristyb6c017e2010-01-13 19:11:39 +0000187chmod 755 $RPM_BUILD_ROOT%{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
193find $RPM_BUILD_ROOT -name "*.bs" |xargs rm -f
194find $RPM_BUILD_ROOT -name ".packlist" |xargs rm -f
195find $RPM_BUILD_ROOT -name "perllocal.pod" |xargs rm -f
196
197# perlmagick: build files list
198echo "%defattr(-,root,root,-)" > perl-pkg-files
199find $RPM_BUILD_ROOT/%{_libdir}/perl* -type f -print \
200 | sed "s@^$RPM_BUILD_ROOT@@g" > perl-pkg-files
201find $RPM_BUILD_ROOT%{perl_vendorarch} -type d -print \
202 | sed "s@^$RPM_BUILD_ROOT@%dir @g" \
203 | 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
217mv $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h \
218 $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
219
220cat >$RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h <<EOF
221#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
238rm -rf $RPM_BUILD_ROOT
239
240
241%post -p /sbin/ldconfig
242
243%post c++ -p /sbin/ldconfig
244
245%postun -p /sbin/ldconfig
246
247%postun c++ -p /sbin/ldconfig
248
249
250%files
251%defattr(-,root,root,-)
252%doc QuickStart.txt ChangeLog Platforms.txt
253%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
cristya8736f72011-09-11 02:41:20 +0000254%{_libdir}/libMagickCore.so*
255%{_libdir}/libMagickWand.so*
cristy572d2782011-11-14 14:52:17 +0000256%{_libdir}/%{name}-%{VERSION}
cristy3ed852e2009-09-05 21:47:34 +0000257%{_bindir}/[a-z]*
cristyc0439ab2011-03-28 14:15:45 +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}.*
cristya90e42c2011-03-04 20:15:33 +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
cristya8736f72011-09-11 02:41:20 +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}
cristya8736f72011-09-11 02:41:20 +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,-)
cristya6f282b2011-03-04 20:57:54 +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,-)
cristyaf5d0a62011-10-22 01:09:14 +0000287%doc %{_datadir}/doc/%{name}
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
cristya8736f72011-09-11 02:41:20 +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
cristya8736f72011-09-11 02:41:20 +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.