]> granicus.if.org Git - imagemagick/blob - ImageMagick.spec.in
...
[imagemagick] / ImageMagick.spec.in
1 %global VERSION  @PACKAGE_VERSION@
2 %global Patchlevel  @PACKAGE_RELEASE@
3
4
5 Name:           @PACKAGE_NAME@
6 Version:        %{VERSION}
7 Release:        %{Patchlevel}
8 Summary:        Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition resize, rotate, shear, distort and transform images.
9 Group:          Applications/Multimedia
10 License:        https://www.imagemagick.org/script/license.php
11 Url:            https://www.imagemagick.org/
12 Source0:        https://www.imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
13
14 Requires:       %{name}-libs = %{version}-%{release}
15
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17 BuildRequires:  bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
18 BuildRequires:  libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
19 BuildRequires:  ghostscript-devel, djvulibre-devel
20 BuildRequires:  libwmf-devel, jasper-devel, libtool-ltdl-devel
21 BuildRequires:  libX11-devel, libXext-devel, libXt-devel
22 BuildRequires:  lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
23 BuildRequires:  fftw-devel, OpenEXR-devel, libwebp-devel
24 BuildRequires:  jbigkit-devel
25 BuildRequires:  openjpeg2-devel >= 2.1.0
26
27 %description
28 ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
29
30 The functionality of ImageMagick is typically utilized from the command-line or you can use the features from programs written in your favorite language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick (Java), L-Magick (Lisp), Lua (LuaJIT), NMagick (Neko/haXe), Magick.NET (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images dynamically and automagically.
31
32 ImageMagick utilizes multiple computational threads to increase performance and can read, process, or write mega-, giga-, or tera-pixel image sizes.
33
34 ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. It is distributed under the Apache 2.0 license.
35
36 The ImageMagick development process ensures a stable API and ABI. Before each ImageMagick release, we perform a comprehensive security assessment that includes memory error and thread data race detection to prevent security vulnerabilities.
37
38 The authoritative ImageMagick web site is https://www.imagemagick.org. The authoritative source code repository is http://git.imagemagick.org/repos/ImageMagick. We maintain a source code mirror at GitHub.
39
40 %package devel
41 Summary: Library links and header files for ImageMagick application development
42 Group: Development/Libraries
43 Requires: %{name} = %{version}-%{release}
44 Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
45 Requires: bzip2-devel, freetype-devel, libtiff-devel, libjpeg-devel, lcms2-devel
46 Requires: libwebp-devel, OpenEXR-devel, jasper-devel, pkgconfig
47 Requires: %{name}-libs = %{version}-%{release}
48
49 %description devel
50 ImageMagick-devel contains the library links and header files you'll
51 need to develop ImageMagick applications. ImageMagick is an image
52 manipulation program.
53
54 If you want to create applications that will use ImageMagick code or
55 APIs, you need to install ImageMagick-devel as well as ImageMagick.
56 You do not need to install it if you just want to use ImageMagick,
57 however.
58
59 %package libs
60 Summary: ImageMagick libraries to link with
61 Group: Applications/Multimedia
62
63 %description libs
64 This packages contains a shared libraries to use within other applications.
65
66 %package djvu
67 Summary: DjVu plugin for ImageMagick
68 Group: Applications/Multimedia
69 Requires: %{name} = %{version}-%{release}
70
71 %description djvu
72 This packages contains a plugin for ImageMagick which makes it possible to
73 save and load DjvU files from ImageMagick and libMagickCore using applications.
74
75
76 %package doc
77 Summary: ImageMagick HTML documentation
78 Group: Documentation
79
80 %description doc
81 ImageMagick documentation, this package contains usage (for the
82 commandline tools) and API (for the libraries) documentation in HTML format.
83 Note this documentation can also be found on the ImageMagick website:
84 https://www.imagemagick.org/.
85
86
87 %package perl
88 Summary: ImageMagick perl bindings
89 Group: System Environment/Libraries
90 Requires: %{name} = %{version}-%{release}
91 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
92
93
94 %description perl
95 Perl bindings to ImageMagick.
96
97 Install ImageMagick-perl if you want to use any perl scripts that use
98 ImageMagick.
99
100
101 %package c++
102 Summary: ImageMagick Magick++ library (C++ bindings)
103 Group: System Environment/Libraries
104 Requires: %{name} = %{version}-%{release}
105
106 %description c++
107 This package contains the Magick++ library, a C++ binding to the ImageMagick
108 graphics manipulation library.
109
110 Install ImageMagick-c++ if you want to use any applications that use Magick++.
111
112
113 %package c++-devel
114 Summary: C++ bindings for the ImageMagick library
115 Group: Development/Libraries
116 Requires: %{name}-c++ = %{version}-%{release}
117 Requires: %{name}-devel = %{version}-%{release}
118
119 %description c++-devel
120 ImageMagick-devel contains the static libraries and header files you'll
121 need to develop ImageMagick applications using the Magick++ C++ bindings.
122 ImageMagick is an image manipulation program.
123
124 If you want to create applications that will use Magick++ code
125 or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
126 ImageMagick.
127
128 You don't need to install it if you just want to use ImageMagick, or if you
129 want to develop/compile applications using the ImageMagick C interface,
130 however.
131
132
133 %prep
134 %setup -q -n %{name}-%{VERSION}-%{Patchlevel}
135
136 # for %%doc
137 mkdir Magick++/examples
138 cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
139
140 %build
141 %configure --enable-shared \
142         --disable-static \
143         --with-modules \
144         --with-perl \
145         --with-x \
146         --with-threads \
147         --with-magick_plus_plus \
148         --with-gslib \
149         --with-wmf \
150         --with-webp \
151         --with-openexr \
152         --with-rsvg \
153         --with-xml \
154         --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/MagickCore/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
155         --without-dps  \
156         --without-gcc-arch \
157         --with-jbig \
158         --with-openjp2
159
160 # Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
161 make
162
163
164 %install
165 make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
166 cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
167 rm %{buildroot}%{_libdir}/*.la
168
169 # fix weird perl Magick.so permissions
170 chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/*/*.so
171
172 # perlmagick: fix perl path of demo files
173 %{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
174
175 # perlmagick: cleanup various perl tempfiles from the build which get installed
176 find %{buildroot} -name "*.bs" |xargs rm -f
177 find %{buildroot} -name ".packlist" |xargs rm -f
178 find %{buildroot} -name "perllocal.pod" |xargs rm -f
179
180 # perlmagick: build files list
181 echo "%defattr(-,root,root,-)" > perl-pkg-files
182 find %{buildroot}/%{_libdir}/perl* -type f -print \
183         | sed "s@^%{buildroot}@@g" > perl-pkg-files 
184 find %{buildroot}%{perl_vendorarch} -type d -print \
185         | sed "s@^%{buildroot}@%dir @g" \
186         | grep -v '^%dir %{perl_vendorarch}$' \
187         | grep -v '/auto$' >> perl-pkg-files 
188 if [ -z perl-pkg-files ] ; then
189     echo "ERROR: EMPTY FILE LIST"
190     exit -1
191 fi
192
193 # fix multilib issues: Rename provided file with platform-bits in name.
194 # Create platform independant file inplace of provided and conditionally include required.
195 # $1 - filename.h to process.
196 function multilibFileVersions(){
197 mv $1 ${1%%.h}-%{__isa_bits}.h
198
199 local basename=$(basename $1)
200
201 cat >$1 <<EOF
202 #include <bits/wordsize.h>
203
204 #if __WORDSIZE == 32
205 # include "${basename%%.h}-32.h"
206 #elif __WORDSIZE == 64
207 # include "${basename%%.h}-64.h"
208 #else
209 # error "unexpected value for __WORDSIZE macro"
210 #endif
211 EOF
212 }
213
214 multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-config.h
215 multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/magick-baseconfig.h
216 multilibFileVersions %{buildroot}%{_includedir}/%{name}-7/MagickCore/version.h
217
218
219 %check
220 export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
221 make %{?_smp_mflags} check
222
223 %post libs -p /sbin/ldconfig
224
225 %post c++ -p /sbin/ldconfig
226
227 %postun libs -p /sbin/ldconfig
228
229 %postun c++ -p /sbin/ldconfig
230
231 %files
232 %doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog Platforms.txt
233 %{_bindir}/[a-z]*
234 %{_mandir}/man[145]/[a-z]*
235 %{_mandir}/man1/%{name}.*
236
237 %files libs
238 %doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
239 %{_libdir}/libMagickCore-7.Q16HDRI.so.*
240 %{_libdir}/libMagickWand-7.Q16HDRI.so.*
241 %{_libdir}/%{name}-%{VERSION}
242 %{_datadir}/%{name}-7
243 %exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
244 %{_sysconfdir}/%{name}-7
245
246 %files devel
247 %{_bindir}/MagickCore-config
248 %{_bindir}/MagickWand-config
249 %{_libdir}/libMagickCore-7.Q16HDRI.so
250 %{_libdir}/libMagickWand-7.Q16HDRI.so
251 %{_libdir}/pkgconfig/MagickCore.pc
252 %{_libdir}/pkgconfig/MagickCore-7.Q16HDRI.pc
253 %{_libdir}/pkgconfig/ImageMagick.pc
254 %{_libdir}/pkgconfig/ImageMagick-7.Q16HDRI.pc
255 %{_libdir}/pkgconfig/MagickWand.pc
256 %{_libdir}/pkgconfig/MagickWand-7.Q16HDRI.pc
257 %dir %{_includedir}/%{name}-7
258 %{_includedir}/%{name}-7/MagickCore
259 %{_includedir}/%{name}-7/MagickWand
260 %{_mandir}/man1/MagickCore-config.*
261 %{_mandir}/man1/MagickWand-config.*
262
263 %files djvu
264 %{_libdir}/%{name}-%{VERSION}/modules-Q16HDRI/coders/djvu.*
265
266 %files doc
267 %doc %{_datadir}/doc/%{name}-7
268 %doc %{_datadir}/doc/%{name}-%{VERSION}
269 %doc LICENSE
270
271 %files c++
272 %doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
273 %doc www/Magick++/COPYING
274 %{_libdir}/libMagick++-7.Q16HDRI.so.*
275
276 %files c++-devel
277 %doc Magick++/examples
278 %{_bindir}/Magick++-config
279 %{_includedir}/%{name}-7/Magick++
280 %{_includedir}/%{name}-7/Magick++.h
281 %{_libdir}/libMagick++-7.Q16HDRI.so
282 %{_libdir}/pkgconfig/Magick++.pc
283 %{_libdir}/pkgconfig/Magick++-7.Q16HDRI.pc
284 %{_mandir}/man1/Magick++-config.*
285
286 %files perl -f perl-pkg-files
287 %{_mandir}/man3/*
288 %doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
289
290 %changelog
291 * Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
292 -  Port of Redhat's RPM script to support ImageMagick.