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