blob: 7620de53f20d99c80245d5ce4a8d900c3b6ab669 [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'" \
cristy78772dd2012-12-07 12:09:26 +0000167 --without-dps
cristy3ed852e2009-09-05 21:47:34 +0000168# Disable rpath
169sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
170sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
cristy8ae77f52011-02-26 15:20:00 +0000171# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000172make
173
174
175%install
cristy72182d82012-03-19 00:37:22 +0000176rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000177
cristy72182d82012-03-19 00:37:22 +0000178make install DESTDIR=%{buildroot} INSTALL="install -p"
cristy4e65ec22012-04-08 01:33:27 +0000179cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000180rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000181
182# fix weird perl Magick.so permissions
cristy72182d82012-03-19 00:37:22 +0000183chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/Magick.so
cristy3ed852e2009-09-05 21:47:34 +0000184
185# perlmagick: fix perl path of demo files
186%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
187
188# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000189find %{buildroot} -name "*.bs" |xargs rm -f
190find %{buildroot} -name ".packlist" |xargs rm -f
191find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000192
193# perlmagick: build files list
194echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000195find %{buildroot}/%{_libdir}/perl* -type f -print \
196 | sed "s@^%{buildroot}@@g" > perl-pkg-files
197find %{buildroot}%{perl_vendorarch} -type d -print \
198 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000199 | grep -v '^%dir %{perl_vendorarch}$' \
200 | grep -v '/auto$' >> perl-pkg-files
201if [ -z perl-pkg-files ] ; then
202 echo "ERROR: EMPTY FILE LIST"
203 exit -1
204fi
205
cristy3ed852e2009-09-05 21:47:34 +0000206# fix multilib issues
207%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
208%define wordsize 64
209%else
210%define wordsize 32
211%endif
212
cristy72182d82012-03-19 00:37:22 +0000213mv %{buildroot}%{_includedir}/%{name}/magick/magick-config.h \
214 %{buildroot}%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
cristy3ed852e2009-09-05 21:47:34 +0000215
cristy72182d82012-03-19 00:37:22 +0000216cat >%{buildroot}%{_includedir}/%{name}/magick/magick-config.h <<EOF
cristy3ed852e2009-09-05 21:47:34 +0000217#ifndef IMAGEMAGICK_MULTILIB
218#define IMAGEMAGICK_MULTILIB
219
220#include <bits/wordsize.h>
221
222#if __WORDSIZE == 32
223# include "magick-config-32.h"
224#elif __WORDSIZE == 64
225# include "magick-config-64.h"
226#else
227# error "unexpected value for __WORDSIZE macro"
228#endif
229
230#endif
231EOF
232
cristy3ed852e2009-09-05 21:47:34 +0000233%clean
cristy72182d82012-03-19 00:37:22 +0000234rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000235
236%post -p /sbin/ldconfig
237
238%post c++ -p /sbin/ldconfig
239
240%postun -p /sbin/ldconfig
241
242%postun c++ -p /sbin/ldconfig
243
cristy3ed852e2009-09-05 21:47:34 +0000244%files
245%defattr(-,root,root,-)
246%doc QuickStart.txt ChangeLog Platforms.txt
247%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
cristy78772dd2012-12-07 12:09:26 +0000248%{_libdir}/libMagickCore*so*
249%{_libdir}/libMagickWand*so*
cristy3ed852e2009-09-05 21:47:34 +0000250%{_bindir}/[a-z]*
cristy4e65ec22012-04-08 01:33:27 +0000251%{_libdir}/%{name}-%{VERSION}
cristy3ed852e2009-09-05 21:47:34 +0000252%{_datadir}/%{name}-%{VERSION}
cristybcbacef2012-04-08 01:57:35 +0000253%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000254%{_mandir}/man1/%{name}.*
cristya90e42c2011-03-04 20:15:33 +0000255%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
cristy0e3d52e2012-04-08 01:52:49 +0000256%{_sysconfdir}/%{name}
cristy32e78242012-03-06 02:42:46 +0000257
cristy3ed852e2009-09-05 21:47:34 +0000258
259%files devel
260%defattr(-,root,root,-)
261%{_bindir}/MagickCore-config
cristy3ed852e2009-09-05 21:47:34 +0000262%{_bindir}/MagickWand-config
cristy78772dd2012-12-07 12:09:26 +0000263%{_libdir}/libMagickCore*so*
264%{_libdir}/libMagickWand*so*
cristycd473302012-12-10 14:32:52 +0000265%{_libdir}/pkgconfig/MagickCore*.pc
266%{_libdir}/pkgconfig/ImageMagick*.pc
267%{_libdir}/pkgconfig/MagickWand*.pc
cristy3ed852e2009-09-05 21:47:34 +0000268%dir %{_includedir}/%{name}
cristya8736f72011-09-11 02:41:20 +0000269%{_includedir}/%{name}/MagickCore
270%{_includedir}/%{name}/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000271%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000272%{_mandir}/man1/MagickWand-config.*
273
cristy8ae77f52011-02-26 15:20:00 +0000274%files djvu
275%defattr(-,root,root,-)
cristy32e78242012-03-06 02:42:46 +0000276%{_libdir}/%{name}-%{version}/modules-Q16/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000277
cristy3ed852e2009-09-05 21:47:34 +0000278%files doc
279%defattr(-,root,root,-)
cristy4e65ec22012-04-08 01:33:27 +0000280%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000281%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000282
283%files c++
284%defattr(-,root,root,-)
285%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
286%doc www/Magick++/COPYING
cristy78772dd2012-12-07 12:09:26 +0000287%{_libdir}/libMagick++*so*
cristy3ed852e2009-09-05 21:47:34 +0000288
289%files c++-devel
290%defattr(-,root,root,-)
291%doc Magick++/examples
292%{_bindir}/Magick++-config
293%{_includedir}/%{name}/Magick++
294%{_includedir}/%{name}/Magick++.h
cristy78772dd2012-12-07 12:09:26 +0000295%{_libdir}/libMagick++*so*
cristycd473302012-12-10 14:32:52 +0000296%{_libdir}/pkgconfig/Magick++*.pc
297%{_libdir}/pkgconfig/ImageMagick++*.pc
cristy3ed852e2009-09-05 21:47:34 +0000298%{_mandir}/man1/Magick++-config.*
299
300%files perl -f perl-pkg-files
301%defattr(-,root,root,-)
302%{_mandir}/man3/*
303%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
304
cristy32e78242012-03-06 02:42:46 +0000305
cristy3ed852e2009-09-05 21:47:34 +0000306%changelog
307* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000308- Port of Redhat's RPM script to support ImageMagick.