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