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