blob: 2bf9570d811f70c76856536736727f629b57b1b5 [file] [log] [blame]
cristyb36feb22010-03-26 16:54:37 +00001%define VERSION 6.6.1
cristybebec402010-04-23 19:19:08 +00002%define Patchlevel 6
cristy3ed852e2009-09-05 21:47:34 +00003
4Name: ImageMagick
5Version: %{VERSION}
6Release: %{Patchlevel}
7Summary: ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 200) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bezier curves.
8Group: Applications/Multimedia
9License: http://www.imagemagick.org/script/license.php
10Url: http://www.imagemagick.org/
11Source0: ftp://ftp.imagemagick.org/pub/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
12
13BuildRoot: %{_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
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
20
21%description
22ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including DPX, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
23
24The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), nMagick (Neko/haXe), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images automagically and dynamically.
25
26ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems.
27
28%package devel
29Summary: Library links and header files for ImageMagick application development
30Group: Development/Libraries
31Requires: %{name} = %{version}-%{release}
32Requires: libX11-devel, libXext-devel, libXt-devel
33Requires: ghostscript-devel
34Requires: bzip2-devel
35Requires: freetype-devel
36Requires: libtiff-devel
37Requires: libjpeg-devel
38Requires: lcms-devel
39Requires: jasper-devel
40Requires: pkgconfig
41
42%description devel
43ImageMagick-devel contains the library links and header files you'll
44need to develop ImageMagick applications. ImageMagick is an image
45manipulation program.
46
47If you want to create applications that will use ImageMagick code or
48APIs, you need to install ImageMagick-devel as well as ImageMagick.
49You do not need to install it if you just want to use ImageMagick,
50however.
51
52%package doc
53Summary: ImageMagick HTML documentation
54Group: Documentation
55
56%description doc
57ImageMagick documentation, this package contains usage (for the
58commandline tools) and API (for the libraries) documentation in HTML format.
59Note this documentation can also be found on the ImageMagick website:
60http://www.imagemagick.org/
61
62
63%package perl
64Summary: ImageMagick perl bindings
65Group: System Environment/Libraries
66Requires: %{name} = %{version}-%{release}
67Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
68
69%description perl
70Perl bindings to ImageMagick.
71
72Install ImageMagick-perl if you want to use any perl scripts that use
73ImageMagick.
74
75%package c++
76Summary: ImageMagick Magick++ library (C++ bindings)
77Group: System Environment/Libraries
78Requires: %{name} = %{version}-%{release}
79
80%description c++
81This package contains the Magick++ library, a C++ binding to the ImageMagick
82graphics manipulation library.
83
84Install ImageMagick-c++ if you want to use any applications that use Magick++.
85
86
87%package c++-devel
88Summary: C++ bindings for the ImageMagick library
89Group: Development/Libraries
90Requires: %{name}-c++ = %{version}-%{release}
91Requires: %{name}-devel = %{version}-%{release}
92
93%description c++-devel
94ImageMagick-devel contains the static libraries and header files you'll
95need to develop ImageMagick applications using the Magick++ C++ bindings.
96ImageMagick is an image manipulation program.
97
98If you want to create applications that will use Magick++ code
99or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
100ImageMagick.
101
102You don't need to install it if you just want to use ImageMagick, or if you
103want to develop/compile applications using the ImageMagick C interface,
104however.
105
106
107%prep
108%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
109sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000110iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000111touch -r README.txt README.txt.tmp
112mv README.txt.tmp README.txt
113# for %doc
114mkdir Magick++/examples
115cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
116
117%build
118%configure --enable-shared \
119 --disable-static \
120 --with-modules \
121 --with-perl \
122 --with-x \
123 --with-threads \
124 --with-magick_plus_plus \
125 --with-gslib \
126 --with-wmf \
127 --with-lcms \
128 --with-rsvg \
129 --with-xml \
130 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \
131 --without-dps \
132 --without-included-ltdl --with-ltdl-include=%{_includedir} \
133 --with-ltdl-lib=%{_libdir}
134# Disable rpath
135sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
136sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
137make
138
139
140%install
141rm -rf $RPM_BUILD_ROOT
142
143make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
144cp -a www/source $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{VERSION}
145rm $RPM_BUILD_ROOT%{_libdir}/*.la
146
147# fix weird perl Magick.so permissions
cristyb6c017e2010-01-13 19:11:39 +0000148chmod 755 $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Image/Magick/Magick.so
cristy3ed852e2009-09-05 21:47:34 +0000149
150# perlmagick: fix perl path of demo files
151%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
152
153# perlmagick: cleanup various perl tempfiles from the build which get installed
154find $RPM_BUILD_ROOT -name "*.bs" |xargs rm -f
155find $RPM_BUILD_ROOT -name ".packlist" |xargs rm -f
156find $RPM_BUILD_ROOT -name "perllocal.pod" |xargs rm -f
157
158# perlmagick: build files list
159echo "%defattr(-,root,root,-)" > perl-pkg-files
160find $RPM_BUILD_ROOT/%{_libdir}/perl* -type f -print \
161 | sed "s@^$RPM_BUILD_ROOT@@g" > perl-pkg-files
162find $RPM_BUILD_ROOT%{perl_vendorarch} -type d -print \
163 | sed "s@^$RPM_BUILD_ROOT@%dir @g" \
164 | grep -v '^%dir %{perl_vendorarch}$' \
165 | grep -v '/auto$' >> perl-pkg-files
166if [ -z perl-pkg-files ] ; then
167 echo "ERROR: EMPTY FILE LIST"
168 exit -1
169fi
170
171# These don't belong here, we include them in %%doc
172rm $RPM_BUILD_ROOT%{_datadir}/%{name}-%{VERSION}/{ChangeLog,LICENSE,NEWS.txt}
173
174# fix multilib issues
175%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
176%define wordsize 64
177%else
178%define wordsize 32
179%endif
180
181mv $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h \
182 $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
183
184cat >$RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h <<EOF
185#ifndef IMAGEMAGICK_MULTILIB
186#define IMAGEMAGICK_MULTILIB
187
188#include <bits/wordsize.h>
189
190#if __WORDSIZE == 32
191# include "magick-config-32.h"
192#elif __WORDSIZE == 64
193# include "magick-config-64.h"
194#else
195# error "unexpected value for __WORDSIZE macro"
196#endif
197
198#endif
199EOF
200
201
202%clean
203rm -rf $RPM_BUILD_ROOT
204
205
206%post -p /sbin/ldconfig
207
208%post c++ -p /sbin/ldconfig
209
210%postun -p /sbin/ldconfig
211
212%postun c++ -p /sbin/ldconfig
213
214
215%files
216%defattr(-,root,root,-)
217%doc QuickStart.txt ChangeLog Platforms.txt
218%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
219%{_libdir}/libMagickCore.so.*
220%{_libdir}/libMagickWand.so.*
221%{_bindir}/[a-z]*
222%{_libdir}/%{name}-%{VERSION}
223%{_datadir}/%{name}-%{VERSION}
224%{_mandir}/man[145]/[a-z]*
225%{_mandir}/man1/%{name}.*
226
227
228%files devel
229%defattr(-,root,root,-)
230%{_bindir}/MagickCore-config
231%{_bindir}/Magick-config
232%{_bindir}/MagickWand-config
233%{_bindir}/Wand-config
234%{_libdir}/libMagickCore.so
235%{_libdir}/libMagickWand.so
236%{_libdir}/pkgconfig/MagickCore.pc
237%{_libdir}/pkgconfig/ImageMagick.pc
238%{_libdir}/pkgconfig/MagickWand.pc
239%{_libdir}/pkgconfig/Wand.pc
240%dir %{_includedir}/%{name}
241%{_includedir}/%{name}/magick
242%{_includedir}/%{name}/wand
243%{_mandir}/man1/Magick-config.*
244%{_mandir}/man1/MagickCore-config.*
245%{_mandir}/man1/Wand-config.*
246%{_mandir}/man1/MagickWand-config.*
247
248%files doc
249%defattr(-,root,root,-)
250%doc %{_datadir}/doc/%{name}-%{VERSION}
251
252%files c++
253%defattr(-,root,root,-)
254%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
255%doc www/Magick++/COPYING
256%{_libdir}/libMagick++.so.*
257
258%files c++-devel
259%defattr(-,root,root,-)
260%doc Magick++/examples
261%{_bindir}/Magick++-config
262%{_includedir}/%{name}/Magick++
263%{_includedir}/%{name}/Magick++.h
264%{_libdir}/libMagick++.so
265%{_libdir}/pkgconfig/Magick++.pc
266%{_libdir}/pkgconfig/ImageMagick++.pc
267%{_mandir}/man1/Magick++-config.*
268
269%files perl -f perl-pkg-files
270%defattr(-,root,root,-)
271%{_mandir}/man3/*
272%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
273
274
275%changelog
276* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
277* Port of Redhat's RPM script to support ImageMagick.