From ed078aa12fa4932bf915886d4c64eae6375d0172 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Thu, 25 Jul 2013 15:12:35 +0200 Subject: logicalfile: add profile registration --- cmake/modules/OpenLMIMacros.cmake | 1 + openlmi-providers.spec | 15 ++++++++++++++- src/logicalfile/90_LMI_LogicalFile_Profile.mof.skel | 20 ++++++++++++++++++++ src/logicalfile/CMakeLists.txt | 4 ++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/logicalfile/90_LMI_LogicalFile_Profile.mof.skel diff --git a/cmake/modules/OpenLMIMacros.cmake b/cmake/modules/OpenLMIMacros.cmake index 18a265e..b61b31c 100644 --- a/cmake/modules/OpenLMIMacros.cmake +++ b/cmake/modules/OpenLMIMacros.cmake @@ -171,6 +171,7 @@ macro(profile_mof_generate SKEL_MOF OUT_MOF CIM_CLASSES) file(READ "${SKEL_MOF}" INSTANCE_SKEL) foreach(CLASS ${CIM_CLASSES}) string(REPLACE "\@CLASS\@" ${CLASS} INSTANCE "${INSTANCE_SKEL}") + string(REPLACE "\@VERSION\@" ${OPENLMI_VERSION} INSTANCE "${INSTANCE_SKEL}") file(APPEND "${OUT_MOF}" "${INSTANCE}") endforeach(CLASS ${CIM_CLASSES}) message(STATUS "Generated profile mof ${OUT_MOF}") diff --git a/openlmi-providers.spec b/openlmi-providers.spec index 9872d2c..9f79668 100644 --- a/openlmi-providers.spec +++ b/openlmi-providers.spec @@ -1,6 +1,6 @@ Name: openlmi-providers Version: 0.0.25 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Set of basic CIM providers License: LGPLv2+ @@ -345,6 +345,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/%{name} %{_libdir}/cmpi/libcmpiLMI_LogicalFile.so %{_datadir}/%{name}/60_LMI_LogicalFile.mof %{_datadir}/%{name}/60_LMI_LogicalFile.reg +%{_datadir}/%{name}/90_LMI_LogicalFile_Profile.mof %attr(755, root, root) %{_libexecdir}/pegasus/cmpiLMI_LogicalFile-cimprovagt %files -n openlmi-realmd @@ -475,6 +476,9 @@ if [ "$1" -gt 1 ]; then %{_datadir}/%{name}/60_LMI_LogicalFile.mof \ %{_datadir}/%{name}/60_LMI_LogicalFile.reg \ > /dev/null 2>&1 || :; + %{_bindir}/openlmi-mof-register --just-mofs -n root/interop unregister \ + %{_datadir}/%{name}/90_LMI_LogicalFile_Profile.mof \ + > /dev/null 2>&1 || :; fi %pre -n openlmi-realmd @@ -560,6 +564,9 @@ if [ "$1" -gt 1 ]; then %{_datadir}/%{name}/60_LMI_LogicalFile.mof \ %{_datadir}/%{name}/60_LMI_LogicalFile.reg \ > /dev/null 2>&1 || :; + %{_bindir}/openlmi-mof-register --just-mofs -n root/interop register \ + %{_datadir}/%{name}/90_LMI_LogicalFile_Profile.mof \ + > /dev/null 2>&1 || :; fi %post -n openlmi-realmd @@ -644,6 +651,9 @@ if [ "$1" -gt 1 ]; then %{_datadir}/%{name}/60_LMI_LogicalFile.mof \ %{_datadir}/%{name}/60_LMI_LogicalFile.reg \ > /dev/null 2>&1 || :; + %{_bindir}/openlmi-mof-register --just-mofs -n root/interop unregister \ + %{_datadir}/%{name}/90_LMI_LogicalFile_Profile.mof \ + > /dev/null 2>&1 || :; fi %preun -n openlmi-realmd @@ -672,6 +682,9 @@ if [ "$1" -gt 1 ]; then fi %changelog +* Thu Jul 25 2013 Jan Synáček - 0.0.25-9 +- Add logicalfile profile registration + * Thu Jul 25 2013 Radek Novacek - 0.0.25-8 - Add version to mof/reg registration diff --git a/src/logicalfile/90_LMI_LogicalFile_Profile.mof.skel b/src/logicalfile/90_LMI_LogicalFile_Profile.mof.skel new file mode 100644 index 0000000..4ea42e0 --- /dev/null +++ b/src/logicalfile/90_LMI_LogicalFile_Profile.mof.skel @@ -0,0 +1,20 @@ +instance of PG_ProviderProfileCapabilities +{ + CapabilityID = "@CLASS@"; + + ProviderModuleName = "cmpiLMI_LogicalFile"; + + ProviderName = "@CLASS@"; + + RegisteredProfile = 0; + + OtherRegisteredProfile = "OpenLMI-LogicalFile"; + OtherProfileOrganization = "OpenLMI"; + + ProfileVersion = "@VERSION@"; + + ConformingElements = { + "@CLASS@" + }; +}; + diff --git a/src/logicalfile/CMakeLists.txt b/src/logicalfile/CMakeLists.txt index d770080..3a09a4a 100644 --- a/src/logicalfile/CMakeLists.txt +++ b/src/logicalfile/CMakeLists.txt @@ -35,5 +35,9 @@ target_link_libraries(${LIBRARY_NAME} openlmicommon # Create registration file cim_registration(${PROVIDER_NAME} ${LIBRARY_NAME} ${MOF} share/openlmi-providers) +set(TARGET_MOF "${CMAKE_BINARY_DIR}/mof/90_LMI_LogicalFile_Profile.mof") +profile_mof_generate("90_LMI_LogicalFile_Profile.mof.skel" "${TARGET_MOF}" "${CIM_CLASSES}") + install(TARGETS ${LIBRARY_NAME} DESTINATION lib${LIB_SUFFIX}/cmpi) install(PROGRAMS ${CIMPROVAGT_SCRIPT} DESTINATION libexec/pegasus) +install(FILES ${TARGET_MOF} DESTINATION share/openlmi-providers/) -- cgit