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