]> granicus.if.org Git - imagemagick/blob - ImageMagick.spec.in
f14b79edb0ea39cc0c7dc23cf90f7728d0d273d8
[imagemagick] / ImageMagick.spec.in
1 %global VERSION  @PACKAGE_VERSION@
2 %global Patchlevel  @PACKAGE_RELEASE@
3
4 Name:           @PACKAGE_NAME@
5 Version:                %{VERSION}.%{Patchlevel}
6 Release:                3%{?dist}
7 Summary:                Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition resize, rotate, shear, distort and transform images.
8 Group:          Applications/Multimedia
9 License:                http://www.imagemagick.org/script/license.php
10 Url:                    http://www.imagemagick.org/
11 Source0:                ftp://ftp.ImageMagick.org/pub/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.xz
12
13 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
14 BuildRequires:  bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
15 BuildRequires:  libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
16 BuildRequires:  ghostscript-devel, djvulibre-devel
17 BuildRequires:  libwmf-devel, jasper-devel, libtool-ltdl-devel
18 BuildRequires:  libX11-devel, libXext-devel, libXt-devel
19 BuildRequires:  lcms-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
20
21 %description
22 ImageMagick is an image display and manipulation tool for the X
23 Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF,
24 and Photo CD image formats. It can resize, rotate, sharpen, color
25 reduce, or add special effects to an image, and when finished you can
26 either save the completed work in the original format or a different
27 one. ImageMagick also includes command line programs for creating
28 animated or transparent .gifs, creating composite images, creating
29 thumbnail images, and more.
30
31 ImageMagick is one of your choices if you need a program to manipulate
32 and display images. If you want to develop your own applications
33 which use ImageMagick code or APIs, you need to install
34 ImageMagick-devel as well.
35
36
37 %package devel
38 Summary: Library links and header files for ImageMagick app development
39 Group: Development/Libraries
40 Requires: %{name} = %{version}-%{release}
41 Requires: libX11-devel, libXext-devel, libXt-devel
42 Requires: ghostscript-devel
43 Requires: bzip2-devel
44 Requires: freetype-devel
45 Requires: libtiff-devel
46 Requires: libjpeg-devel
47 Requires: lcms-devel
48 Requires: jasper-devel
49 Requires: pkgconfig
50
51 %description devel
52 ImageMagick-devel contains the library links and header files you'll
53 need to develop ImageMagick applications. ImageMagick is an image
54 manipulation program.
55
56 If you want to create applications that will use ImageMagick code or
57 APIs, you need to install ImageMagick-devel as well as ImageMagick.
58 You do not need to install it if you just want to use ImageMagick,
59 however.
60
61
62 %package djvu
63 Summary: DjVu plugin for ImageMagick
64 Group: Applications/Multimedia
65 Requires: %{name} = %{version}-%{release}
66
67 %description djvu
68 This packages contains a plugin for ImageMagick which makes it possible to
69 save and load DjvU files from ImageMagick and libMagickCore using applications.
70
71
72 %package doc
73 Summary: ImageMagick html documentation
74 Group: Documentation
75
76 %description doc
77 ImageMagick documentation, this package contains usage (for the
78 commandline tools) and API (for the libraries) documentation in html format.
79 Note this documentation can also be found on the ImageMagick website:
80 http://www.imagemagick.org/
81
82
83 %package perl
84 Summary: ImageMagick perl bindings
85 Group: System Environment/Libraries
86 Requires: %{name} = %{version}-%{release}
87 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
88
89 %description perl
90 Perl bindings to ImageMagick.
91
92 Install ImageMagick-perl if you want to use any perl scripts that use
93 ImageMagick.
94
95
96 %package c++
97 Summary: ImageMagick Magick++ library (C++ bindings)
98 Group: System Environment/Libraries
99 Requires: %{name} = %{version}-%{release}
100
101 %description c++
102 This package contains the Magick++ library, a C++ binding to the ImageMagick
103 graphics manipulation library.
104
105 Install ImageMagick-c++ if you want to use any applications that use Magick++.
106
107
108 %package c++-devel
109 Summary: C++ bindings for the ImageMagick library
110 Group: Development/Libraries
111 Requires: %{name}-c++ = %{version}-%{release}
112 Requires: %{name}-devel = %{version}-%{release}
113
114 %description c++-devel
115 ImageMagick-devel contains the static libraries and header files you'll
116 need to develop ImageMagick applications using the Magick++ C++ bindings.
117 ImageMagick is an image manipulation program.
118
119 If you want to create applications that will use Magick++ code
120 or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
121 ImageMagick.
122 You don't need to install it if you just want to use ImageMagick, or if you
123 want to develop/compile applications using the ImageMagick C interface,
124 however.
125
126
127 %prep
128 %setup -q -n %{name}-%{VERSION}-%{Patchlevel}
129 sed -i 's/libltdl.la/libltdl.so/g' configure
130 iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
131 touch -r README.txt README.txt.tmp
132 mv README.txt.tmp README.txt
133 # for %doc
134 mkdir Magick++/examples
135 cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
136
137
138 %build
139 %configure --enable-shared \
140            --disable-static \
141            --with-modules \
142            --with-perl \
143            --with-x \
144            --with-threads \
145            --with-magick_plus_plus \
146            --with-gslib \
147            --with-wmf \
148            --with-lcms \
149            --with-rsvg \
150            --with-xml \
151            --with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/MagickCore/.libs' LDDLFLAGS='-shared -L$PWD/MagickCore/.libs'" \
152            --without-dps \
153            --without-included-ltdl --with-ltdl-include=%{_includedir} \
154            --with-ltdl-lib=%{_libdir}
155 # Disable rpath
156 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
157 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
158 # Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
159 make
160
161
162 %install
163 rm -rf %{buildroot}
164
165 make install DESTDIR=%{buildroot} INSTALL="install -p"
166 cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
167 # Delete *ONLY* _libdir/*.la files! .la files used internally to handle plugins - BUG#185237!!!
168 rm %{buildroot}%{_libdir}/*.la
169
170 # fix weird perl Magick.so permissions
171 chmod 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/Magick.so
172
173 # perlmagick: fix perl path of demo files
174 %{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
175
176 # perlmagick: cleanup various perl tempfiles from the build which get installed
177 find %{buildroot} -name "*.bs" |xargs rm -f
178 find %{buildroot} -name ".packlist" |xargs rm -f
179 find %{buildroot} -name "perllocal.pod" |xargs rm -f
180
181 # perlmagick: build files list
182 echo "%defattr(-,root,root,-)" > perl-pkg-files
183 find %{buildroot}/%{_libdir}/perl* -type f -print \
184         | sed "s@^%{buildroot}@@g" > perl-pkg-files 
185 find %{buildroot}%{perl_vendorarch} -type d -print \
186         | sed "s@^%{buildroot}@%dir @g" \
187         | grep -v '^%dir %{perl_vendorarch}$' \
188         | grep -v '/auto$' >> perl-pkg-files 
189 if [ -z perl-pkg-files ] ; then
190     echo "ERROR: EMPTY FILE LIST"
191     exit -1
192 fi
193
194 # fix multilib issues
195 %ifarch x86_64 s390x ia64 ppc64 alpha sparc64
196 %define wordsize 64
197 %else
198 %define wordsize 32
199 %endif
200
201 mv %{buildroot}%{_includedir}/%{name}/MagickCore/magick-config.h \
202    %{buildroot}%{_includedir}/%{name}/MagickCore/magick-config-%{wordsize}.h
203
204 cat >%{buildroot}%{_includedir}/%{name}/MagickCore/magick-config.h <<EOF
205 #ifndef IMAGEMAGICK_MULTILIB
206 #define IMAGEMAGICK_MULTILIB
207
208 #include <bits/wordsize.h>
209
210 #if __WORDSIZE == 32
211 # include "magick-config-32.h"
212 #elif __WORDSIZE == 64
213 # include "magick-config-64.h"
214 #else
215 # error "unexpected value for __WORDSIZE macro"
216 #endif
217
218 #endif
219 EOF
220
221 # Fonts must be packaged separately. It does nothave matter and demos work without it.
222 rm PerlMagick/demo/Generic.ttf
223
224 # From version around 6.7.5-6 docs go to unversioned dir. Fixing
225 mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}/%{_datadir}/doc/%{name}-%{VERSION}
226
227 %clean
228 rm -rf %{buildroot}
229
230
231 %post -p /sbin/ldconfig
232
233 %post c++ -p /sbin/ldconfig
234
235 %postun -p /sbin/ldconfig
236
237 %postun c++ -p /sbin/ldconfig
238
239
240 %files
241 %defattr(-,root,root,-)
242 %doc QuickStart.txt ChangeLog Platforms.txt
243 %doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
244 %{_libdir}/libMagickCore.so.5*
245 %{_libdir}/libMagickWand.so.5*
246 %{_bindir}/[a-z]*
247 %{_libdir}/%{name}-%{VERSION}
248 %{_datadir}/%{name}-%{VERSION}
249 %{_mandir}/man[145]/[a-z]*
250 %{_mandir}/man1/%{name}.*
251 %exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
252 %{_sysconfdir}/%{name}
253
254 %files devel
255 %defattr(-,root,root,-)
256 %{_bindir}/MagickCore-config
257 %{_bindir}/MagickWand-config
258 %{_libdir}/libMagickCore.so
259 %{_libdir}/libMagickWand.so
260 %{_libdir}/pkgconfig/MagickCore.pc
261 %{_libdir}/pkgconfig/ImageMagick.pc
262 %{_libdir}/pkgconfig/MagickWand.pc
263 %{_libdir}/pkgconfig/Wand.pc
264 %dir %{_includedir}/%{name}
265 %{_includedir}/%{name}/MagickCore
266 %{_includedir}/%{name}/MagickWand
267 %{_mandir}/man1/MagickCore-config.*
268 %{_mandir}/man1/MagickWand-config.*
269
270 %files djvu
271 %defattr(-,root,root,-)
272 %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
273
274 %files doc
275 %defattr(-,root,root,-)
276 %doc %{_datadir}/doc/%{name}-%{VERSION}
277 %doc LICENSE
278
279 %files c++
280 %defattr(-,root,root,-)
281 %doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
282 %doc www/Magick++/COPYING
283 %{_libdir}/libMagick++.so.5*
284
285 %files c++-devel
286 %defattr(-,root,root,-)
287 %doc Magick++/examples
288 %{_bindir}/Magick++-config
289 %{_includedir}/%{name}/Magick++
290 %{_includedir}/%{name}/Magick++.h
291 %{_libdir}/libMagick++.so
292 %{_libdir}/pkgconfig/Magick++.pc
293 %{_libdir}/pkgconfig/ImageMagick++.pc
294 %{_mandir}/man1/Magick++-config.*
295
296 %files perl -f perl-pkg-files
297 %defattr(-,root,root,-)
298 %{_mandir}/man3/*
299 %doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
300
301 %changelog
302 * Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
303 -  Port of Redhat's RPM script to support ImageMagick.