[packages/hdf5] - added cmake patch, package cmake support files for hdf5-based packages using cmake as build system
qboosh
qboosh at pld-linux.org
Tue Apr 2 20:28:24 CEST 2013
commit 30149e0c0f3be9a6bb50aa2ff6830021eefe3cd7
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Apr 2 20:28:19 2013 +0200
- added cmake patch, package cmake support files for hdf5-based packages using cmake as build system
- release 2
hdf5-cmake.patch | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
hdf5.spec | 45 +++++++++++++++++++--
2 files changed, 162 insertions(+), 4 deletions(-)
---
diff --git a/hdf5.spec b/hdf5.spec
index f451fc9..d68094a 100644
--- a/hdf5.spec
+++ b/hdf5.spec
@@ -10,14 +10,15 @@ Summary: Hierarchical Data Format 5 library
Summary(pl.UTF-8): Biblioteka HDF5 (Hierarchical Data Format 5)
Name: hdf5
Version: 1.8.10
-Release: 1
+Release: 2
License: Nearly BSD, but changed sources must be marked
Group: Libraries
-Source0: ftp://ftp.hdfgroup.org/HDF5/current/src/%{name}-%{version}.tar.bz2
-# Source0-md5: 8166c0fa3ee34fee6cdef4c5f3cbc94e
+Source0: ftp://ftp.hdfgroup.org/HDF5/current/src/%{name}-%{version}-patch1.tar.bz2
+# Source0-md5: 86cd479b7a34abe916e2fec8b7280863
Patch0: %{name}-config.patch
Patch1: %{name}-sig.patch
Patch2: %{name}-link.patch
+Patch3: %{name}-cmake.patch
URL: http://www.hdfgroup.org/HDF5/
BuildRequires: autoconf >= 2.69
BuildRequires: automake >= 1:1.11
@@ -168,10 +169,11 @@ Utilities to convert from/to HDF5 format.
Narzędzia do konwersji z i to formatu HDF5.
%prep
-%setup -q
+%setup -q -n %{name}-%{version}-patch1
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
%{__libtoolize}
@@ -213,6 +215,40 @@ install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/hl
%{__make} -C hl/c++/examples install-examples \
EXAMPLEDIR=$RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/hl/c++
+install -d $RPM_BUILD_ROOT%{_datadir}/cmake/hdf5
+vmajor=$(sed -ne 's/^#define H5_VERS_MAJOR\s*\([0-9]\+\).*/\1/' src/H5public.h)
+vminor=$(sed -ne 's/^#define H5_VERS_MINOR\s*\([0-9]\+\).*/\1/' src/H5public.h)
+vrel=$(sed -ne 's/^#define H5_VERS_RELEASE\s*\([0-9]\+\).*/\1/' src/H5public.h)
+vsubr=$(sed -ne 's/^#define H5_VERS_SUBRELEASE\s*\([0-9]\+\).*/\1/' src/H5public.h)
+for f in FindHDF5.cmake hdf5-config-version.cmake hdf5-config.cmake.install hdf5-targets.cmake hdf5-targets-noconfig.cmake ; do
+ sed -e 's, at HDF5_PACKAGE@,hdf5,' \
+ -e 's, at HDF_PACKAGE_EXT@,,' \
+ -e "s, at HDF5_VERSION_STRING@,%{version}," \
+ -e "s, at HDF5_VERSION_MAJOR@,1.8," \
+ -e "s, at HDF5_VERSION_MINOR@,$vrel," \
+ -e "s, at H5_VERS_MAJOR@,$vmajor," \
+ -e "s, at H5_VERS_MINOR@,$vminor," \
+ -e "s, at H5_VERS_RELEASE@,$vrel," \
+ -e "s, at H5_VERS_SUBRELEASE@,$vsubr," \
+ -e 's, at HDF5_ENABLE_PARALLEL@,OFF,' \
+ -e 's, at HDF5_BUILD_FORTRAN@,ON,' \
+ -e 's, at HDF5_ENABLE_F2003@,%{?with_fortran2003:ON}%{!?with_fortran2003:OFF},' \
+ -e 's, at HDF5_BUILD_CPP_LIB@,ON,' \
+ -e 's, at HDF5_BUILD_TOOLS@,ON,' \
+ -e 's, at HDF5_BUILD_HL_LIB@,ON,' \
+ -e 's, at HDF5_ENABLE_Z_LIB_SUPPORT@,ON,' \
+ -e 's, at HDF5_ENABLE_SZIP_SUPPORT@,%{?with_szip:ON}%{!?with_szip:OFF},' \
+ -e 's, at HDF5_ENABLE_SZIP_ENCODING@,%{?with_szip:ON}%{!?with_szip:OFF},' \
+ -e 's, at BUILD_SHARED_LIBS@,ON,' \
+ -e 's, at HDF5_PACKAGE_EXTLIBS@,OFF,' \
+ -e 's, at ZLIB_PACKAGE_NAME@,zlib,' \
+ -e 's, at SZIP_PACKAGE_NAME@,szip,' \
+ -e 's, at HDF5_LIBRARIES_TO_EXPORT@,hdf5,' \
+ -e "s, at lib@,%{_lib}," \
+ config/cmake/${f}.in > $RPM_BUILD_ROOT%{_datadir}/cmake/hdf5/$f
+done
+mv $RPM_BUILD_ROOT%{_datadir}/cmake/hdf5/hdf5-config.cmake{.install,}
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -283,6 +319,7 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/H5version.h
%{_includedir}/hdf5.h
%{_includedir}/hdf5_hl.h
+%{_datadir}/cmake/hdf5
%dir %{_examplesdir}/%{name}-%{version}
%{_examplesdir}/%{name}-%{version}/run-all-ex.sh
%{_examplesdir}/%{name}-%{version}/c
diff --git a/hdf5-cmake.patch b/hdf5-cmake.patch
new file mode 100644
index 0000000..bc22159
--- /dev/null
+++ b/hdf5-cmake.patch
@@ -0,0 +1,121 @@
+--- hdf5-1.8.10-patch1/config/cmake/hdf5-targets.cmake.in.orig 1970-01-01 01:00:00.000000000 +0100
++++ hdf5-1.8.10-patch1/config/cmake/hdf5-targets.cmake.in 2013-04-02 18:10:51.166052034 +0200
+@@ -0,0 +1,36 @@
++# Generated by CMake 2.8.10.2
++
++IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
++ MESSAGE(FATAL_ERROR "CMake >= 2.6.0 required")
++ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
++CMAKE_POLICY(PUSH)
++CMAKE_POLICY(VERSION 2.6)
++#----------------------------------------------------------------
++# Generated CMake target import file.
++#----------------------------------------------------------------
++
++# Commands may need to know the format version.
++SET(CMAKE_IMPORT_FILE_VERSION 1)
++
++# Create imported target hdf5
++ADD_LIBRARY(hdf5 STATIC IMPORTED)
++
++# Create imported target hdf5_f90cstub
++ADD_LIBRARY(hdf5_f90cstub STATIC IMPORTED)
++
++# Create imported target hdf5_fortran
++ADD_LIBRARY(hdf5_fortran STATIC IMPORTED)
++
++# Create imported target hdf5_cpp
++ADD_LIBRARY(hdf5_cpp STATIC IMPORTED)
++
++# Load information for each installed configuration.
++GET_FILENAME_COMPONENT(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
++FILE(GLOB CONFIG_FILES "${_DIR}/hdf5-targets-*.cmake")
++FOREACH(f ${CONFIG_FILES})
++ INCLUDE(${f})
++ENDFOREACH(f)
++
++# Commands beyond this point should not need to know the version.
++SET(CMAKE_IMPORT_FILE_VERSION)
++CMAKE_POLICY(POP)
+--- hdf5-1.8.10-patch1/config/cmake/hdf5-targets-noconfig.cmake.in.orig 1970-01-01 01:00:00.000000000 +0100
++++ hdf5-1.8.10-patch1/config/cmake/hdf5-targets-noconfig.cmake.in 2013-04-02 18:12:17.399383569 +0200
+@@ -0,0 +1,79 @@
++#----------------------------------------------------------------
++# Generated CMake target import file for configuration "".
++#----------------------------------------------------------------
++
++# Commands may need to know the format version.
++SET(CMAKE_IMPORT_FILE_VERSION 1)
++
++# Compute the installation prefix relative to this file.
++GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
++GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
++GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
++GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
++
++# Make sure the targets which have been exported in some other
++# export set exist.
++
++# Import target "hdf5" for configuration ""
++SET_PROPERTY(TARGET hdf5 APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
++SET_TARGET_PROPERTIES(hdf5 PROPERTIES
++ IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "C"
++ IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "m;sz"
++ IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@lib@/libhdf5.so"
++ )
++
++LIST(APPEND _IMPORT_CHECK_TARGETS hdf5 )
++LIST(APPEND _IMPORT_CHECK_FILES_FOR_hdf5 "${_IMPORT_PREFIX}/@lib@/libhdf5.so" )
++
++# Make sure the targets which have been exported in some other
++# export set exist.
++
++# Import target "hdf5_fortran" for configuration ""
++SET_PROPERTY(TARGET hdf5_fortran APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
++SET_TARGET_PROPERTIES(hdf5_fortran PROPERTIES
++ IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "Fortran"
++ IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "hdf5_f90cstub;hdf5"
++ IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@lib@/libhdf5_fortran.so"
++ )
++
++#LIST(APPEND _IMPORT_CHECK_TARGETS hdf5_fortran )
++LIST(APPEND _IMPORT_CHECK_FILES_FOR_hdf5_fortran "${_IMPORT_PREFIX}/@lib@/libhdf5_fortran.so" )
++
++# Make sure the targets which have been exported in some other
++# export set exist.
++
++# Import target "hdf5_cpp" for configuration ""
++SET_PROPERTY(TARGET hdf5_cpp APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
++SET_TARGET_PROPERTIES(hdf5_cpp PROPERTIES
++ IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX"
++ IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "hdf5"
++ IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@lib@/libhdf5_cpp.so"
++ )
++
++#LIST(APPEND _IMPORT_CHECK_TARGETS hdf5_cpp )
++LIST(APPEND _IMPORT_CHECK_FILES_FOR_hdf5_cpp "${_IMPORT_PREFIX}/@lib@/libhdf5_cpp.so" )
++
++# Loop over all imported files and verify that they actually exist
++FOREACH(target ${_IMPORT_CHECK_TARGETS} )
++ FOREACH(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
++ IF(NOT EXISTS "${file}" )
++ MESSAGE(FATAL_ERROR "The imported target \"${target}\" references the file
++ \"${file}\"
++but this file does not exist. Possible reasons include:
++* The file was deleted, renamed, or moved to another location.
++* An install or uninstall procedure did not complete successfully.
++* The installation package was faulty and contained
++ \"${CMAKE_CURRENT_LIST_FILE}\"
++but not all the files it references.
++")
++ ENDIF()
++ ENDFOREACH()
++ UNSET(_IMPORT_CHECK_FILES_FOR_${target})
++ENDFOREACH()
++UNSET(_IMPORT_CHECK_TARGETS)
++
++# Cleanup temporary variables.
++SET(_IMPORT_PREFIX)
++
++# Commands beyond this point should not need to know the version.
++SET(CMAKE_IMPORT_FILE_VERSION)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/hdf5.git/commitdiff/30149e0c0f3be9a6bb50aa2ff6830021eefe3cd7
More information about the pld-cvs-commit
mailing list