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