blob: e12e461c6def11e8baef0efc5c7c0737693d5125 [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
cristy3c9e6e52014-10-08 16:33:07 +00004
cristy32e78242012-03-06 02:42:46 +00005Name: @PACKAGE_NAME@
cristy3c9e6e52014-10-08 16:33:07 +00006Version: %{VERSION}
7Release: %{Patchlevel}
cristy32e78242012-03-06 02:42:46 +00008Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images.
9Group: Applications/Multimedia
10License: http://www.imagemagick.org/script/license.php
11Url: http://www.imagemagick.org/
12Source0: http://www.imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
cristy3ed852e2009-09-05 21:47:34 +000013
cristy88fa8ac2014-08-22 07:43:29 +000014Requires: %{name}-libs = %{version}-%{release}
15
cristy32e78242012-03-06 02:42:46 +000016BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
18BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
19BuildRequires: ghostscript-devel, djvulibre-devel
20BuildRequires: libwmf-devel, jasper-devel, libtool-ltdl-devel
21BuildRequires: libX11-devel, libXext-devel, libXt-devel
cristy88fa8ac2014-08-22 07:43:29 +000022BuildRequires: lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
23BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel
cristy3ed852e2009-09-05 21:47:34 +000024
25%description
cristy32e78242012-03-06 02:42:46 +000026ImageMagick is a software suite to create, edit, and compose bitmap images. It
27can read, convert and write images in a variety of formats (about 100)
28including DPX, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
29and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear
30and transform images, adjust image colors, apply various special effects,
31or draw text, lines, polygons, ellipses and Bézier curves.
cristy3ed852e2009-09-05 21:47:34 +000032
cristy32e78242012-03-06 02:42:46 +000033The functionality of ImageMagick is typically utilized from the command line
34or you can use the features from programs written in your favorite programming
35language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand
36(C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), nMagick
37(Neko/haXe), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP
38(PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a
39language interface, use ImageMagick to modify or create images automagically
40and dynamically.
41
42ImageMagick is free software delivered as a ready-to-run binary distribution
43or as source code that you may freely use, copy, modify, and distribute in
44both open and proprietary applications. It is distributed under an Apache
452.0-style license, approved by the OSI.
46
47The ImageMagick development process ensures a stable API and ABI. Before
48each ImageMagick release, we perform a comprehensive security assessment that
49includes memory and thread error detection to help prevent exploits.ImageMagick
50is free software delivered as a ready-to-run binary distribution or as source
51code that you may freely use, copy, modify, and distribute in both open and
52proprietary applications. It is distributed under an Apache 2.0-style license,
53approved by the OSI.
cristy8ae77f52011-02-26 15:20:00 +000054
cristy4a478472010-06-05 01:59:10 +000055
cristy3ed852e2009-09-05 21:47:34 +000056%package devel
cristy32e78242012-03-06 02:42:46 +000057Summary: Library links and header files for ImageMagick application development
cristy3ed852e2009-09-05 21:47:34 +000058Group: Development/Libraries
59Requires: %{name} = %{version}-%{release}
cristy88fa8ac2014-08-22 07:43:29 +000060Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
61Requires: bzip2-devel, freetype-devel, libtiff-devel, libjpeg-devel, lcms2-devel
62Requires: libwebp-devel, OpenEXR-devel, jasper-devel, pkgconfig
cristy72c167c2013-03-20 00:42:46 +000063Requires: %{name}-libs = %{version}-%{release}
cristy3ed852e2009-09-05 21:47:34 +000064
65%description devel
66ImageMagick-devel contains the library links and header files you'll
67need to develop ImageMagick applications. ImageMagick is an image
68manipulation program.
69
70If you want to create applications that will use ImageMagick code or
71APIs, you need to install ImageMagick-devel as well as ImageMagick.
72You do not need to install it if you just want to use ImageMagick,
73however.
74
cristy72c167c2013-03-20 00:42:46 +000075%package libs
76Summary: ImageMagick libraries to link with
77Group: Applications/Multimedia
78
79%description libs
80This packages contains a shared libraries to use within other applications.
81
cristy8ae77f52011-02-26 15:20:00 +000082%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
cristy4e65ec22012-04-08 01:33:27 +000092%package doc
93Summary: ImageMagick HTML documentation
94Group: Documentation
95
cristy3ed852e2009-09-05 21:47:34 +000096%description doc
97ImageMagick documentation, this package contains usage (for the
cristy32e78242012-03-06 02:42:46 +000098commandline tools) and API (for the libraries) documentation in HTML format.
cristy3ed852e2009-09-05 21:47:34 +000099Note this documentation can also be found on the ImageMagick website:
cristy32e78242012-03-06 02:42:46 +0000100http://www.imagemagick.org/.
cristy8ae77f52011-02-26 15:20:00 +0000101
cristy3ed852e2009-09-05 21:47:34 +0000102
cristyaafc1922011-03-04 16:59:40 +0000103%package perl
cristy3ed852e2009-09-05 21:47:34 +0000104Summary: ImageMagick perl bindings
105Group: System Environment/Libraries
106Requires: %{name} = %{version}-%{release}
107Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
108
cristy32e78242012-03-06 02:42:46 +0000109
cristyaafc1922011-03-04 16:59:40 +0000110%description perl
cristy3ed852e2009-09-05 21:47:34 +0000111Perl bindings to ImageMagick.
112
113Install ImageMagick-perl if you want to use any perl scripts that use
114ImageMagick.
115
cristy8ae77f52011-02-26 15:20:00 +0000116
cristy3ed852e2009-09-05 21:47:34 +0000117%package c++
118Summary: ImageMagick Magick++ library (C++ bindings)
119Group: System Environment/Libraries
120Requires: %{name} = %{version}-%{release}
121
122%description c++
123This package contains the Magick++ library, a C++ binding to the ImageMagick
124graphics manipulation library.
125
126Install ImageMagick-c++ if you want to use any applications that use Magick++.
127
128
129%package c++-devel
130Summary: C++ bindings for the ImageMagick library
131Group: Development/Libraries
132Requires: %{name}-c++ = %{version}-%{release}
133Requires: %{name}-devel = %{version}-%{release}
134
135%description c++-devel
136ImageMagick-devel contains the static libraries and header files you'll
137need to develop ImageMagick applications using the Magick++ C++ bindings.
138ImageMagick is an image manipulation program.
139
140If you want to create applications that will use Magick++ code
141or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
142ImageMagick.
cristy32e78242012-03-06 02:42:46 +0000143
cristy3ed852e2009-09-05 21:47:34 +0000144You don't need to install it if you just want to use ImageMagick, or if you
145want to develop/compile applications using the ImageMagick C interface,
146however.
147
148
149%prep
150%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
151sed -i 's/libltdl.la/libltdl.so/g' configure
cristye99fd5c2009-12-02 01:54:25 +0000152iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
cristy3ed852e2009-09-05 21:47:34 +0000153touch -r README.txt README.txt.tmp
154mv README.txt.tmp README.txt
cristy32e78242012-03-06 02:42:46 +0000155# for %%doc
cristy3ed852e2009-09-05 21:47:34 +0000156mkdir Magick++/examples
157cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
158
159%build
160%configure --enable-shared \
cristy88fa8ac2014-08-22 07:43:29 +0000161 --disable-static \
162 --with-modules \
163 --with-perl \
164 --with-x \
165 --with-threads \
166 --with-magick_plus_plus \
167 --with-gslib \
168 --with-wmf \
169 --with-lcms2 \
170 --with-webp \
171 --with-openexr \
172 --with-rsvg \
173 --with-xml \
174 --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
175 --without-dps
176
cristy3ed852e2009-09-05 21:47:34 +0000177# Disable rpath
178sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
179sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
cristy8ae77f52011-02-26 15:20:00 +0000180# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
cristy3ed852e2009-09-05 21:47:34 +0000181make
182
183
184%install
cristy72182d82012-03-19 00:37:22 +0000185rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000186
cristy88fa8ac2014-08-22 07:43:29 +0000187make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
cristy191c9a62014-08-22 12:14:30 +0000188cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
cristy72182d82012-03-19 00:37:22 +0000189rm %{buildroot}%{_libdir}/*.la
cristy3ed852e2009-09-05 21:47:34 +0000190
191# fix weird perl Magick.so permissions
cristy10067ee2013-03-20 11:59:05 +0000192chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/*/*.so
cristy3ed852e2009-09-05 21:47:34 +0000193
194# perlmagick: fix perl path of demo files
195%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
196
197# perlmagick: cleanup various perl tempfiles from the build which get installed
cristy72182d82012-03-19 00:37:22 +0000198find %{buildroot} -name "*.bs" |xargs rm -f
199find %{buildroot} -name ".packlist" |xargs rm -f
200find %{buildroot} -name "perllocal.pod" |xargs rm -f
cristy3ed852e2009-09-05 21:47:34 +0000201
202# perlmagick: build files list
203echo "%defattr(-,root,root,-)" > perl-pkg-files
cristy72182d82012-03-19 00:37:22 +0000204find %{buildroot}/%{_libdir}/perl* -type f -print \
205 | sed "s@^%{buildroot}@@g" > perl-pkg-files
206find %{buildroot}%{perl_vendorarch} -type d -print \
207 | sed "s@^%{buildroot}@%dir @g" \
cristy3ed852e2009-09-05 21:47:34 +0000208 | grep -v '^%dir %{perl_vendorarch}$' \
209 | grep -v '/auto$' >> perl-pkg-files
210if [ -z perl-pkg-files ] ; then
211 echo "ERROR: EMPTY FILE LIST"
212 exit -1
213fi
214
cristy88fa8ac2014-08-22 07:43:29 +0000215%check
216export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
217make %{?_smp_mflags} check
218
cristy3ed852e2009-09-05 21:47:34 +0000219%clean
cristy72182d82012-03-19 00:37:22 +0000220rm -rf %{buildroot}
cristy3ed852e2009-09-05 21:47:34 +0000221
cristy72c167c2013-03-20 00:42:46 +0000222%post libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000223
224%post c++ -p /sbin/ldconfig
225
cristy72c167c2013-03-20 00:42:46 +0000226%postun libs -p /sbin/ldconfig
cristy3ed852e2009-09-05 21:47:34 +0000227
228%postun c++ -p /sbin/ldconfig
229
cristy3ed852e2009-09-05 21:47:34 +0000230%files
cristy88fa8ac2014-08-22 07:43:29 +0000231%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog Platforms.txt
cristy3ed852e2009-09-05 21:47:34 +0000232%{_bindir}/[a-z]*
cristybcbacef2012-04-08 01:57:35 +0000233%{_mandir}/man[145]/[a-z]*
cristy3ed852e2009-09-05 21:47:34 +0000234%{_mandir}/man1/%{name}.*
cristy32e78242012-03-06 02:42:46 +0000235
cristy88fa8ac2014-08-22 07:43:29 +0000236%files libs
237%defattr(-,root,root,-)
238%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
cristy57bfdaf2014-08-22 12:48:02 +0000239%{_libdir}/libMagickCore-7.Q16.so.*
240%{_libdir}/libMagickWand-7.Q16.so.*
cristy88fa8ac2014-08-22 07:43:29 +0000241%{_libdir}/%{name}-%{VERSION}
242%{_datadir}/%{name}-7
243%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
244%{_sysconfdir}/%{name}-7
cristy3ed852e2009-09-05 21:47:34 +0000245
246%files devel
247%defattr(-,root,root,-)
248%{_bindir}/MagickCore-config
cristy88fa8ac2014-08-22 07:43:29 +0000249%{_bindir}/Magick-config
cristy3ed852e2009-09-05 21:47:34 +0000250%{_bindir}/MagickWand-config
cristy88fa8ac2014-08-22 07:43:29 +0000251%{_bindir}/Wand-config
252%{_libdir}/libMagickCore-7.Q16.so
253%{_libdir}/libMagickWand-7.Q16.so
254%{_libdir}/pkgconfig/MagickCore.pc
255%{_libdir}/pkgconfig/MagickCore-7.Q16.pc
256%{_libdir}/pkgconfig/ImageMagick.pc
257%{_libdir}/pkgconfig/ImageMagick-7.Q16.pc
258%{_libdir}/pkgconfig/MagickWand.pc
259%{_libdir}/pkgconfig/MagickWand-7.Q16.pc
260%dir %{_includedir}/%{name}-6
261%{_includedir}/%{name}-7/MagickCore
262%{_includedir}/%{name}-7/MagickWand
cristy3ed852e2009-09-05 21:47:34 +0000263%{_mandir}/man1/MagickCore-config.*
cristy3ed852e2009-09-05 21:47:34 +0000264%{_mandir}/man1/MagickWand-config.*
265
cristy8ae77f52011-02-26 15:20:00 +0000266%files djvu
267%defattr(-,root,root,-)
cristy88fa8ac2014-08-22 07:43:29 +0000268%{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
cristy8ae77f52011-02-26 15:20:00 +0000269
cristy3ed852e2009-09-05 21:47:34 +0000270%files doc
271%defattr(-,root,root,-)
cristy88fa8ac2014-08-22 07:43:29 +0000272%doc %{_datadir}/doc/%{name}-7
273%doc %{_datadir}/doc/%{name}-%{VERSION}
cristy8ae77f52011-02-26 15:20:00 +0000274%doc LICENSE
cristy3ed852e2009-09-05 21:47:34 +0000275
276%files c++
277%defattr(-,root,root,-)
278%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
279%doc www/Magick++/COPYING
cristy57bfdaf2014-08-22 12:48:02 +0000280%{_libdir}/libMagick++-7.Q16.so.*
cristy3ed852e2009-09-05 21:47:34 +0000281
282%files c++-devel
283%defattr(-,root,root,-)
284%doc Magick++/examples
285%{_bindir}/Magick++-config
cristy88fa8ac2014-08-22 07:43:29 +0000286%{_includedir}/%{name}-7/Magick++
287%{_includedir}/%{name}-7/Magick++.h
288%{_libdir}/libMagick++-7.Q16.so
289%{_libdir}/pkgconfig/Magick++.pc
290%{_libdir}/pkgconfig/Magick++-7.Q16.pc
291%{_libdir}/pkgconfig/ImageMagick++.pc
292%{_libdir}/pkgconfig/ImageMagick++-7.Q16.pc
cristy3ed852e2009-09-05 21:47:34 +0000293%{_mandir}/man1/Magick++-config.*
294
295%files perl -f perl-pkg-files
296%defattr(-,root,root,-)
297%{_mandir}/man3/*
298%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
299
cristy3ed852e2009-09-05 21:47:34 +0000300%changelog
301* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
cristyf8d59ee2011-02-20 18:21:31 +0000302- Port of Redhat's RPM script to support ImageMagick.