From 67748c83bc0805d2fa136aa1472aa34e80a741d3 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 24 Feb 2022 11:13:44 +0100 Subject: [PATCH] Add mingw subpackages --- libgeotiff.spec | 177 ++++++++++++++++++++++++++++++++++------- libgeotiff_cmake.patch | 67 ++++++++++++++++ 2 files changed, 217 insertions(+), 27 deletions(-) create mode 100644 libgeotiff_cmake.patch diff --git a/libgeotiff.spec b/libgeotiff.spec index 08ab8f2..adb088c 100644 --- a/libgeotiff.spec +++ b/libgeotiff.spec @@ -1,13 +1,39 @@ -Name: libgeotiff -Version: 1.7.0 -Release: 3%{?dist} -Summary: GeoTIFF format library -License: MIT -URL: http://trac.osgeo.org/geotiff/ -Source: http://download.osgeo.org/geotiff/%{name}/%{name}-%{version}.tar.gz -BuildRequires: gcc-c++ -BuildRequires: libtiff-devel libjpeg-devel proj-devel >= 6.2.0 zlib-devel -BuildRequires: make +Name: libgeotiff +Version: 1.7.0 +Release: 5%{?dist} + +Summary: GeoTIFF format library +License: MIT +URL: http://trac.osgeo.org/geotiff/ +Source: http://download.osgeo.org/geotiff/%{name}/%{name}-%{version}.tar.gz +# Honour LIB_SUFFIX +# Honour GEOTIFF_INCLUDE_SUBDIR +# Add version suffix to mingw library +# Fix cmake module install dir +# Don't install docs +Patch0: libgeotiff_cmake.patch + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: libtiff-devel +BuildRequires: libjpeg-devel +BuildRequires: proj-devel +BuildRequires: zlib-devel + +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-libtiff +BuildRequires: mingw32-libjpeg +BuildRequires: mingw32-proj +BuildRequires: mingw32-zlib + +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw64-gcc +BuildRequires: mingw64-libtiff +BuildRequires: mingw64-libjpeg +BuildRequires: mingw64-proj +BuildRequires: mingw64-zlib + %description GeoTIFF represents an effort by over 160 different remote sensing, @@ -23,28 +49,63 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The GeoTIFF library provides support for development of geotiff image format. + +%package -n mingw32-%{name} +Summary: MinGW Windows %{name} library +Obsoletes: mingw32-%{name}-static + +%description -n mingw32-%{name} +%{summary}. + + +%package -n mingw32-%{name}-tools +Summary: Tools for the MinGW Windows %{name} library +Requires: mingw32-%{name} = %{version}-%{release} + +%description -n mingw32-%{name}-tools +%{summary}. + + +%package -n mingw64-%{name} +Summary: MinGW Windows %{name} library +Obsoletes: mingw64-%{name}-static +%description -n mingw64-%{name} +%{summary}. + + +%package -n mingw64-%{name}-tools +Summary: Tools for the MinGW Windows %{name} library +Requires: mingw64-%{name} = %{version}-%{release} + +%description -n mingw64-%{name}-tools +%{summary}. + + +%{?mingw_debug_package} + + %prep -%setup -q +%autosetup -p1 -n %{name}-%{version} + %build -%configure \ - --prefix=%{_prefix} \ - --includedir=%{_includedir}/%{name}/ \ - --with-proj \ - --with-jpeg \ - --with-zip \ - --disable-static +# Native build +%cmake -DGEOTIFF_BIN_SUBDIR=bin -DGEOTIFF_INCLUDE_SUBDIR=include/%{name} +%cmake_build -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +# MinGW build +%mingw_cmake -DGEOTIFF_BIN_SUBDIR=bin -DGEOTIFF_INCLUDE_SUBDIR=include/%{name} +%mingw_make_build -%make_build %{?_smp_mflags} %install -%{__make} install DESTDIR=%{buildroot} INSTALL="install -p" +%cmake_install +%mingw_make_install + # install pkgconfig file -cat > %{name}.pc < %{buildroot}%{_libdir}/pkgconfig/%{name}.pc < %{buildroot}%{mingw32_libdir}/pkgconfig/%{name}.pc < %{buildroot}%{mingw64_libdir}/pkgconfig/%{name}.pc < - 1.7.0-5 +- Add mingw subpackage + * Thu Jan 20 2022 Fedora Release Engineering - 1.7.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/libgeotiff_cmake.patch b/libgeotiff_cmake.patch new file mode 100644 index 0000000..2ccc9de --- /dev/null +++ b/libgeotiff_cmake.patch @@ -0,0 +1,67 @@ +diff -rupN libgeotiff-1.7.0/cmake/CMakeLists.txt libgeotiff-1.7.0-new/cmake/CMakeLists.txt +--- libgeotiff-1.7.0/cmake/CMakeLists.txt 2021-03-06 18:47:06.000000000 +0100 ++++ libgeotiff-1.7.0-new/cmake/CMakeLists.txt 2022-02-20 01:14:12.921648760 +0100 +@@ -6,13 +6,8 @@ + # ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative + # path to the root from there. (Note that the whole install tree can + # be relocated.) +-if (NOT WIN32) +- set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") +- set (PROJECT_ROOT_DIR "../../..") +-else () +- set (INSTALL_CMAKE_DIR "cmake") +- set (PROJECT_ROOT_DIR "..") +-endif () ++set (INSTALL_CMAKE_DIR "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}") ++set (PROJECT_ROOT_DIR "../../..") + + configure_file (project-config.cmake.in project-config.cmake @ONLY) + configure_file (project-config-version.cmake.in +diff -rupN libgeotiff-1.7.0/CMakeLists.txt libgeotiff-1.7.0-new/CMakeLists.txt +--- libgeotiff-1.7.0/CMakeLists.txt 2021-06-30 10:51:17.000000000 +0200 ++++ libgeotiff-1.7.0-new/CMakeLists.txt 2022-02-20 01:12:42.518986798 +0100 +@@ -285,9 +285,9 @@ SET(GEOTIFF_INCLUDE_DIR ${GEOTIFF_INCLUD + SET(GEOTIFF_DATA_DIR ${GEOTIFF_DATA_SUBDIR}) + + # Install doc files +-INSTALL(FILES +- AUTHORS ChangeLog COPYING INSTALL LICENSE README README_BIN README.WIN +- DESTINATION doc) ++#INSTALL(FILES ++ #AUTHORS ChangeLog COPYING INSTALL LICENSE README README_BIN README.WIN ++ #DESTINATION doc) + # DESTINATION ${GEOTIFF_DATA_DIR}/doc) + + # Install man pages +@@ -295,8 +295,8 @@ INSTALL(FILES ${GEOTIFF_MAN_PAGES} DESTI + + + # Install header files for development distribution +-# INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${GEOTIFF_INCLUDE_DIR}) +-INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include) ++INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${GEOTIFF_INCLUDE_DIR}) ++#INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include) + + ############################################################################### + # Build libxtiff library +@@ -358,6 +358,9 @@ ELSE(UNIX) + SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES + OUTPUT_NAME ${GEOTIFF_LIB_NAME}) + ENDIF(UNIX) ++IF(MINGW) ++ SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES SUFFIX "-${LINK_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ENDIF(MINGW) + + SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES + OUTPUT_NAME ${GEOTIFF_LIB_NAME}) +@@ -376,8 +379,8 @@ TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_ + INSTALL( TARGETS ${GEOTIFF_LIBRARY_TARGET} + EXPORT depends + RUNTIME DESTINATION bin +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib ) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} ) + + # Define grouping of source files in PROJECT file (e.g. Visual Studio) + SOURCE_GROUP("CMake Files" FILES CMakeLists.txt)