blob: c5c0b50e0665dba27c17ad3ef8434a92f917663a [file] [log] [blame]
cristyf9349672011-01-01 21:55:15 +00001%global VERSION 6.6.7
cristy7b07f442011-02-23 01:28:53 +00002%global Patchlevel 10
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/
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
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
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
cristy935c86e2010-06-05 23:50:07 +000026ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may freely use, copy, modify, and distribute in both open and proprietary applications. It is distributed under an Apache 2.0-style license, approved by the OSI.
27
28The ImageMagick development process ensures a stable API and ABI. Before each ImageMagick release, we perform a comprehensive security assessment that includes memory and thread error detection to help prevent exploits.ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may freely use, copy, modify, and distribute in both open and proprietary applications. It is distributed under an Apache 2.0-style license, approved by the OSI.
29
cristy3ed852e2009-09-05 21:47:34 +000030%package devel
31Summary: Library links and header files for ImageMagick application development
32Group: Development/Libraries
33Requires: %{name} = %{version}-%{release}
34Requires: libX11-devel, libXext-devel, libXt-devel
35Requires: ghostscript-devel
36Requires: bzip2-devel
37Requires: freetype-devel
38Requires: libtiff-devel
39Requires: libjpeg-devel
40Requires: lcms-devel
41Requires: jasper-devel
42Requires: pkgconfig
43
44%description devel
45ImageMagick-devel contains the library links and header files you'll
46need to develop ImageMagick applications. ImageMagick is an image
47manipulation program.
48
49If you want to create applications that will use ImageMagick code or
50APIs, you need to install ImageMagick-devel as well as ImageMagick.
51You do not need to install it if you just want to use ImageMagick,
52however.
53
54%package doc
55Summary: ImageMagick HTML documentation
56Group: Documentation
57
58%description doc
59ImageMagick documentation, this package contains usage (for the
60commandline tools) and API (for the libraries) documentation in HTML format.
61Note this documentation can also be found on the ImageMagick website:
62http://www.imagemagick.org/
63
cristy75608612011-02-25 23:44:50 +000064%package -n perl-%{name}
cristy3ed852e2009-09-05 21:47:34 +000065Summary: ImageMagick perl bindings
66Group: System Environment/Libraries
cristy75608612011-02-25 23:44:50 +000067Requires: perl-base
cristy3ed852e2009-09-05 21:47:34 +000068Requires: %{name} = %{version}-%{release}
69Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
70
71%description perl
72Perl bindings to ImageMagick.
73
74Install ImageMagick-perl if you want to use any perl scripts that use
75ImageMagick.
76
77%package c++
78Summary: ImageMagick Magick++ library (C++ bindings)
79Group: System Environment/Libraries
80Requires: %{name} = %{version}-%{release}
81
82%description c++
83This package contains the Magick++ library, a C++ binding to the ImageMagick
84graphics manipulation library.
85
86Install ImageMagick-c++ if you want to use any applications that use Magick++.
87
88
89%package c++-devel
90Summary: C++ bindings for the ImageMagick library
91Group: Development/Libraries
92Requires: %{name}-c++ = %{version}-%{release}
93Requires: %{name}-devel = %{version}-%{release}
94
95%description c++-devel
96ImageMagick-devel contains the static libraries and header files you'll
97need to develop ImageMagick applications using the Magick++ C++ bindings.
98ImageMagick is an image manipulation program.
99
100If you want to create applications that will use Magick++ code
101or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
102ImageMagick.
103
104You don't need to install it if you just want to use ImageMagick, or if you
105want to develop/compile applications using the ImageMagick C interface,
106however.
107
108
109%prep
110%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
111sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000112iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000113touch -r README.txt README.txt.tmp
114mv README.txt.tmp README.txt
cristyf8d59ee2011-02-20 18:21:31 +0000115# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000116mkdir Magick++/examples
117cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
118
119%build
120%configure --enable-shared \
121 --disable-static \
122 --with-modules \
123 --with-perl \
124 --with-x \
125 --with-threads \
126 --with-magick_plus_plus \
127 --with-gslib \
128 --with-wmf \
129 --with-lcms \
130 --with-rsvg \
131 --with-xml \
132 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \
133 --without-dps \
134 --without-included-ltdl --with-ltdl-include=%{_includedir} \
135 --with-ltdl-lib=%{_libdir}
136# Disable rpath
137sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
138sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
139make
140
141
142%install
143rm -rf $RPM_BUILD_ROOT
144
145make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
146cp -a www/source $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{VERSION}
147rm $RPM_BUILD_ROOT%{_libdir}/*.la
148
149# fix weird perl Magick.so permissions
cristyb6c017e2010-01-13 19:11:39 +0000150chmod 755 $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Image/Magick/Magick.so
cristy3ed852e2009-09-05 21:47:34 +0000151
152# perlmagick: fix perl path of demo files
153%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
154
155# perlmagick: cleanup various perl tempfiles from the build which get installed
156find $RPM_BUILD_ROOT -name "*.bs" |xargs rm -f
157find $RPM_BUILD_ROOT -name ".packlist" |xargs rm -f
158find $RPM_BUILD_ROOT -name "perllocal.pod" |xargs rm -f
159
160# perlmagick: build files list
161echo "%defattr(-,root,root,-)" > perl-pkg-files
162find $RPM_BUILD_ROOT/%{_libdir}/perl* -type f -print \
163 | sed "s@^$RPM_BUILD_ROOT@@g" > perl-pkg-files
164find $RPM_BUILD_ROOT%{perl_vendorarch} -type d -print \
165 | sed "s@^$RPM_BUILD_ROOT@%dir @g" \
166 | grep -v '^%dir %{perl_vendorarch}$' \
167 | grep -v '/auto$' >> perl-pkg-files
168if [ -z perl-pkg-files ] ; then
169 echo "ERROR: EMPTY FILE LIST"
170 exit -1
171fi
172
173# These don't belong here, we include them in %%doc
174rm $RPM_BUILD_ROOT%{_datadir}/%{name}-%{VERSION}/{ChangeLog,LICENSE,NEWS.txt}
175
176# fix multilib issues
177%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
178%define wordsize 64
179%else
180%define wordsize 32
181%endif
182
183mv $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h \
184 $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
185
186cat >$RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h <<EOF
187#ifndef IMAGEMAGICK_MULTILIB
188#define IMAGEMAGICK_MULTILIB
189
190#include <bits/wordsize.h>
191
192#if __WORDSIZE == 32
193# include "magick-config-32.h"
194#elif __WORDSIZE == 64
195# include "magick-config-64.h"
196#else
197# error "unexpected value for __WORDSIZE macro"
198#endif
199
200#endif
201EOF
202
203
204%clean
205rm -rf $RPM_BUILD_ROOT
206
207
208%post -p /sbin/ldconfig
209
210%post c++ -p /sbin/ldconfig
211
212%postun -p /sbin/ldconfig
213
214%postun c++ -p /sbin/ldconfig
215
216
217%files
218%defattr(-,root,root,-)
219%doc QuickStart.txt ChangeLog Platforms.txt
220%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
221%{_libdir}/libMagickCore.so.*
222%{_libdir}/libMagickWand.so.*
223%{_bindir}/[a-z]*
224%{_libdir}/%{name}-%{VERSION}
225%{_datadir}/%{name}-%{VERSION}
226%{_mandir}/man[145]/[a-z]*
227%{_mandir}/man1/%{name}.*
228
229
230%files devel
231%defattr(-,root,root,-)
232%{_bindir}/MagickCore-config
233%{_bindir}/Magick-config
234%{_bindir}/MagickWand-config
235%{_bindir}/Wand-config
236%{_libdir}/libMagickCore.so
237%{_libdir}/libMagickWand.so
238%{_libdir}/pkgconfig/MagickCore.pc
239%{_libdir}/pkgconfig/ImageMagick.pc
240%{_libdir}/pkgconfig/MagickWand.pc
241%{_libdir}/pkgconfig/Wand.pc
242%dir %{_includedir}/%{name}
243%{_includedir}/%{name}/magick
244%{_includedir}/%{name}/wand
245%{_mandir}/man1/Magick-config.*
246%{_mandir}/man1/MagickCore-config.*
247%{_mandir}/man1/Wand-config.*
248%{_mandir}/man1/MagickWand-config.*
249
250%files doc
251%defattr(-,root,root,-)
252%doc %{_datadir}/doc/%{name}-%{VERSION}
253
254%files c++
255%defattr(-,root,root,-)
256%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
257%doc www/Magick++/COPYING
258%{_libdir}/libMagick++.so.*
259
260%files c++-devel
261%defattr(-,root,root,-)
262%doc Magick++/examples
263%{_bindir}/Magick++-config
264%{_includedir}/%{name}/Magick++
265%{_includedir}/%{name}/Magick++.h
266%{_libdir}/libMagick++.so
267%{_libdir}/pkgconfig/Magick++.pc
268%{_libdir}/pkgconfig/ImageMagick++.pc
269%{_mandir}/man1/Magick++-config.*
270
271%files perl -f perl-pkg-files
272%defattr(-,root,root,-)
273%{_mandir}/man3/*
274%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
275
276
277%changelog
278* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000279- Port of Redhat's RPM script to support ImageMagick.