da4962
# Conformance tests disabled by default since it requires 1 GB of test data
da4962
#global runcheck 1
da4962
da4962
#global optional_components 1
da4962
da4962
Name:           openjpeg2
0591ff
Version:        2.4.0
f8cb4b
Release:        5%{?dist}
da4962
Summary:        C-Library for JPEG 2000
da4962
da4962
# windirent.h is MIT, the rest is BSD
da4962
License:        BSD and MIT
da4962
URL:            https://github.com/uclouvain/openjpeg
da4962
Source0:        https://github.com/uclouvain/openjpeg/archive/v%{version}/openjpeg-%{version}.tar.gz
da4962
%if 0%{?runcheck}
da4962
# git clone git@github.com:uclouvain/openjpeg-data.git
da4962
Source1:        data.tar.xz
da4962
%endif
da4962
da4962
# Rename tool names to avoid conflicts with openjpeg-1.x
da4962
Patch0:         openjpeg2_opj2.patch
da4962
da4962
# Fix Coverity issues
da4962
Patch1:         openjpeg2_coverity.patch
da4962
0591ff
# Fix CVE-2021-29338
0591ff
Patch2:         openjpeg2-CVE-2021-29338.patch
0591ff
# Fix CVE-2021-3575
0591ff
Patch3:         openjpeg2-CVE-2021-3575.patch
f8cb4b
Patch4:         openjpeg2-CVE-2022-1122.patch
da4962
da4962
BuildRequires:  cmake
da4962
BuildRequires:  gcc
da4962
BuildRequires:  make
da4962
BuildRequires:  zlib-devel
da4962
BuildRequires:  libpng-devel
da4962
BuildRequires:  libtiff-devel
da4962
BuildRequires:  lcms2-devel
da4962
BuildRequires:  doxygen
da4962
da4962
%if 0%{?optional_components}
da4962
BuildRequires:  java-devel
da4962
BuildRequires:  xerces-j2
da4962
%endif
da4962
da4962
%description
da4962
The OpenJPEG library is an open-source JPEG 2000 library developed in order to
da4962
promote the use of JPEG 2000.
da4962
da4962
This package contains
da4962
* JPEG 2000 codec compliant with the Part 1 of the standard (Class-1 Profile-1
da4962
  compliance).
da4962
* JP2 (JPEG 2000 standard Part 2 - Handling of JP2 boxes and extended multiple
da4962
  component transforms for multispectral and hyperspectral imagery)
da4962
da4962
da4962
%package devel
da4962
Summary:        Development files for OpenJPEG 2
da4962
Requires:       %{name}%{?_isa} = %{version}-%{release}
da4962
# OpenJPEGTargets.cmake refers to the tools
da4962
Requires:       %{name}-tools%{?_isa} = %{version}-%{release}
da4962
da4962
%description devel
da4962
The %{name}-devel package contains libraries and header files for developing
da4962
applications that use OpenJPEG 2.
da4962
da4962
da4962
%package devel-docs
da4962
Summary:        Developer documentation for OpenJPEG 2
da4962
BuildArch:      noarch
da4962
da4962
%description devel-docs
da4962
The %{name}-devel-docs package contains documentation files for developing
da4962
applications that use OpenJPEG 2.
da4962
da4962
da4962
%package tools
da4962
Summary:        OpenJPEG 2 command line tools
da4962
Requires:       %{name}%{?_isa} = %{version}-%{release}
da4962
da4962
%description tools
da4962
Command line tools for JPEG 2000 file manipulation, using OpenJPEG2:
da4962
 * opj2_compress
da4962
 * opj2_decompress
da4962
 * opj2_dump
da4962
da4962
%if 0%{?optional_components}
da4962
##### MJ2 #####
da4962
da4962
%package mj2
da4962
Summary:        OpenJPEG2 MJ2 module
da4962
Requires:       %{name}%{?_isa} = %{version}-%{release}
da4962
da4962
%description mj2
da4962
The OpenJPEG library is an open-source JPEG 2000 library developed in order to
da4962
promote the use of JPEG 2000.
da4962
da4962
This package contains the MJ2 module (JPEG 2000 standard Part 3)
da4962
da4962
da4962
%package mj2-devel
da4962
Summary:        Development files for OpenJPEG2 MJ2 module
da4962
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
da4962
Requires:       %{name}-mj2%{?_isa} = %{version}-%{release}
da4962
da4962
%description mj2-devel
da4962
Development files for OpenJPEG2 MJ2 module
da4962
da4962
da4962
%package mj2-tools
da4962
Summary:        OpenJPEG2 MJ2 module command line tools
da4962
Requires:       %{name}-mj2%{?_isa} = %{version}-%{release}
da4962
da4962
%description mj2-tools
da4962
OpenJPEG2 MJ2 module command line tools
da4962
da4962
##### JPWL #####
da4962
da4962
%package jpwl
da4962
Summary:        OpenJPEG2 JPWL module
da4962
Requires:       %{name}%{?_isa} = %{version}-%{release}
da4962
da4962
%description jpwl
da4962
The OpenJPEG library is an open-source JPEG 2000 library developed in order to
da4962
promote the use of JPEG 2000.
da4962
da4962
This package contains the JPWL (JPEG 2000 standard Part 11 - Jpeg 2000 Wireless)
da4962
da4962
da4962
%package jpwl-devel
da4962
Summary:        Development files for OpenJPEG2 JPWL module
da4962
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
da4962
Requires:       %{name}-jpwl%{?_isa} = %{version}-%{release}
da4962
da4962
%description jpwl-devel
da4962
Development files for OpenJPEG2 JPWL module
da4962
da4962
da4962
%package jpwl-tools
da4962
Summary:        OpenJPEG2 JPWL module command line tools
da4962
Requires:       %{name}-jpwl%{?_isa} = %{version}-%{release}
da4962
da4962
%description jpwl-tools
da4962
OpenJPEG2 JPWL module command line tools
da4962
da4962
##### JPIP #####
da4962
da4962
%package jpip
da4962
Summary:        OpenJPEG2 JPIP module
da4962
Requires:       %{name}%{?_isa} = %{version}-%{release}
da4962
da4962
%description jpip
da4962
The OpenJPEG library is an open-source JPEG 2000 library developed in order to
da4962
promote the use of JPEG 2000.
da4962
da4962
This package contains the JPWL (JPEG 2000 standard Part 9 - Jpeg 2000 Interactive Protocol)
da4962
da4962
da4962
%package jpip-devel
da4962
Summary:        Development files for OpenJPEG2 JPIP module
da4962
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
da4962
Requires:       %{name}-jpwl%{?_isa} = %{version}-%{release}
da4962
da4962
%description jpip-devel
da4962
Development files for OpenJPEG2 JPIP module
da4962
da4962
da4962
%package jpip-tools
da4962
Summary:        OpenJPEG2 JPIP module command line tools
da4962
Requires:       %{name}-jpip%{?_isa} = %{version}-%{release}
da4962
Requires:       jpackage-utils
da4962
Requires:       java
da4962
da4962
%description jpip-tools
da4962
OpenJPEG2 JPIP module command line tools
da4962
da4962
##### JP3D #####
da4962
da4962
%package jp3d
da4962
Summary:        OpenJPEG2 JP3D module
da4962
Requires:       %{name}%{?_isa} = %{version}-%{release}
da4962
da4962
%description jp3d
da4962
The OpenJPEG library is an open-source JPEG 2000 library developed in order to
da4962
promote the use of JPEG 2000.
da4962
da4962
This package contains the JP3D (JPEG 2000 standard Part 10 - Jpeg 2000 3D)
da4962
da4962
da4962
%package jp3d-devel
da4962
Summary:        Development files for OpenJPEG2 JP3D module
da4962
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
da4962
Requires:       %{name}-jp3d%{?_isa} = %{version}-%{release}
da4962
da4962
%description jp3d-devel
da4962
Development files for OpenJPEG2 JP3D module
da4962
da4962
da4962
%package jp3d-tools
da4962
Summary:        OpenJPEG2 JP3D module command line tools
da4962
Requires:       %{name}-jp3d%{?_isa} = %{version}-%{release}
da4962
da4962
%description jp3d-tools
da4962
OpenJPEG2 JP3D module command line tools
da4962
%endif
da4962
da4962
da4962
%prep
da4962
%autosetup -p1 -n openjpeg-%{version} %{?runcheck:-a 1}
da4962
da4962
# Remove all third party libraries just to be sure
da4962
find thirdparty/ -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;
da4962
da4962
da4962
%build
da4962
mkdir %{_target_platform}
da4962
pushd %{_target_platform}
da4962
# TODO: Consider
da4962
# -DBUILD_JPIP_SERVER=ON -DBUILD_JAVA=ON
da4962
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENJPEG_INSTALL_LIB_DIR=%{_lib} \
da4962
    %{?optional_components:-DBUILD_MJ2=ON -DBUILD_JPWL=ON -DBUILD_JPIP=ON -DBUILD_JP3D=ON} \
da4962
    -DBUILD_DOC=ON \
da4962
    -DBUILD_STATIC_LIBS=OFF \
da4962
    -DBUILD_SHARED_LIBS=ON \
da4962
    %{?runcheck:-DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT=$PWD/../data} \
da4962
    ..
da4962
popd
da4962
da4962
%make_build VERBOSE=1 -C %{_target_platform}
da4962
da4962
da4962
%install
da4962
%make_install -C %{_target_platform}
da4962
da4962
mv %{buildroot}%{_mandir}/man1/opj_compress.1 %{buildroot}%{_mandir}/man1/opj2_compress.1
da4962
mv %{buildroot}%{_mandir}/man1/opj_decompress.1 %{buildroot}%{_mandir}/man1/opj2_decompress.1
da4962
mv %{buildroot}%{_mandir}/man1/opj_dump.1 %{buildroot}%{_mandir}/man1/opj2_dump.1
da4962
da4962
# Docs are installed through %%doc
da4962
rm -rf %{buildroot}%{_datadir}/doc/
da4962
da4962
%if 0%{?optional_components}
da4962
# Move the jar to the correct place
da4962
mkdir -p %{buildroot}%{_javadir}
da4962
mv %{buildroot}%{_datadir}/opj_jpip_viewer.jar %{buildroot}%{_javadir}/opj2_jpip_viewer.jar
da4962
cat > %{buildroot}%{_bindir}/opj2_jpip_viewer <
da4962
java -jar %{_javadir}/opj2_jpip_viewer.jar "$@"
da4962
EOF
da4962
chmod +x %{buildroot}%{_bindir}/opj2_jpip_viewer
da4962
%endif
da4962
da4962
da4962
%ldconfig_scriptlets
da4962
da4962
da4962
%check
da4962
%if 0%{?runcheck}
da4962
make test -C %{_target_platform}
da4962
%endif
da4962
da4962
da4962
%files
da4962
%{!?_licensedir:%global license %doc}
da4962
%license LICENSE
da4962
%doc AUTHORS.md NEWS.md README.md THANKS.md
da4962
%{_libdir}/libopenjp2.so.*
da4962
%{_mandir}/man3/libopenjp2.3*
da4962
da4962
%files devel
0591ff
%dir %{_includedir}/openjpeg-2.4/
0591ff
%{_includedir}/openjpeg-2.4/openjpeg.h
0591ff
%{_includedir}/openjpeg-2.4/opj_config.h
0591ff
%{_includedir}/openjpeg-2.4/opj_stdint.h
da4962
%{_libdir}/libopenjp2.so
0591ff
%{_libdir}/openjpeg-2.4/
da4962
%{_libdir}/pkgconfig/libopenjp2.pc
da4962
da4962
%files devel-docs
da4962
%doc %{_target_platform}/doc/html
da4962
da4962
%files tools
da4962
%{_bindir}/opj2_compress
da4962
%{_bindir}/opj2_decompress
da4962
%{_bindir}/opj2_dump
da4962
%{_mandir}/man1/opj2_compress.1*
da4962
%{_mandir}/man1/opj2_decompress.1*
da4962
%{_mandir}/man1/opj2_dump.1*
da4962
da4962
%if 0%{?optional_components}
da4962
%files mj2
da4962
%{_libdir}/libopenmj2.so.*
da4962
da4962
%files mj2-devel
da4962
%{_libdir}/libopenmj2.so
da4962
da4962
%files mj2-tools
da4962
%{_bindir}/opj2_mj2*
da4962
da4962
%files jpwl
da4962
%{_libdir}/libopenjpwl.so.*
da4962
da4962
%files jpwl-devel
da4962
%{_libdir}/libopenjpwl.so
da4962
%{_libdir}/pkgconfig/libopenjpwl.pc
da4962
da4962
%files jpwl-tools
da4962
%{_bindir}/opj2_jpwl*
da4962
da4962
%files jpip
da4962
%{_libdir}/libopenjpip.so.*
da4962
da4962
%files jpip-devel
da4962
%{_libdir}/libopenjpip.so
da4962
%{_libdir}/pkgconfig/libopenjpip.pc
da4962
da4962
%files jpip-tools
da4962
%{_bindir}/opj2_jpip*
da4962
%{_bindir}/opj2_dec_server
da4962
%{_javadir}/opj2_jpip_viewer.jar
da4962
da4962
%files jp3d
da4962
%{_libdir}/libopenjp3d.so.*
da4962
da4962
%files jp3d-devel
da4962
%{_includedir}/openjpeg-2.0/openjp3d.h
da4962
%{_libdir}/libopenjp3d.so
da4962
%{_libdir}/pkgconfig/libopenjp3d.pc
da4962
da4962
%files jp3d-tools
da4962
%{_bindir}/opj2_jp3d*
da4962
%endif
da4962
da4962
da4962
%changelog
f8cb4b
* Wed Jun 15 2022 Matej Mužila <mmuzila@redhat.com> - 2.4.0-5
f8cb4b
- Fix CVE-2022-1122
f8cb4b
34f489
* Fri Jul 02 2021 Nikola Forró <nforro@redhat.com> - 2.4.0-4
34f489
- Fix Covscan defect
34f489
0591ff
* Wed Jun 09 2021 Nikola Forró <nforro@redhat.com> - 2.4.0-3
0591ff
- Fix CVE-2021-3575 (#1969279)
0591ff
- Fix resource leak identified by Covscan
0591ff
0591ff
* Wed Jun 02 2021 Nikola Forró <nforro@redhat.com> - 2.4.0-2
0591ff
- Fix CVE-2021-29338 (#1951332)
0591ff
0591ff
* Mon Mar 01 2021 Nikola Forró <nforro@redhat.com> - 2.4.0-1
0591ff
- Rebase to 2.4.0
0591ff
- Resolves: CVE-2018-5727 (#1538467)
0591ff
- Resolves: CVE-2018-5785 (#1538556)
0591ff
- Resolves: CVE-2018-20845 (#1730679)
0591ff
- Resolves: CVE-2018-20847 (#1734337)
0591ff
- Resolves: CVE-2019-12973 (#1739076)
0591ff
- Resolves: CVE-2020-15389 (#1855115)
0591ff
- Resolves: CVE-2020-27814 (#1908965)
0591ff
- Resolves: CVE-2020-27823 (#1906222)
0591ff
- Resolves: CVE-2020-27824 (#1906216)
0591ff
- Resolves: CVE-2020-27842 (#1908165)
0591ff
- Resolves: CVE-2020-27843 (#1908164)
0591ff
- Resolves: CVE-2020-27845 (#1908168)
0591ff
da4962
* Mon Feb 10 2020 Nikola Forró <nforro@redhat.com> - 2.3.1-6
da4962
- Fix CVE-2020-8112 (#1801034)
da4962
da4962
* Tue Jan 14 2020 Nikola Forró <nforro@redhat.com> - 2.3.1-5
da4962
- Fix CVE-2020-6851 (#1790590)
da4962
da4962
* Wed Dec 04 2019 Nikola Forró <nforro@redhat.com> - 2.3.1-4
da4962
- Add upstream test suite and enable it in gating
da4962
da4962
* Fri Nov 29 2019 Nikola Forró <nforro@redhat.com> - 2.3.1-3
da4962
- Fix Coverity issues
da4962
da4962
* Wed Nov 20 2019 Nikola Forró <nforro@redhat.com> - 2.3.1-2
da4962
- Fix unbundling third party libraries (#1757823)
da4962
da4962
* Fri May 31 2019 Nikola Forró <nforro@redhat.com> - 2.3.1-1
da4962
- Rebase to 2.3.1 (#1704255)
da4962
da4962
* Tue Oct 16 2018 Nikola Forró <nforro@redhat.com> - 2.3.0-8
da4962
- Fix important Covscan defects (#1602643)
da4962
da4962
* Mon Oct 15 2018 Nikola Forró <nforro@redhat.com> - 2.3.0-7
da4962
- Fix CVE-2018-18088 (#1638562)
da4962
da4962
* Mon Feb 19 2018 Sandro Mani <manisandro@gmail.com> - 2.3.0-6
da4962
- Add missing BR: gcc, make
da4962
da4962
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-5
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
da4962
da4962
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.3.0-4
da4962
- Switch to %%ldconfig_scriptlets
da4962
da4962
* Mon Dec 25 2017 Sandro Mani <manisandro@gmail.com> - 2.3.0-3
da4962
- Rename tool names at cmake level to ensure OpenJPEGTargets.cmake refers to the renamed files
da4962
da4962
* Mon Dec 25 2017 Sandro Mani <manisandro@gmail.com> - 2.3.0-2
da4962
- Use BUILD_STATIC_LIBS=OFF instead of deleting the static library after build
da4962
da4962
* Thu Oct 05 2017 Sandro Mani <manisandro@gmail.com> - 2.3.0-1
da4962
- Update to 2.3.0
da4962
da4962
* Thu Sep 07 2017 Sandro Mani <manisandro@gmail.com> - 2.2.0-4
da4962
- Backport fix for CVE-2017-14039
da4962
da4962
* Thu Aug 31 2017 Sandro Mani <manisandro@gmail.com> - 2.2.0-3
da4962
- Backport more security fixes, including for CVE-2017-14041 and CVE-2017-14040
da4962
da4962
* Thu Aug 31 2017 Sandro Mani <manisandro@gmail.com> - 2.2.0-2
da4962
- Backport patch for CVE-2017-12982
da4962
da4962
* Thu Aug 10 2017 Sandro Mani <manisandro@gmail.com> - 2.2.0-1
da4962
- Update to 2.2.0
da4962
da4962
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-6
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
da4962
da4962
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-5
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
da4962
da4962
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-4
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
da4962
da4962
* Sat Dec 17 2016 Sandro Mani <manisandro@gmail.com> - 2.1.2-3
da4962
- Add patch for CVE-2016-9580 (#1405128) and CVE-2016-9581 (#1405135)
da4962
da4962
* Thu Dec 08 2016 Sandro Mani <manisandro@gmail.com> - 2.1.2-2
da4962
- Add patch for CVE-2016-9572 (#1402714) and CVE-2016-9573 (#1402711)
da4962
da4962
* Wed Sep 28 2016 Sandro Mani <manisandro@gmail.com> - 2.1.2-1
da4962
- Update to 2.1.2
da4962
- Fixes: CVE-2016-7445
da4962
da4962
* Fri Sep 09 2016 Sandro Mani <manisandro@gmail.com> - 2.1.1-3
da4962
- Backport: Add sanity check for tile coordinates (#1374337)
da4962
da4962
* Fri Sep 09 2016 Sandro Mani <manisandro@gmail.com> - 2.1.1-2
da4962
- Backport fixes for CVE-2016-7163
da4962
da4962
* Wed Jul 06 2016 Sandro Mani <manisandro@gmail.com> - 2.1.1-1
da4962
- Update to 2.1.1
da4962
- Fixes: CVE-2016-3183, CVE-2016-3181, CVE-2016-3182, CVE-2016-4796, CVE-2016-4797, CVE-2015-8871
da4962
da4962
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-8
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
da4962
da4962
* Thu Oct 01 2015 Sandro Mani <manisandro@gmail.com> - 2.1.0-7
da4962
- Backport fix for possible double-free (#1267983)
da4962
da4962
* Tue Sep 15 2015 Sandro Mani <manisandro@gmail.com> - 2.1.0-6
da4962
- Backport fix for use after free vulnerability (#1263359)
da4962
da4962
* Thu Jun 25 2015 Sandro Mani <manisandro@gmail.com> - 2.1.0-5
da4962
- Add openjpeg2_bigendian.patch (#1232739)
da4962
da4962
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-4
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
da4962
da4962
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-3
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
da4962
da4962
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-2
da4962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
da4962
da4962
* Tue May 27 2014 Sandro Mani <manisandro@gmail.com> - 2.1.0-1
da4962
- Update to 2.1.0
da4962
da4962
* Wed Apr 16 2014 Sandro Mani <manisandro@gmail.com> - 2.0.0-5
da4962
- Switch to official 2.0 release and backport pkg-config patch
da4962
da4962
* Thu Apr 10 2014 Sandro Mani <manisandro@gmail.com> - 2.0.0-4.svn20140403
da4962
- Replace define with global
da4962
- Fix #define optional_components 1S typo
da4962
- Fix %%(pwd) -> $PWD for test data
da4962
- Added some BR for optional components
da4962
- Include opj2_jpip_viewer.jar in %%files
da4962
da4962
* Wed Apr 09 2014 Sandro Mani <manisandro@gmail.com> - 2.0.0-3.svn20140403
da4962
- Fix source url
da4962
- Fix mixed tabs and spaces
da4962
- Fix description too long
da4962
da4962
* Wed Apr 09 2014 Sandro Mani <manisandro@gmail.com> - 2.0.0-2.svn20140403
da4962
- Remove thirdparty libraries folder in prep
da4962
- Own %%{_libdir}/openjpeg-2.0/
da4962
- Fix Requires
da4962
- Add missing ldconfig
da4962
- Add possibility to run conformance tests if desired
da4962
 
da4962
* Thu Apr 03 2014 Sandro Mani <manisandro@gmail.com> - 2.0.0-1.svn20140403
da4962
- Initial package