libjpeg-turbo/libjpeg-turbo.spec
Petr Gajdos 6c22e4b5a5 Accepting request 789475 from home:ukbeast89:branches:graphics
- Upate to version 2.0.4:
- bug 388 was fixed upstream
  https://github.com/libjpeg-turbo/libjpeg-turbo/issues/388
- removed patches, as it is included in this release.
  * Fixed a regression in the Windows packaging system 
   (introduced by 2.0 beta1[2]) whereby, if both the 64-bit libjpeg-turbo 
   SDK for GCC and the 64-bit libjpeg-turbo SDK for Visual C++ were installed 
   on the same system, only one of them could be uninstalled.
  * Fixed a signed integer overflow and subsequent segfault that occurred when 
    attempting to decompress images with more than 715827882 pixels using the 64-bit C version of TJBench.
  * Fixed out-of-bounds write in tjDecompressToYUV2() and tjDecompressToYUVPlanes() 
    (sometimes manifesting as a double free) that occurred when attempting to decompress 
    grayscale JPEG images that were compressed with a sampling factor other than 1 
    (for instance, with cjpeg -grayscale -sample 2x2).
  * Fixed a regression introduced by 2.0.2[5] that caused the TurboJPEG API to incorrectly 
    identify some JPEG images with unusual sampling factors as 4:4:4 JPEG images. 
    This was known to cause a buffer overflow when attempting to decompress some such images using 
    tjDecompressToYUV2() or tjDecompressToYUVPlanes().
  * Fixed an issue, detected by ASan, whereby attempting to losslessly transform a specially-crafted 
    malformed JPEG image containing an extremely-high-frequency coefficient block 
    (junk image data that could never be generated by a legitimate JPEG compressor) could cause the 
    Huffman encoder's local buffer to be overrun. (Refer to 1.4.0[9] and 1.4beta1[15].) 
    Given that the buffer overrun was fully contained within the stack and did not cause a segfault 
    or other user-visible errant behavior, and given that the lossless transformer (unlike the decompressor) 
    is not generally exposed to arbitrary data exploits, this issue did not likely pose a security risk.
    The ARM 64-bit (ARMv8) NEON SIMD assembly code now stores constants in a separate read-only data 
    section rather than in the text section, to support execute-only memory layouts.
- Upate to version 2.0.4:
  * Fixed a regression in the Windows packaging system 
   (introduced by 2.0 beta1[2]) whereby, if both the 64-bit libjpeg-turbo 
   SDK for GCC and the 64-bit libjpeg-turbo SDK for Visual C++ were installed 
   on the same system, only one of them could be uninstalled.
  * Fixed a signed integer overflow and subsequent segfault that occurred when 
    attempting to decompress images with more than 715827882 pixels using the 64-bit C version of TJBench.
  * Fixed out-of-bounds write in tjDecompressToYUV2() and tjDecompressToYUVPlanes() 
    (sometimes manifesting as a double free) that occurred when attempting to decompress 
    grayscale JPEG images that were compressed with a sampling factor other than 1 
    (for instance, with cjpeg -grayscale -sample 2x2).
  * Fixed a regression introduced by 2.0.2[5] that caused the TurboJPEG API to incorrectly 
    identify some JPEG images with unusual sampling factors as 4:4:4 JPEG images. 
    This was known to cause a buffer overflow when attempting to decompress some such images using 
    tjDecompressToYUV2() or tjDecompressToYUVPlanes().
  * Fixed an issue, detected by ASan, whereby attempting to losslessly transform a specially-crafted 
    malformed JPEG image containing an extremely-high-frequency coefficient block 
    (junk image data that could never be generated by a legitimate JPEG compressor) could cause the 
    Huffman encoder's local buffer to be overrun. (Refer to 1.4.0[9] and 1.4beta1[15].) 
    Given that the buffer overrun was fully contained within the stack and did not cause a segfault 
    or other user-visible errant behavior, and given that the lossless transformer (unlike the decompressor) 
    is not generally exposed to arbitrary data exploits, this issue did not likely pose a security risk.
    The ARM 64-bit (ARMv8) NEON SIMD assembly code now stores constants in a separate read-only data 
    section rather than in the text section, to support execute-only memory layouts.

OBS-URL: https://build.opensuse.org/request/show/789475
OBS-URL: https://build.opensuse.org/package/show/graphics/libjpeg-turbo?expand=0&rev=104
2020-03-30 07:51:51 +00:00

183 lines
5.3 KiB
RPMSpec

#
# spec file for package libjpeg-turbo
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define asan_build 0
%define debug_build 0
%define srcver 2.0.4
%define major 8
%define minor 2
%define micro 2
%define libver %{major}.%{minor}.%{micro}
%define tmajor 0
%define tminor 2
%define tmicro 0
%define tlibver %{tmajor}.%{tminor}.%{tmicro}
Name: libjpeg-turbo
Version: %{srcver}
Release: 0
Summary: A SIMD-accelerated library for manipulating JPEG image files
License: BSD-3-Clause
Group: Productivity/Graphics/Convertors
URL: https://github.com/libjpeg-turbo/libjpeg-turbo
Source0: http://downloads.sf.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
Source1: baselibs.conf
Patch1: libjpeg-turbo-1.3.0-tiff-ojpeg.patch
Patch2: ctest-depends.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: yasm
Conflicts: jpeg%{major}
Obsoletes: jpeg = 6b
Obsoletes: jpeg = 8.0.1
Obsoletes: jpeg = 8.0.2
Provides: jpeg = %{version}
Obsoletes: jpeg < %{version}
%description
The libjpeg-turbo package contains a library of functions for manipulating
JPEG images. It supports architecture-specific SIMD instructions,
such as SSE/SSE2/AVX2, AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
It also includes the following command line utilities:
djpeg - decompress a JPEG file to an image file
jpegtran - lossless transformation of JPEG files
rdjpgcom - display text comments from a JPEG file
wrjpgcom - insert text comments into a JPEG file
tjbench - a JPEG decompression/compression benchmark
%package -n libjpeg%{major}
Version: %{libver}
Release: 0
Summary: A SIMD-accelerated JPEG compression/decompression library
Group: System/Libraries
%description -n libjpeg%{major}
A library for manipulating JPEG images. It supports
architecture-specific SIMD instructions, such as SSE/SSE2/AVX2,
AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
%package -n libturbojpeg%{tmajor}
Version: %{version}
Release: 0
Summary: A SIMD-accelerated JPEG compression/decompression library
Group: System/Libraries
%description -n libturbojpeg%{tmajor}
A library for manipulating JPEG images. It supports
architecture-specific SIMD instructions, such as SSE/SSE2/AVX2,
AltiVec, NEON, MIPS DSPR2, and Loongson MMI.
%package -n libjpeg%{major}-devel
Version: %{libver}
Release: 0
Summary: Development Tools for applications which will use the Libjpeg Library
Group: Development/Libraries/C and C++
Requires: libjpeg%{major} = %{version}
Requires: libturbojpeg%{tmajor} = %{version}
Conflicts: libjpeg-devel
Provides: libjpeg-devel = %{version}
Obsoletes: libjpeg-devel < %{version}
%description -n libjpeg%{major}-devel
The libjpeg-devel package includes the header files and libraries
necessary for compiling and linking programs which will manipulate JPEG
files using the libjpeg library.
%prep
%setup -q
%patch1
%patch2 -p1
%build
MYLDFLAGS="-Wl,-z,relro,-z,now"
MYCFLAGS="%{optflags}"
%if %{asan_build}
MYLDFLAGS="$MYLDFLAGS -lasan"
MYCFLAGS="$MYCFLAGS -fsanitize=address"
%endif
%if %{debug_build}
MYCFLAGS="$MYCFLAGS -O0 -g"
%endif
%cmake \
%if %{debug_build} || %{asan_build}
-DCMAKE_BUILD_TYPE=DEBUG \
-DCMAKE_C_FLAGS_DEBUG="$MYCFLAGS" \
%endif
-DCMAKE_SHARED_LINKER_FLAGS="$MYLDFLAGS" \
-DENABLE_STATIC=OFF \
-DWITH_JPEG8=ON \
%ifarch ppc
-DFLOATTEST=64bit \
%endif
%{nil}
make %{?_smp_mflags}
%check
%if %{asan_build}
# ASAN needs /proc to be mounted
exit 0
%endif
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
%if 0%{?fedora_version}
ctest --output-on-failure --force-new-ctest-process
%else
%ctest
%endif
%install
%if 0%{?fedora_version}
make DESTDIR=%{buildroot} install/fast
%else
%cmake_install
%endif
# Remove docs, we'll select docs manually
rm -rf %{buildroot}%{_datadir}/doc/
%post -n libjpeg%{major} -p /sbin/ldconfig
%postun -n libjpeg%{major} -p /sbin/ldconfig
%post -n libturbojpeg%{tmajor} -p /sbin/ldconfig
%postun -n libturbojpeg%{tmajor} -p /sbin/ldconfig
%files
%doc README.md change.log ChangeLog.md
%doc usage.txt wizard.txt
%{_bindir}/*
%{_mandir}/man1/*
%files -n libjpeg%{major}
%license LICENSE.md
%{_libdir}/libjpeg.so.%{libver}
%{_libdir}/libjpeg.so.%{major}
%files -n libturbojpeg%{tmajor}
%license LICENSE.md
%{_libdir}/libturbojpeg.so.%{tmajor}
%{_libdir}/libturbojpeg.so.%{tlibver}
%files -n libjpeg%{major}-devel
%{_includedir}/*.h
%{_libdir}/libjpeg.so
%{_libdir}/libturbojpeg.so
%{_libdir}/pkgconfig/libjpeg.pc
%{_libdir}/pkgconfig/libturbojpeg.pc
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt tjexample.c
%changelog