From 2a820f473a2af688aaa6425b325efea68c356c4a Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mon, 25 Dec 2017 15:28:00 +0100 Subject: [PATCH] Rename tool names at cmake level to ensure OpenJPEGTargets.cmake refers to the renamed files --- openjpeg2.spec | 13 ++++++++----- openjpeg2_opj2.patch | 12 ++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 openjpeg2_opj2.patch diff --git a/openjpeg2.spec b/openjpeg2.spec index 250c686..b01c812 100644 --- a/openjpeg2.spec +++ b/openjpeg2.spec @@ -5,7 +5,7 @@ Name: openjpeg2 Version: 2.3.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: C-Library for JPEG 2000 # windirent.h is MIT, the rest is BSD @@ -21,6 +21,8 @@ Source1: data.tar.xz Patch0: openjpeg2_remove-thirdparty.patch # Fix shared libraries not getting installed if static libraries are disabled Patch1: openjpeg2_install.patch +# Rename tool names to avoid conflicts with openjpeg-1.x +Patch2: openjpeg2_opj2.patch BuildRequires: cmake BuildRequires: zlib-devel @@ -48,6 +50,8 @@ This package contains %package devel Summary: Development files for OpenJPEG 2 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 @@ -221,10 +225,6 @@ popd %install %make_install -C %{_target_platform} -# 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 @@ -327,6 +327,9 @@ make test -C %{_target_platform} %changelog +* Mon Dec 25 2017 Sandro Mani - 2.3.0-3 +- Rename tool names at cmake level to ensure OpenJPEGTargets.cmake refers to the renamed files + * Mon Dec 25 2017 Sandro Mani - 2.3.0-2 - Use BUILD_STATIC_LIBS=OFF instead of deleting the static library after build diff --git a/openjpeg2_opj2.patch b/openjpeg2_opj2.patch new file mode 100644 index 0000000..ff60009 --- /dev/null +++ b/openjpeg2_opj2.patch @@ -0,0 +1,12 @@ +diff -rupN openjpeg-2.3.0/src/bin/jp2/CMakeLists.txt openjpeg-2.3.0-new/src/bin/jp2/CMakeLists.txt +--- openjpeg-2.3.0/src/bin/jp2/CMakeLists.txt 2017-10-05 00:23:14.000000000 +0200 ++++ openjpeg-2.3.0-new/src/bin/jp2/CMakeLists.txt 2017-12-25 14:55:37.562470567 +0100 +@@ -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(${CMAKE_VERSION} VERSION_GREATER "2.8.11") + target_compile_options(${exe} PRIVATE ${OPENJP2_COMPILE_OPTIONS}) + endif()