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