diff --git a/.gitignore b/.gitignore index debce49..563c92f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -/v1.0.tar.gz -/aces_container-1.0.2.tar.gz +aces_container-*.tar.gz diff --git a/Aces_container-fixup.patch b/Aces_container-fixup.patch deleted file mode 100644 index e33f77a..0000000 --- a/Aces_container-fixup.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff -up aces_container-1.0/CMakeLists.txt.fixup aces_container-1.0/CMakeLists.txt ---- aces_container-1.0/CMakeLists.txt.fixup 2013-07-27 01:07:55.000000000 +0200 -+++ aces_container-1.0/CMakeLists.txt 2014-07-29 16:14:03.818875063 +0200 -@@ -58,7 +58,7 @@ set( INSTALL_INCLUDE_DIR include CACHE P - if( WIN32 AND NOT CYGWIN ) - set(DEF_INSTALL_CMAKE_DIR CMake) - else() -- set(DEF_INSTALL_CMAKE_DIR lib/CMake/AcesContainer) -+ set(DEF_INSTALL_CMAKE_DIR lib${LIB_SUFFIX}/CMake/AcesContainer) - endif() - set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Install directory for project CMake files" ) - -@@ -82,7 +82,13 @@ add_library( AcesContainer SHARED - aces_md5.cc - ) - --install (TARGETS AcesContainer EXPORT AcesContainerTargets DESTINATION ${INSTALL_LIB_DIR}) -+# Set the build version (VERSION) and the API version (SOVERSION) -+SET_TARGET_PROPERTIES(AcesContainer -+ PROPERTIES -+ VERSION ${AcesContainer_VERSION} -+ SOVERSION ${AcesContainer_MAJOR_VERSION}) -+ -+install (TARGETS AcesContainer EXPORT AcesContainerTargets DESTINATION ${LIB_INSTALL_DIR}) - install (FILES - aces_errors.h - aces_genericWriter.h -@@ -97,14 +103,14 @@ install (FILES - aces_types.h - aces_writeattributes.h - DESTINATION -- ${INSTALL_INCLUDE_DIR}/aces -+ ${INCLUDE_INSTALL_DIR}/aces - ) - - - find_package( PkgConfig ) - if ( PKG_CONFIG_FOUND ) - configure_file(config/AcesContainer.pc.in "${PROJECT_BINARY_DIR}/AcesContainer.pc" @ONLY) --install( FILES "${PROJECT_BINARY_DIR}/AcesContainer.pc" DESTINATION lib/pkgconfig COMPONENT dev ) -+install( FILES "${PROJECT_BINARY_DIR}/AcesContainer.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT dev ) - endif() - - include_directories( -diff -up aces_container-1.0/config/AcesContainerConfig.cmake.in.fixup aces_container-1.0/config/AcesContainerConfig.cmake.in ---- aces_container-1.0/config/AcesContainerConfig.cmake.in.fixup 2013-07-27 01:07:55.000000000 +0200 -+++ aces_container-1.0/config/AcesContainerConfig.cmake.in 2014-07-29 16:17:38.264924248 +0200 -@@ -53,10 +53,10 @@ - # find paths - get_filename_component( AcesContainer_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH ) - --set(AcesContainer_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") -+set(AcesContainer_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@/aces") - - set(AcesContainer_LIBRARIES AcesContainer ) --set(AcesContainer_LIBRARY_DIRS "@CONF_LIB_DIRS@" ) -+set(AcesContainer_LIBRARY_DIRS "@LIB_INSTALL_DIR@" ) - set(AcesContainer_VERSION "@AcesContainer_VERSION@" ) - - set(AcesContainer_FOUND 1 ) -diff -up aces_container-1.0/config/AcesContainerConfigVersion.cmake.in.fixup aces_container-1.0/config/AcesContainerConfigVersion.cmake.in -diff -up aces_container-1.0/config/AcesContainer.pc.in.fixup aces_container-1.0/config/AcesContainer.pc.in ---- aces_container-1.0/config/AcesContainer.pc.in.fixup 2013-07-27 01:07:55.000000000 +0200 -+++ aces_container-1.0/config/AcesContainer.pc.in 2014-07-29 16:14:03.820875036 +0200 -@@ -45,7 +45,7 @@ - # A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED. - - prefix=@CMAKE_INSTALL_PREFIX@ --libdir=@INSTALL_LIB_DIR@ -+libdir=@LIB_INSTALL_DIR@ - includedir=@INSTALL_INCLUDE_DIR@ - AcesContainer_includedir=@INSTALL_INCLUDE_DIR@/aces - diff --git a/Set-the-appropriate-SONAME-for-the-library.patch b/Set-the-appropriate-SONAME-for-the-library.patch new file mode 100644 index 0000000..9f5f0c6 --- /dev/null +++ b/Set-the-appropriate-SONAME-for-the-library.patch @@ -0,0 +1,30 @@ +From 96683a250492efcc7059c8c234859ce4a89910b7 Mon Sep 17 00:00:00 2001 +From: Nicolas Chauvet +Date: Wed, 18 Jul 2018 11:16:29 +0200 +Subject: [PATCH 2/2] Set the appropriate SONAME for the library + +Signed-off-by: Nicolas Chauvet +--- + CMakeLists.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f5fa059..02f1631 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,6 +88,12 @@ GENERATE_EXPORT_HEADER( AcesContainer + STATIC_DEFINE AcesContainer_BUILT_AS_STATIC + ) + ++# Set the build version (VERSION) and the API version (SOVERSION) ++set_target_properties(AcesContainer ++ PROPERTIES ++ VERSION ${AcesContainer_VERSION} ++ SOVERSION ${AcesContainer_MAJOR_VERSION}) ++ + install (TARGETS AcesContainer EXPORT AcesContainerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install (FILES + aces_errors.h +-- +2.17.1 + diff --git a/Switch-to-CMAKE-default-variables.patch b/Switch-to-CMAKE-default-variables.patch new file mode 100644 index 0000000..242d6b2 --- /dev/null +++ b/Switch-to-CMAKE-default-variables.patch @@ -0,0 +1,140 @@ +From 3d759d35c5cbc393d1848b0476fe6bccb1866ae5 Mon Sep 17 00:00:00 2001 +From: Nicolas Chauvet +Date: Wed, 18 Jul 2018 11:08:04 +0200 +Subject: [PATCH 1/2] Switch to CMAKE default variables + +Signed-off-by: Nicolas Chauvet +--- + CMakeLists.txt | 31 ++++++----------------------- + config/AcesContainer.pc.in | 6 +++--- + config/AcesContainerConfig.cmake.in | 4 ++-- + 3 files changed, 11 insertions(+), 30 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 314d42c..f5fa059 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,35 +48,20 @@ cmake_minimum_required (VERSION 2.6) + project (AcesContainer) + + include (GenerateExportHeader) ++include (GNUInstallDirs) + + set( AcesContainer_MAJOR_VERSION 1 ) + set( AcesContainer_MINOR_VERSION 0 ) + set( AcesContainer_PATCH_VERSION 2 ) + set( AcesContainer_VERSION ${AcesContainer_MAJOR_VERSION}.${AcesContainer_MINOR_VERSION}.${AcesContainer_PATCH_VERSION} ) + +-set( INSTALL_LIB_DIR lib CACHE PATH "Install directory for libraries" ) +-set( INSTALL_INCLUDE_DIR include CACHE PATH "Install directory for public header files" ) +- +- + if(APPLE) + set( CMAKE_MACOSX_RPATH 1 ) + endif() + + if( WIN32 AND NOT CYGWIN ) +- set(DEF_INSTALL_CMAKE_DIR CMake) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0" ) +-else() +- set(DEF_INSTALL_CMAKE_DIR lib/CMake/AcesContainer) + endif() +-set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Install directory for project CMake files" ) +- +-## convert install paths to absolute +-foreach( p LIB INCLUDE CMAKE ) +- set( var INSTALL_${p}_DIR ) +- if( NOT IS_ABSOLUTE "${${var}}" ) +- set( ${var} "${CMAKE_INSTALL_PREFIX}/${${var}}" ) +- endif() +-endforeach() + + OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) + IF ( BUILD_SHARED_LIBS ) +@@ -103,7 +88,7 @@ GENERATE_EXPORT_HEADER( AcesContainer + STATIC_DEFINE AcesContainer_BUILT_AS_STATIC + ) + +-install (TARGETS AcesContainer EXPORT AcesContainerTargets DESTINATION ${INSTALL_LIB_DIR}) ++install (TARGETS AcesContainer EXPORT AcesContainerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install (FILES + aces_errors.h + aces_genericWriter.h +@@ -118,14 +103,14 @@ install (FILES + aces_types.h + aces_writeattributes.h + DESTINATION +- ${INSTALL_INCLUDE_DIR}/aces ++ ${CMAKE_INSTALL_INCLUDEDIR}/aces + ) + + + find_package( PkgConfig ) + if ( PKG_CONFIG_FOUND ) + configure_file(config/AcesContainer.pc.in "${PROJECT_BINARY_DIR}/AcesContainer.pc" @ONLY) +-install( FILES "${PROJECT_BINARY_DIR}/AcesContainer.pc" DESTINATION lib/pkgconfig COMPONENT dev ) ++install( FILES "${PROJECT_BINARY_DIR}/AcesContainer.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT dev ) + endif() + + include_directories( +@@ -143,10 +128,6 @@ export(TARGETS AcesContainer + export(PACKAGE AcesContainer) + # export(PACKAGE AcesContainer_lib) + +-# Create the FooBarConfig.cmake and FooBarConfigVersion files +-file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" +- "${INSTALL_INCLUDE_DIR}") +- + # ... for the build tree + set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}") + set(CONF_LIB_DIRS "${PROJECT_BINARY_DIR}") +@@ -166,10 +147,10 @@ configure_file(config/AcesContainerConfigVersion.cmake.in + install(FILES + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/AcesContainerConfig.cmake" + "${PROJECT_BINARY_DIR}/AcesContainerConfigVersion.cmake" +- DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev) ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake" COMPONENT dev) + + # Install the export set for use with the install-tree + install(EXPORT AcesContainerTargets DESTINATION +- "${INSTALL_CMAKE_DIR}" COMPONENT dev) ++ "${CMAKE_INSTALL_LIBDIR}/cmake" COMPONENT dev) + + +diff --git a/config/AcesContainer.pc.in b/config/AcesContainer.pc.in +index 838a1d9..a186346 100644 +--- a/config/AcesContainer.pc.in ++++ b/config/AcesContainer.pc.in +@@ -45,9 +45,9 @@ + # A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED. + + prefix=@CMAKE_INSTALL_PREFIX@ +-libdir=@INSTALL_LIB_DIR@ +-includedir=@INSTALL_INCLUDE_DIR@ +-AcesContainer_includedir=@INSTALL_INCLUDE_DIR@/aces ++libdir=@CMAKE_INSTALL_LIBDIR@ ++includedir=@CMAKE_INSTALL_INCLUDEDIR@ ++AcesContainer_includedir=@CMAKE_INSTALL_INCLUDEDIR@/aces + + Name: AcesContainer + Description: A library containing an implementation of ACES Image Container File +diff --git a/config/AcesContainerConfig.cmake.in b/config/AcesContainerConfig.cmake.in +index f5e6392..c35e145 100644 +--- a/config/AcesContainerConfig.cmake.in ++++ b/config/AcesContainerConfig.cmake.in +@@ -53,10 +53,10 @@ + # find paths + get_filename_component( AcesContainer_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH ) + +-set(AcesContainer_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") ++set(AcesContainer_INCLUDE_DIRS "@CMAKE_INSTALL_INCLUDEDIR@") + + set(AcesContainer_LIBRARIES AcesContainer ) +-set(AcesContainer_LIBRARY_DIRS "@CONF_LIB_DIRS@" ) ++set(AcesContainer_LIBRARY_DIRS "@CMAKE_INSTALL_LIBDIR@" ) + set(AcesContainer_VERSION "@AcesContainer_VERSION@" ) + + set(AcesContainer_FOUND 1 ) +-- +2.17.1 + diff --git a/aces_container.spec b/aces_container.spec index f363e5d..f5ede74 100644 --- a/aces_container.spec +++ b/aces_container.spec @@ -6,7 +6,8 @@ Summary: ACES Container Reference License: AMPAS BSD URL: https://github.com/ampas/aces_container Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch0: Aces_container-fixup.patch +Patch0: Switch-to-CMAKE-default-variables.patch +Patch1: Set-the-appropriate-SONAME-for-the-library.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -28,7 +29,7 @@ not demonstrated by this reference implementation. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: cmake +Requires: cmake-filesystem %description devel The %{name}-devel package contains libraries and header files for @@ -37,8 +38,8 @@ developing applications that use %{name}. %prep -%setup -q -%patch0 -p1 -b .fixup +%autosetup -p1 +chmod -x aces_writeattributes.* %build @@ -54,13 +55,9 @@ cd build %make_install -# remote noinstall style cmake file -rm %{buildroot}/%{_libdir}/CMake/AcesContainer/AcesContainerTargets-noconfig.cmake - %ldconfig_scriptlets - %files %doc README.md %license LICENSE @@ -69,8 +66,7 @@ rm %{buildroot}/%{_libdir}/CMake/AcesContainer/AcesContainerTargets-noconfig.cma %files devel %dir %{_includedir}/aces/ %{_includedir}/aces/*.h -%dir %{_libdir}/CMake/AcesContainer -%{_libdir}/CMake/AcesContainer/*.cmake +%{_libdir}/cmake/*.cmake %{_libdir}/libAcesContainer.so %{_libdir}/pkgconfig/AcesContainer.pc