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