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