openjpeg2/openjpeg2.spec
Ismail Dönmez 96b2424330 Accepting request 523789 from home:hpjansson:openjpeg2-cve-factory
Add security fixes:
  openjpeg2-CVE-2016-10504.patch (CVE-2016-10504, bsc#1056351),
  openjpeg2-CVE-2016-10505.patch (CVE-2016-10505, bsc#1056363),
  openjpeg2-CVE-2016-10506.patch (CVE-2016-10506, bsc#1056396),
  openjpeg2-CVE-2017-12982.patch (CVE-2017-12982, bsc#1054696),
  openjpeg2-CVE-2017-14039.patch (CVE-2017-14039, CVE-2017-14164,
  bsc#1056622, bsc#1057511),
  openjpeg2-CVE-2017-14040.patch (CVE-2017-14040, bsc#1056621),
  openjpeg2-CVE-2017-14041.patch (CVE-2017-14041, bsc#1056562),
  openjpeg2-CVE-2017-14151.patch (CVE-2017-14151, bsc#1057336),
  openjpeg2-CVE-2017-14152.patch (CVE-2017-14152, bsc#1057335),
  most of which are critical, including heap and stack overwrites,
  over-reads and division by zero errors.

OBS-URL: https://build.opensuse.org/request/show/523789
OBS-URL: https://build.opensuse.org/package/show/graphics/openjpeg2?expand=0&rev=28
2017-09-13 14:11:10 +00:00

167 lines
5.6 KiB
RPMSpec

#
# spec file for package openjpeg2
#
# Copyright (c) 2017 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 http://bugs.opensuse.org/
#
%define library_name libopenjp2-7
%define base_version 2.1
Name: openjpeg2
Version: %{base_version}.2
Release: 0
Summary: Opensource JPEG 2000 Codec Implementation
License: BSD-2-Clause
Group: Productivity/Graphics/Other
Url: http://www.openjpeg.org/
Source0: https://github.com/uclouvain/openjpeg/archive/v%{version}.tar.gz#/openjpeg-%{version}.tar.gz
Source1: baselibs.conf
BuildRequires: cmake > 2.8.2
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: pkg-config
BuildRequires: pkgconfig(lcms2)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libtiff-4)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# CVE-2016-5152 is
# https://pdfium.googlesource.com/pdfium.git/+/d8cc503575463ff3d81b22dad292665f2c88911e/third_party/libopenjpeg20/0018-tcd_get_decoded_tile_size.patch
Patch1: 0018-tcd_get_decoded_tile_size.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2016-10504.patch bsc#1056351 hpj@suse.com
Patch2: openjpeg2-CVE-2016-10504.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2016-10505.patch bsc#1056363 hpj@suse.com
Patch3: openjpeg2-CVE-2016-10505.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2016-10506.patch bsc#1056396 hpj@suse.com
Patch4: openjpeg2-CVE-2016-10506.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2017-12982.patch bsc#1054696 hpj@suse.com
Patch5: openjpeg2-CVE-2017-12982.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2017-14039.patch bsc#1056622 bsc#1057511 hpj@suse.com
Patch6: openjpeg2-CVE-2017-14039.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2017-14040.patch bsc#1056621 hpj@suse.com
Patch7: openjpeg2-CVE-2017-14040.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2017-14041.patch bsc#1056562 hpj@suse.com
Patch8: openjpeg2-CVE-2017-14041.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2017-14151.patch bsc#1057336 hpj@suse.com
Patch9: openjpeg2-CVE-2017-14151.patch
# PATCH-FIX-UPSTREAM openjpeg2-CVE-2017-14152.patch bsc#1057335 hpj@suse.com
Patch10: openjpeg2-CVE-2017-14152.patch
%description
The OpenJPEG library is an open-source JPEG 2000 codec written in C language.
It has been developed in order to promote the use of JPEG 2000, the new
still-image compression standard from the Joint Photographic Experts Group
(JPEG).
This package provides the codec executables.
%package -n %{library_name}
Summary: Opensource JPEG 2000 Codec Implementation
Group: System/Libraries
%description -n %{library_name}
The OpenJPEG library is an open-source JPEG 2000 codec written in C language.
It has been developed in order to promote the use of JPEG 2000, the new
still-image compression standard from the Joint Photographic Experts Group
(JPEG).
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/Other
Requires: %{library_name} = %{version}
Recommends: %{name} = %{version}
%description devel
The OpenJPEG library is an open-source JPEG 2000 codec written in C language.
It has been developed in order to promote the use of JPEG 2000, the new
still-image compression standard from the Joint Photographic Experts Group
(JPEG).
This package provides the development files for %{name}.
%prep
%setup -q -n openjpeg-%{version}
# do not embed timestamps into html documentation
sed -i 's|^HTML_TIMESTAMP[ =].*$|HTML_TIMESTAMP = NO|' doc/Doxyfile.dox.cmake.in
# ensure no bundled libraries are used
for d in thirdparty/*; do
[ -d "$d" ] && rm -rf "$d"
done
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%build
%cmake \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_CODEC:BOOL=ON \
-DBUILD_JPIP:BOOL=OFF \
-DBUILD_JPWL:BOOL=OFF \
-DBUILD_MJ2:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_DOC:BOOL=ON \
-DBUILD_THIRDPARTY:BOOL=OFF \
-DOPENJPEG_INSTALL_LIB_DIR:PATH="%{_lib}"
make %{?_smp_mflags} all doc
cat << END > libopenjp2.pc
Name: openjpeg
Version: %{version}
Url: %{url}
Description: Opensource JPEG 2000 Codec Implementation
Libs: -L%{_libdir} -lopenjp2
Libs.private: -lm
Cflags: -I%{_includedir}/openjpeg-%{base_version}
END
%fdupes -s doc/html/
%install
%cmake_install
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
install -m 644 build/libopenjp2.pc %{buildroot}%{_libdir}/pkgconfig/
rm -rf %{buildroot}%{_datadir}/doc
%post -n %{library_name} -p /sbin/ldconfig
%postun -n %{library_name} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS.md CHANGELOG.md NEWS.md LICENSE README.md THANKS.md
%{_bindir}/opj_*
%{_mandir}/man1/opj_*.1%{ext_man}
%files -n %{library_name}
%defattr(-,root,root,-)
%{_libdir}/libopenjp2.so.*
%files devel
%defattr(-,root,root,-)
%doc build/doc/html/
%{_includedir}/openjpeg-%{base_version}/
%{_libdir}/libopenjp2.so
%{_libdir}/pkgconfig/libopenjp2.pc
%{_libdir}/openjpeg-%{base_version}/
%{_mandir}/man3/libopenjp2.3%{ext_man}
%changelog