blob: b4b7672e6284ed02abc0b1aba69b672c330fc82b [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@
cristy7593c402012-04-08 02:03:24 +00005Version: %{VERSION}
6Release: %{Patchlevel}
cristy32e78242012-03-06 02:42:46 +00007Summary: 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%package djvu
77Summary: DjVu plugin for ImageMagick
78Group: Applications/Multimedia
79Requires: %{name} = %{version}-%{release}
80
81%description djvu
82This packages contains a plugin for ImageMagick which makes it possible to
83save and load DjvU files from ImageMagick and libMagickCore using applications.
84
85
cristy4e65ec22012-04-08 01:33:27 +000086%package doc
87Summary: ImageMagick HTML documentation
88Group: Documentation
89
cristy3ed852e2009-09-05 21:47:34 +000090%description doc
91ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +000092commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +000093Note this documentation can also be found on the ImageMagick website:
cristy32e78242012-03-06 02:42:46 +000094http://www.imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +000095
cristy3ed852e2009-09-05 21:47:34 +000096
cristyaafc1922011-03-04 16:59:40 +000097%package perl
cristy3ed852e2009-09-05 21:47:34 +000098Summary: ImageMagick perl bindings
99Group: System Environment/Libraries
100Requires: %{name} = %{version}-%{release}
101Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
102
cristy32e78242012-03-06 02:42:46 +0000103
cristyaafc1922011-03-04 16:59:40 +0000104%description perl
cristy3ed852e2009-09-05 21:47:34 +0000105Perl bindings to ImageMagick.
106
107Install ImageMagick-perl if you want to use any perl scripts that use
108ImageMagick.
109
cristy8ae77f52011-02-26 15:20:00 +0000110
cristy3ed852e2009-09-05 21:47:34 +0000111%package c++
112Summary: ImageMagick Magick++ library (C++ bindings)
113Group: System Environment/Libraries
114Requires: %{name} = %{version}-%{release}
115
116%description c++
117This package contains the Magick++ library, a C++ binding to the ImageMagick
118graphics manipulation library.
119
120Install ImageMagick-c++ if you want to use any applications that use Magick++.
121
122
123%package c++-devel
124Summary: C++ bindings for the ImageMagick library
125Group: Development/Libraries
126Requires: %{name}-c++ = %{version}-%{release}
127Requires: %{name}-devel = %{version}-%{release}
128
129%description c++-devel
130ImageMagick-devel contains the static libraries and header files you'll
131need to develop ImageMagick applications using the Magick++ C++ bindings.
132ImageMagick is an image manipulation program.
133
134If you want to create applications that will use Magick++ code
135or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
136ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000137
cristy3ed852e2009-09-05 21:47:34 +0000138You don't need to install it if you just want to use ImageMagick, or if you
139want to develop/compile applications using the ImageMagick C interface,
140however.
141
142
143%prep
144%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
145sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000146iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000147touch -r README.txt README.txt.tmp
148mv README.txt.tmp README.txt
cristy32e78242012-03-06 02:42:46 +0000149# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000150mkdir Magick++/examples
151cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
152
153%build
154%configure --enable-shared \
155 --disable-static \
156 --with-modules \
157 --with-perl \
158 --with-x \
159 --with-threads \
160 --with-magick_plus_plus \
161 --with-gslib \
162 --with-wmf \
163 --with-lcms \
164 --with-rsvg \
165 --with-xml \
cristy72182d82012-03-19 00:37:22 +0000166 --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 +0000167 --without-dps \
168 --without-included-ltdl --with-ltdl-include=%{_includedir} \
169 --with-ltdl-lib=%{_libdir}
170# Disable rpath
171sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
172sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
cristy8ae77f52011-02-26 15:20:00 +0000173# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000174make
175
176
177%install
cristy72182d82012-03-19 00:37:22 +0000178rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000179
cristy72182d82012-03-19 00:37:22 +0000180make install DESTDIR=%{buildroot} INSTALL="install -p"
cristy4e65ec22012-04-08 01:33:27 +0000181cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000182rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000183
184# fix weird perl Magick.so permissions
cristy72182d82012-03-19 00:37:22 +0000185chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/Magick.so
cristy3ed852e2009-09-05 21:47:34 +0000186
187# perlmagick: fix perl path of demo files
188%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
189
190# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000191find %{buildroot} -name "*.bs" |xargs rm -f
192find %{buildroot} -name ".packlist" |xargs rm -f
193find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000194
195# perlmagick: build files list
196echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000197find %{buildroot}/%{_libdir}/perl* -type f -print \
198 | sed "s@^%{buildroot}@@g" > perl-pkg-files
199find %{buildroot}%{perl_vendorarch} -type d -print \
200 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000201 | grep -v '^%dir %{perl_vendorarch}$' \
202 | grep -v '/auto$' >> perl-pkg-files
203if [ -z perl-pkg-files ] ; then
204 echo "ERROR: EMPTY FILE LIST"
205 exit -1
206fi
207
cristy3ed852e2009-09-05 21:47:34 +0000208# fix multilib issues
209%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
210%define wordsize 64
211%else
212%define wordsize 32
213%endif
214
cristy72182d82012-03-19 00:37:22 +0000215mv %{buildroot}%{_includedir}/%{name}/magick/magick-config.h \
216 %{buildroot}%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
cristy3ed852e2009-09-05 21:47:34 +0000217
cristy72182d82012-03-19 00:37:22 +0000218cat >%{buildroot}%{_includedir}/%{name}/magick/magick-config.h <<EOF
cristy3ed852e2009-09-05 21:47:34 +0000219#ifndef IMAGEMAGICK_MULTILIB
220#define IMAGEMAGICK_MULTILIB
221
222#include <bits/wordsize.h>
223
224#if __WORDSIZE == 32
225# include "magick-config-32.h"
226#elif __WORDSIZE == 64
227# include "magick-config-64.h"
228#else
229# error "unexpected value for __WORDSIZE macro"
230#endif
231
232#endif
233EOF
234
cristy3ed852e2009-09-05 21:47:34 +0000235%clean
cristy72182d82012-03-19 00:37:22 +0000236rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000237
238%post -p /sbin/ldconfig
239
240%post c++ -p /sbin/ldconfig
241
242%postun -p /sbin/ldconfig
243
244%postun c++ -p /sbin/ldconfig
245
cristy3ed852e2009-09-05 21:47:34 +0000246%files
247%defattr(-,root,root,-)
248%doc QuickStart.txt ChangeLog Platforms.txt
249%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
cristy32e78242012-03-06 02:42:46 +0000250%{_libdir}/libMagickCore.so*
251%{_libdir}/libMagickWand.so*
cristy3ed852e2009-09-05 21:47:34 +0000252%{_bindir}/[a-z]*
cristy4e65ec22012-04-08 01:33:27 +0000253%{_libdir}/%{name}-%{VERSION}
cristy3ed852e2009-09-05 21:47:34 +0000254%{_datadir}/%{name}-%{VERSION}
cristybcbacef2012-04-08 01:57:35 +0000255%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000256%{_mandir}/man1/%{name}.*
cristya90e42c2011-03-04 20:15:33 +0000257%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
cristy0e3d52e2012-04-08 01:52:49 +0000258%{_sysconfdir}/%{name}
cristy32e78242012-03-06 02:42:46 +0000259
cristy3ed852e2009-09-05 21:47:34 +0000260
261%files devel
262%defattr(-,root,root,-)
263%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000264%{_bindir}/MagickWand-config
cristy32e78242012-03-06 02:42:46 +0000265%{_libdir}/libMagickCore.so*
266%{_libdir}/libMagickWand.so*
cristy3ed852e2009-09-05 21:47:34 +0000267%{_libdir}/pkgconfig/MagickCore.pc
268%{_libdir}/pkgconfig/ImageMagick.pc
269%{_libdir}/pkgconfig/MagickWand.pc
cristy3ed852e2009-09-05 21:47:34 +0000270%dir %{_includedir}/%{name}
cristya8736f72011-09-11 02:41:20 +0000271%{_includedir}/%{name}/MagickCore
272%{_includedir}/%{name}/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000273%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000274%{_mandir}/man1/MagickWand-config.*
275
cristy8ae77f52011-02-26 15:20:00 +0000276%files djvu
277%defattr(-,root,root,-)
cristy32e78242012-03-06 02:42:46 +0000278%{_libdir}/%{name}-%{version}/modules-Q16/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000279
cristy3ed852e2009-09-05 21:47:34 +0000280%files doc
281%defattr(-,root,root,-)
cristy4e65ec22012-04-08 01:33:27 +0000282%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000283%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000284
285%files c++
286%defattr(-,root,root,-)
287%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
288%doc www/Magick++/COPYING
cristy32e78242012-03-06 02:42:46 +0000289%{_libdir}/libMagick++.so*
cristy3ed852e2009-09-05 21:47:34 +0000290
291%files c++-devel
292%defattr(-,root,root,-)
293%doc Magick++/examples
294%{_bindir}/Magick++-config
295%{_includedir}/%{name}/Magick++
296%{_includedir}/%{name}/Magick++.h
cristy32e78242012-03-06 02:42:46 +0000297%{_libdir}/libMagick++.so*
cristy3ed852e2009-09-05 21:47:34 +0000298%{_libdir}/pkgconfig/Magick++.pc
299%{_libdir}/pkgconfig/ImageMagick++.pc
300%{_mandir}/man1/Magick++-config.*
301
302%files perl -f perl-pkg-files
303%defattr(-,root,root,-)
304%{_mandir}/man3/*
305%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
306
cristy32e78242012-03-06 02:42:46 +0000307
cristy3ed852e2009-09-05 21:47:34 +0000308%changelog
309* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000310- Port of Redhat's RPM script to support ImageMagick.