File libjpeg-turbo.spec of Package libjpeg-turbo
xxxxxxxxxx
1
#
2
# spec file for package libjpeg-turbo
3
#
4
# Copyright (c) 2021 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%define asan_build 0
20
%define debug_build 0
21
%define srcver 2.1.1
22
%define major 8
23
%define minor 2
24
%define micro 2
25
%define libver %{major}.%{minor}.%{micro}
26
%define tmajor 0
27
%define tminor 2
28
%define tmicro 0
29
%define tlibver %{tmajor}.%{tminor}.%{tmicro}
30
Name: libjpeg-turbo
31
Version: %{srcver}
32
Release: 0
33
Summary: A SIMD-accelerated library for manipulating JPEG image files
34
License: BSD-3-Clause
35
URL: https://sourceforge.net/projects/libjpeg-turbo
36
Source0: http://downloads.sf.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
37
Source1: http://downloads.sf.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz.sig
38
Source2: libjpeg-turbo.keyring
39
Source3: baselibs.conf
40
Patch1: libjpeg-turbo-1.3.0-tiff-ojpeg.patch
41
BuildRequires: cmake
42
BuildRequires: gcc-c++
43
BuildRequires: pkgconfig
44
BuildRequires: yasm
45
Conflicts: jpeg%{major}
46
Obsoletes: jpeg = 6b
47
Obsoletes: jpeg = 8.0.1
48
Obsoletes: jpeg = 8.0.2
49
Provides: jpeg = %{version}
50
Obsoletes: jpeg < %{version}
51
52
%description
53
The libjpeg-turbo package contains a library of functions for manipulating
54
JPEG images. It supports architecture-specific SIMD instructions,
55
such as SSE/SSE2/AVX2, AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
56
57
It also includes the following command line utilities:
58
djpeg - decompress a JPEG file to an image file
59
jpegtran - lossless transformation of JPEG files
60
rdjpgcom - display text comments from a JPEG file
61
wrjpgcom - insert text comments into a JPEG file
62
tjbench - a JPEG decompression/compression benchmark
63
64
%package -n libjpeg%{major}
65
Version: %{libver}
66
Release: 0
67
Summary: A SIMD-accelerated JPEG compression/decompression library
68
69
%description -n libjpeg%{major}
70
A library for manipulating JPEG images. It supports
71
architecture-specific SIMD instructions, such as SSE/SSE2/AVX2,
72
AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
73
74
%package -n libturbojpeg%{tmajor}
75
Version: %{version}
76
Release: 0
77
Summary: A SIMD-accelerated JPEG compression/decompression library
78
79
%description -n libturbojpeg%{tmajor}
80
A library for manipulating JPEG images. It supports
81
architecture-specific SIMD instructions, such as SSE/SSE2/AVX2,
82
AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
83
84
%package -n libjpeg%{major}-devel
85
Version: %{libver}
86
Release: 0
87
Summary: Development Tools for applications which will use the Libjpeg Library
88
Requires: libjpeg%{major} = %{version}
89
Requires: libturbojpeg%{tmajor} = %{version}
90
Conflicts: libjpeg-devel
91
Provides: libjpeg-devel = %{version}
92
Obsoletes: libjpeg-devel < %{version}
93
94
%description -n libjpeg%{major}-devel
95
The libjpeg-devel package includes the header files and libraries
96
necessary for compiling and linking programs which will manipulate JPEG
97
files using the libjpeg library.
98
99
%prep
100
%setup -q
101
%patch1
102
103
%build
104
MYLDFLAGS="-Wl,-z,relro,-z,now"
105
MYCFLAGS="%{optflags}"
106
%if %{asan_build}
107
MYLDFLAGS="$MYLDFLAGS -lasan"
108
MYCFLAGS="$MYCFLAGS -fsanitize=address"
109
%endif
110
%if %{debug_build}
111
MYCFLAGS="$MYCFLAGS -O0 -g"
112
%endif
113
%cmake \
114
%if %{debug_build} || %{asan_build}
115
-DCMAKE_BUILD_TYPE=DEBUG \
116
-DCMAKE_C_FLAGS_DEBUG="$MYCFLAGS" \
117
%endif
118
%ifarch armv6l armv6hl
119
-DWITH_SIMD=FALSE \
120
%endif
121
-DCMAKE_SHARED_LINKER_FLAGS="$MYLDFLAGS" \
122
-DENABLE_STATIC=OFF \
123
-DWITH_JPEG8=ON \
124
%ifarch s390x riscv64
125
-DFLOATTEST=fp-contract \
126
%endif
127
%{nil}
128
%make_build
129
130
%check
131
%if %{asan_build}
132
# ASAN needs /proc to be mounted
133
exit 0
134
%endif
135
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
136
%if 0%{?fedora_version}
137
ctest --output-on-failure --force-new-ctest-process
138
%else
139
%ctest
140
%endif
141
142
%install
143
%if 0%{?fedora_version}
144
make DESTDIR=%{buildroot} install/fast
145
%else
146
%cmake_install
147
%endif
148
# Remove docs, we'll select docs manually
149
rm -rf %{buildroot}%{_datadir}/doc/
150
151
%post -n libjpeg%{major} -p /sbin/ldconfig
152
%postun -n libjpeg%{major} -p /sbin/ldconfig
153
%post -n libturbojpeg%{tmajor} -p /sbin/ldconfig
154
%postun -n libturbojpeg%{tmajor} -p /sbin/ldconfig
155
156
%files
157
%doc README.md change.log ChangeLog.md
158
%doc usage.txt wizard.txt
159
%{_bindir}/*
160
%{_mandir}/man1/*
161
162
%files -n libjpeg%{major}
163
%license LICENSE.md
164
%{_libdir}/libjpeg.so.%{libver}
165
%{_libdir}/libjpeg.so.%{major}
166
167
%files -n libturbojpeg%{tmajor}
168
%license LICENSE.md
169
%{_libdir}/libturbojpeg.so.%{tmajor}
170
%{_libdir}/libturbojpeg.so.%{tlibver}
171
172
%files -n libjpeg%{major}-devel
173
%{_includedir}/*.h
174
%{_libdir}/libjpeg.so
175
%{_libdir}/libturbojpeg.so
176
%{_libdir}/pkgconfig/libjpeg.pc
177
%{_libdir}/pkgconfig/libturbojpeg.pc
178
%dir %{_libdir}/cmake/libjpeg-turbo
179
%{_libdir}/cmake/libjpeg-turbo/*
180
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt tjexample.c
181
182
%changelog
183