summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openjpeg2-static.spec39
-rw-r--r--openjpeg2_opj2.patch12
-rw-r--r--openjpeg2_remove-thirdparty.patch8
3 files changed, 40 insertions, 19 deletions
diff --git a/openjpeg2-static.spec b/openjpeg2-static.spec
index 7639e74..e8266b4 100644
--- a/openjpeg2-static.spec
+++ b/openjpeg2-static.spec
@@ -7,7 +7,7 @@
#global optional_components 1
Name: openjpeg2-static
-Version: 2.3.0
+Version: 2.3.1
Release: 1%{?dist}
Summary: C-Library for JPEG 2000
@@ -22,8 +22,14 @@ Source1: data.tar.xz
# Remove bundled libraries
Patch0: openjpeg2_remove-thirdparty.patch
+# Rename tool names to avoid conflicts with openjpeg-1.x
+Patch1: openjpeg2_opj2.patch
+
BuildRequires: cmake
+# The library itself is C only, but there is some optional C++ stuff, hence the project is not marked as C-only in cmake and hence cmake looks for a c++ compiler
+BuildRequires: gcc-c++
+BuildRequires: make
BuildRequires: zlib-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
@@ -48,7 +54,9 @@ This package contains
%package devel
Summary: Development files for OpenJPEG 2
-#Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+# OpenJPEGTargets.cmake refers to the tools
+Requires: %{name}-tools%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for developing
@@ -196,7 +204,9 @@ OpenJPEG2 JP3D module command line tools
%prep
-%autosetup -p1 -n openjpeg-%{version} %{?runcheck:-a 1}
+%setup -qn openjpeg-%{version}
+%patch0 -p1
+%patch1 -p1
# Remove all third party libraries just to be sure
rm -rf thirdparty
@@ -206,13 +216,13 @@ rm -rf thirdparty
mkdir %{_target_platform}
pushd %{_target_platform}
-export CFLAGS="%{optflags} -fPIC"
-
# TODO: Consider
# -DBUILD_JPIP_SERVER=ON -DBUILD_JAVA=ON
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENJPEG_INSTALL_LIB_DIR=%{_lib} \
%{?optional_components:-DBUILD_MJ2=ON -DBUILD_JPWL=ON -DBUILD_JPIP=ON -DBUILD_JP3D=ON} \
-DBUILD_DOC=ON \
+ -DBUILD_STATIC_LIBS=ON \
+ -DBUILD_SHARED_LIBS=OFF \
%{?runcheck:-DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT=$PWD/../data} \
..
popd
@@ -223,13 +233,6 @@ popd
%install
%make_install -C %{_target_platform}
-# KEEP ONLY the static library
-rm -f %{buildroot}%{_libdir}/libopenjp2.so
-
-# Rename to avoid conflicts with openjpeg-1.x
-for file in %{buildroot}%{_bindir}/opj_*; do
- mv $file ${file/opj_/opj2_}
-done
mv %{buildroot}%{_mandir}/man1/opj_compress.1 %{buildroot}%{_mandir}/man1/opj2_compress.1
mv %{buildroot}%{_mandir}/man1/opj_decompress.1 %{buildroot}%{_mandir}/man1/opj2_decompress.1
mv %{buildroot}%{_mandir}/man1/opj_dump.1 %{buildroot}%{_mandir}/man1/opj2_dump.1
@@ -248,9 +251,10 @@ chmod +x %{buildroot}%{_bindir}/opj2_jpip_viewer
%endif
-%post -p /sbin/ldconfig
-
+%if 0%{?fedora} < 28 && 0%{?rhel} < 8
+%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
+%endif
%check
@@ -263,7 +267,6 @@ make test -C %{_target_platform}
%{!?_licensedir:%global license %doc}
%license LICENSE
%doc AUTHORS.md NEWS.md README.md THANKS.md
-%{_libdir}/libopenjp2.so.*
%{_mandir}/man3/libopenjp2.3*
%files devel
@@ -332,6 +335,12 @@ make test -C %{_target_platform}
%changelog
+* Wed Apr 3 2019 Remi Collet <remi@remirepo.net> - 2.3.1-1
+- Update to 2.3.1 from Fedora
+
+* Tue Apr 02 2019 Sandro Mani <manisandro@gmail.com> - 2.3.1-1
+- Update to 2.3.1
+
* Fri Oct 6 2017 Remi Collet <remi@remirepo.net> - 2.3.0-1
- Update to 2.3.0 from Fedora
diff --git a/openjpeg2_opj2.patch b/openjpeg2_opj2.patch
new file mode 100644
index 0000000..4a531ad
--- /dev/null
+++ b/openjpeg2_opj2.patch
@@ -0,0 +1,12 @@
+diff -rupN openjpeg-2.3.1/src/bin/jp2/CMakeLists.txt openjpeg-2.3.1-new/src/bin/jp2/CMakeLists.txt
+--- openjpeg-2.3.1/src/bin/jp2/CMakeLists.txt 2019-04-02 14:45:15.000000000 +0200
++++ openjpeg-2.3.1-new/src/bin/jp2/CMakeLists.txt 2019-04-02 16:14:13.726252297 +0200
+@@ -44,6 +44,8 @@ endif()
+ # Loop over all executables:
+ foreach(exe opj_decompress opj_compress opj_dump)
+ add_executable(${exe} ${exe}.c ${common_SRCS})
++ string(REPLACE "opj_" "opj2_" exe2 ${exe})
++ set_target_properties(${exe} PROPERTIES OUTPUT_NAME ${exe2})
+ if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")
+ target_compile_options(${exe} PRIVATE ${OPENJP2_COMPILE_OPTIONS})
+ endif()
diff --git a/openjpeg2_remove-thirdparty.patch b/openjpeg2_remove-thirdparty.patch
index 6987fc2..12ac763 100644
--- a/openjpeg2_remove-thirdparty.patch
+++ b/openjpeg2_remove-thirdparty.patch
@@ -1,7 +1,7 @@
-diff -rupN openjpeg-2.1.1/CMakeLists.txt openjpeg-2.1.1-new/CMakeLists.txt
---- openjpeg-2.1.1/CMakeLists.txt 2016-07-05 16:54:17.000000000 +0200
-+++ openjpeg-2.1.1-new/CMakeLists.txt 2016-07-06 09:38:26.083029127 +0200
-@@ -270,7 +270,6 @@ if(BUILD_CODEC OR BUILD_MJ2)
+diff -rupN openjpeg-2.3.1/CMakeLists.txt openjpeg-2.3.1-new/CMakeLists.txt
+--- openjpeg-2.3.1/CMakeLists.txt 2019-04-02 14:45:15.000000000 +0200
++++ openjpeg-2.3.1-new/CMakeLists.txt 2019-04-02 16:14:13.688252343 +0200
+@@ -278,7 +278,6 @@ if(BUILD_CODEC OR BUILD_MJ2)
# OFF: It will only build 3rd party libs if they are not found on the system
# ON: 3rd party libs will ALWAYS be build, and used
option(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)