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