1 |
%define build_test 0 |
2 |
%{?_with_test: %{expand: %%global build_test 1}} |
3 |
%{?_without_test: %{expand: %%global build_test 0}} |
4 |
|
5 |
%define bootstrap 1 |
6 |
%{?_without_bootstrap: %global bootstrap 0} |
7 |
%{?_with_bootstrap: %global bootstrap 1} |
8 |
|
9 |
# V E R S I O N P A R T S |
10 |
|
11 |
# their "official" version |
12 |
%define rversion 6.7.2 |
13 |
|
14 |
# their "minor" version |
15 |
%define minor_rev 7 |
16 |
|
17 |
# some other funny version |
18 |
# (aw) from the docs: Versions with Q8 in the name are 8 bits-per-pixel |
19 |
# component (e.g. 8-bit red, 8-bit green, etc.), whereas, Q16 in the |
20 |
# filename are 16 bits-per-pixel component. A Q16 version permits you |
21 |
# to read or write 16-bit images without losing precision but requires |
22 |
# twice as much resources as the Q8 version. |
23 |
%define qlev Q16 |
24 |
|
25 |
# the full file version |
26 |
%define dversion %{rversion}-%{minor_rev} |
27 |
|
28 |
%define major 5 |
29 |
|
30 |
%define libname %mklibname magick %{major} |
31 |
%define develname %mklibname magick -d |
32 |
|
33 |
Summary: An X application for displaying and manipulating images |
34 |
Name: imagemagick |
35 |
Version: %{rversion}.%{minor_rev} |
36 |
Release: %mkrel 1 |
37 |
License: BSD-like |
38 |
Group: Graphics |
39 |
URL: http://www.imagemagick.org/ |
40 |
Source0: ftp://gd.tuwien.ac.at/pub/graphics/ImageMagick/ImageMagick-%{dversion}.tar.xz |
41 |
Source1: ImageMagick.pdf.bz2 |
42 |
# re-scaled from ftp://ftp.imagemagick.org/pub/ImageMagick/images/magick-icon.png |
43 |
Source10: magick-icon_16x16.png |
44 |
Source11: magick-icon_32x32.png |
45 |
Source12: magick-icon_48x48.png |
46 |
Source13: magick-icon_64x64.png |
47 |
Patch0: imagemagick-docdir.diff |
48 |
#gw fix format strings, but it doesn't work for the perl-Magick |
49 |
Patch1: ImageMagick-6.4.8-9-format-strings.patch |
50 |
Patch4: ImageMagick-6.4.8-9-includedir.patch |
51 |
Patch7: imagemagick-urw.diff |
52 |
Patch17: imagemagick-fpx.diff |
53 |
Patch19: ImageMagick-libpath.diff |
54 |
Patch20: ImageMagick-6.4.8-9-fix-montageimages-test.patch |
55 |
|
56 |
Requires: %{libname} = %{version} |
57 |
Obsoletes: ImageMagick < 6.3.2.9-6 |
58 |
Provides: ImageMagick = %{version}-%{release} |
59 |
|
60 |
BuildRequires: libx11-devel |
61 |
BuildRequires: libxext-devel |
62 |
BuildRequires: bzip2-devel |
63 |
BuildRequires: cairo-devel |
64 |
BuildRequires: fontconfig-devel |
65 |
BuildRequires: freetype2-devel >= 2.1.7 |
66 |
BuildRequires: chrpath |
67 |
BuildRequires: graphviz-devel >= 2.9.0 |
68 |
BuildRequires: libjasper-devel |
69 |
BuildRequires: libjbig-devel |
70 |
BuildRequires: libjpeg-devel |
71 |
BuildRequires: libpng-devel |
72 |
BuildRequires: zlib-devel |
73 |
BuildRequires: lcms-devel |
74 |
BuildRequires: lqr-devel |
75 |
BuildRequires: libltdl-devel |
76 |
BuildRequires: perl-devel |
77 |
BuildRequires: librsvg-devel |
78 |
BuildRequires: tiff-devel |
79 |
BuildRequires: libwmf-devel |
80 |
BuildRequires: libxml2-devel |
81 |
BuildRequires: lzma-devel |
82 |
%if !%bootstrap |
83 |
BuildRequires: djvulibre-devel |
84 |
%endif |
85 |
BuildRequires: ghostscript |
86 |
BuildConflicts: %{develname} |
87 |
|
88 |
%description |
89 |
ImageMagick is a powerful image display, conversion and manipulation tool. It |
90 |
runs in an X session. With this tool, you can view, edit and display a variety |
91 |
of image formats. |
92 |
|
93 |
ImageMagick can make use of the following delegate programs, available as |
94 |
packages in %{_vendor}: curl enscript ffmpeg ghostscript ghostscript-X gimp |
95 |
gnuplot graphviz html2ps mplayer ncompress netpbm sane-backends tetex-dvips |
96 |
transfig ufraw xdg-utils zip autotrace povray |
97 |
|
98 |
%package desktop |
99 |
Summary: ImageMagick menus |
100 |
Group: Graphics |
101 |
Requires: xterm |
102 |
Obsoletes: ImageMagick-desktop < 6.3.2.9-6 |
103 |
|
104 |
%description desktop |
105 |
This package contains the menu and .desktop entries to run the "display" |
106 |
command from the menu. |
107 |
|
108 |
%package -n %{libname} |
109 |
Summary: ImageMagick libraries |
110 |
Group: System/Libraries |
111 |
# (Anssi 02/2008): Wrongly named at first, can be removed when major changes again: |
112 |
Obsoletes: %{_lib}magick%{major}.0.0 < %{version}-%{release} |
113 |
|
114 |
%description -n %{libname} |
115 |
This package contains the libraries needed to run programs dynamically linked |
116 |
with ImageMagick libraries. |
117 |
|
118 |
%package -n %{develname} |
119 |
Summary: Static libraries and header files for ImageMagick app development |
120 |
Group: Development/C |
121 |
Requires: %{libname} = %{version} |
122 |
Provides: %{name}-devel = %{version}-%{release} |
123 |
Provides: ImageMagick-devel = %{version}-%{release} |
124 |
Provides: libmagick-devel = %{version}-%{release} |
125 |
Provides: libMagick-devel = %{version}-%{release} |
126 |
Obsoletes: ImageMagick-devel |
127 |
Provides: libMagick5-devel = %{version}-%{release} |
128 |
Obsoletes: libMagick5-devel |
129 |
# 2006 |
130 |
Obsoletes: %{mklibname Magick 8.3.2 -d} |
131 |
# 2007.0 |
132 |
Obsoletes: %{mklibname magick 10.4.0 -d} %{mklibname Magick 10.4.0 -d} |
133 |
# 2007.1/2008.0 |
134 |
Obsoletes: %{mklibname magick 10.7.0 -d} %{mklibname Magick 10.7.0 -d} |
135 |
# pre 2008.1 |
136 |
Obsoletes: %{mklibname magick 10.9.0 -d} %{mklibname Magick 10.9.0 -d} |
137 |
|
138 |
%description -n %{develname} |
139 |
If you want to create applications that will use ImageMagick code or APIs, |
140 |
you'll need to install these packages as well as ImageMagick. These additional |
141 |
packages aren't necessary if you simply want to use ImageMagick, however. |
142 |
|
143 |
ImageMagick-devel is an addition to ImageMagick which includes static libraries |
144 |
and header files necessary to develop applications. |
145 |
|
146 |
%package -n perl-Image-Magick |
147 |
Summary: Libraries and modules for access to ImageMagick from perl |
148 |
Group: Development/Perl |
149 |
Requires: %{name} = %{version} |
150 |
Provides: perl-Magick = %{version}-%{release} |
151 |
Obsoletes: perl-Magick |
152 |
Requires: graphviz |
153 |
Requires: libwmf |
154 |
|
155 |
%description -n perl-Image-Magick |
156 |
This is the ImageMagick perl support package. It includes perl modules and |
157 |
support files for access to ImageMagick library from perl. |
158 |
|
159 |
%package doc |
160 |
Summary: %{name} Documentation |
161 |
Group: Books/Other |
162 |
Obsoletes: ImageMagick-doc < 6.3.2.9-6 |
163 |
BuildArch: noarch |
164 |
|
165 |
%description doc |
166 |
This package contains HTML/PDF documentation of %{name}. |
167 |
|
168 |
%prep |
169 |
|
170 |
%setup -q -n ImageMagick-%{rversion}-%minor_rev |
171 |
|
172 |
%patch0 -p1 -b .docdir |
173 |
#patch1 -p1 |
174 |
%patch4 -p1 -b .include |
175 |
%patch7 -p0 -b .urw |
176 |
%patch17 -p0 -b .fpx |
177 |
%patch19 -p1 -b .libpath |
178 |
%patch20 -p1 -b .ppc |
179 |
|
180 |
bzcat %{SOURCE1} > ImageMagick.pdf |
181 |
install -m 644 %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} . |
182 |
libtoolize --copy --force; aclocal -I m4; autoconf; automake |
183 |
|
184 |
%build |
185 |
#gw the format-string patch is incomplete: |
186 |
%define Werror_cflags %nil |
187 |
export CFLAGS="%{optflags} -fno-strict-aliasing -fPIC" |
188 |
export CXXFLAGS="%{optflags} -fno-strict-aliasing -fPIC" |
189 |
|
190 |
# don't use icecream |
191 |
export PATH=/bin:/usr/bin |
192 |
|
193 |
%configure2_5x \ |
194 |
--docdir=%{_defaultdocdir}/imagemagick \ |
195 |
--with-pic \ |
196 |
--enable-shared \ |
197 |
--enable-fast-install \ |
198 |
--disable-ltdl-install \ |
199 |
--with-threads \ |
200 |
--with-magick_plus_plus \ |
201 |
--with-gslib \ |
202 |
--with-wmf \ |
203 |
--with-lcms \ |
204 |
--with-rsvg \ |
205 |
--with-xml \ |
206 |
--without-dps \ |
207 |
--without-windows-font-dir \ |
208 |
--without-modules \ |
209 |
--with-perl \ |
210 |
--with-perl-options="INSTALLDIRS=vendor CC='%{__cc} -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \ |
211 |
--with-jp2 \ |
212 |
--with-gvc \ |
213 |
--with-lqr |
214 |
|
215 |
# without the following, it doesn't build correctly with "make -j 4" |
216 |
perl -lpi -e '$_ .= " magick/libMagickCore.la" if index($_, q($(PERLMAKEFILE))) == 0' Makefile |
217 |
|
218 |
# Disable rpath |
219 |
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool |
220 |
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool |
221 |
|
222 |
%make |
223 |
|
224 |
%if %{build_test} |
225 |
%check |
226 |
# these tests require X |
227 |
if [ -f PerlMagick/t/x11/read.t ]; then |
228 |
mv PerlMagick/t/x11/read.t PerlMagick/t/x11/read.t.disabled |
229 |
fi |
230 |
if [ -f PerlMagick/t/x11/write.t ]; then |
231 |
mv PerlMagick/t/x11/write.t PerlMagick/t/x11/write.t.disabled |
232 |
fi |
233 |
#dlname=`grep "^dlname" Magick++/lib/.libs/libMagick++.la | cut -d\' -f2` |
234 |
#LD_PRELOAD="$PWD/Magick++/lib/.libs/$dlname" VERBOSE="1" make check |
235 |
make check |
236 |
%endif |
237 |
|
238 |
%install |
239 |
rm -rf %{buildroot} |
240 |
|
241 |
# (Abel) set LD_RUN_PATH to null, to avoid adding rpath to perlmagick module |
242 |
%makeinstall_std LD_RUN_PATH="" pkgdocdir=/installed_docs |
243 |
|
244 |
# fix docs inclusion (fix an unknown new rpm bug) |
245 |
rm -rf installed_docs; mv %{buildroot}/installed_docs . |
246 |
|
247 |
# Remove unpackaged files |
248 |
rm -f %{buildroot}%{_libdir}/ImageMagick-%{rversion}/modules-%{qlev}/coders/*.a \ |
249 |
%{buildroot}%{_libdir}/ImageMagick-%{rversion}/modules-%{qlev}/filters/*.a \ |
250 |
%{buildroot}%{_libdir}/libltdl* |
251 |
|
252 |
%multiarch_binaries %{buildroot}%{_bindir}/Magick-config |
253 |
%multiarch_binaries %{buildroot}%{_bindir}/Magick++-config |
254 |
%multiarch_binaries %{buildroot}%{_bindir}/MagickCore-config |
255 |
%multiarch_binaries %{buildroot}%{_bindir}/MagickWand-config |
256 |
%multiarch_binaries %{buildroot}%{_bindir}/Wand-config |
257 |
%multiarch_includes %{buildroot}%{_includedir}/ImageMagick/magick/magick-config.h |
258 |
|
259 |
# nuke rpath |
260 |
chrpath -d %{buildroot}%{perl_vendorarch}/auto/Image/Magick/Magick.so |
261 |
|
262 |
# icons |
263 |
install -m 755 -d %{buildroot}%{_liconsdir} \ |
264 |
%{buildroot}%{_iconsdir} \ |
265 |
%{buildroot}%{_iconsdir}/hicolor/64x64/apps \ |
266 |
%{buildroot}%{_miconsdir} |
267 |
install -m 644 magick-icon_16x16.png %{buildroot}%{_miconsdir}/%{name}.png |
268 |
install -m 644 magick-icon_32x32.png %{buildroot}%{_iconsdir}/%{name}.png |
269 |
install -m 644 magick-icon_48x48.png %{buildroot}%{_liconsdir}/%{name}.png |
270 |
install -m 644 magick-icon_64x64.png %{buildroot}%{_iconsdir}/hicolor/64x64/apps/%{name}.png |
271 |
|
272 |
|
273 |
install -m 755 -d %{buildroot}%{_datadir}/applications/ |
274 |
cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}.desktop << EOF |
275 |
[Desktop Entry] |
276 |
Name=ImageMagick |
277 |
Comment=Views Graphics files |
278 |
Exec=%{_bindir}/xterm -geometry 40x15 -title ImageMagick +sb -iconic -e %{_bindir}/display |
279 |
Icon=%{name} |
280 |
Terminal=false |
281 |
Type=Application |
282 |
Categories=Graphics;Viewer; |
283 |
EOF |
284 |
|
285 |
%clean |
286 |
rm -rf %{buildroot} |
287 |
|
288 |
%files |
289 |
%defattr(-,root,root) |
290 |
%doc README.txt |
291 |
%{_sysconfdir}/ImageMagick |
292 |
%{_bindir}/animate |
293 |
%{_bindir}/compare |
294 |
%{_bindir}/composite |
295 |
%{_bindir}/convert |
296 |
%{_bindir}/conjure |
297 |
%{_bindir}/display |
298 |
%{_bindir}/identify |
299 |
%{_bindir}/import |
300 |
%{_bindir}/mogrify |
301 |
%{_bindir}/montage |
302 |
%{_bindir}/stream |
303 |
%dir %{_libdir}/ImageMagick-%{rversion} |
304 |
%dir %{_libdir}/ImageMagick-%{rversion}/modules-%{qlev} |
305 |
%dir %{_libdir}/ImageMagick-%{rversion}/modules-%{qlev}/coders |
306 |
%{_datadir}/ImageMagick-%{rversion} |
307 |
%{_mandir}/man1/* |
308 |
%{_mandir}/man3/* |
309 |
%exclude %{_mandir}/man3/*::*.3pm* |
310 |
|
311 |
%files desktop |
312 |
%defattr(-,root,root) |
313 |
%{_datadir}/applications/* |
314 |
%{_iconsdir}/%{name}.png |
315 |
%{_liconsdir}/%{name}.png |
316 |
%{_miconsdir}/%{name}.png |
317 |
%{_iconsdir}/hicolor/64x64/apps/%{name}.png |
318 |
|
319 |
%files -n %{libname} |
320 |
%defattr(-,root,root,0755) |
321 |
%{_libdir}/libMagick++.so.%{major}* |
322 |
%{_libdir}/libMagickCore.so.%{major}* |
323 |
%{_libdir}/libMagickWand.so.%{major}* |
324 |
|
325 |
%files -n %{develname} |
326 |
%defattr(-,root,root) |
327 |
%{_includedir}/ImageMagick |
328 |
%multiarch %{multiarch_bindir}/Magick-config |
329 |
%multiarch %{multiarch_bindir}/Magick++-config |
330 |
%multiarch %{multiarch_bindir}/MagickCore-config |
331 |
%multiarch %{multiarch_bindir}/MagickWand-config |
332 |
%multiarch %{multiarch_bindir}/Wand-config |
333 |
%multiarch %dir %{multiarch_includedir}/ImageMagick |
334 |
%multiarch %dir %{multiarch_includedir}/ImageMagick/magick |
335 |
%multiarch %{multiarch_includedir}/ImageMagick/magick/magick-config.h |
336 |
%{_bindir}/Magick-config |
337 |
%{_bindir}/Magick++-config |
338 |
%{_bindir}/MagickCore-config |
339 |
%{_bindir}/MagickWand-config |
340 |
%{_bindir}/Wand-config |
341 |
%attr(0644,root,root) %{_libdir}/*.a |
342 |
%attr(0644,root,root) %{_libdir}/*.la |
343 |
%{_libdir}/*.so |
344 |
%{_libdir}/pkgconfig/*.pc |
345 |
|
346 |
%files -n perl-Image-Magick |
347 |
%defattr(-,root,root) |
348 |
%{perl_vendorarch}/Image |
349 |
%{perl_vendorarch}/auto/Image |
350 |
%{_mandir}/man3*/*::*.3pm* |
351 |
|
352 |
%files doc |
353 |
%defattr(-,root,root) |
354 |
%doc ImageMagick.pdf ChangeLog LICENSE NEWS* NOTICE |
355 |
%doc QuickStart.txt installed_docs/* |
356 |
|
357 |
|