[Packaging] RPM generation (#12810)

* Initial

* packaging: Fixed syntax

rpm.cmake: downgraded PYOPENVINO version to 3.6 as default

* install_build_dependencies: Added rpm-build

rpm.cmake: Removed SHLIBDEPS settings for RPMs creation. Replaced CPACK_RPM_PACKAGE_HOMEPAGE with CPACK_RPM_PACKAGE_URL. Set CPACK_RPM_PACKAGE_AUTOREQPROV to ON.

* rpm_post_build.cmake: Fixed warning if rpmlint not installed

rpm.cmake: Removed SHLIBDEPS usage.

* rpm.cmake: Updated comments

* Fixed naming

* developer_package/rpm.cmake: Fixed ov_rpm_add_latest_component macro with using lower case for CPACK_COMPONENT_XXX_DEPENDS set.
This commit is contained in:
Artyom Anokhov 2022-09-19 22:16:07 +02:00 committed by GitHub
parent b7d183e6e6
commit f8f82574ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 607 additions and 0 deletions

View File

@ -118,6 +118,10 @@ if(CPACK_GENERATOR STREQUAL "DEB")
include(packaging/debian)
endif()
if(CPACK_GENERATOR STREQUAL "RPM")
include(packaging/rpm)
endif()
if(CPACK_GENERATOR STREQUAL "NSIS")
include(packaging/nsis)
endif()

View File

@ -0,0 +1,253 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
include(GNUInstallDirs)
#
# ov_rpm_cpack_set_dirs()
#
# Set directories for cpack
#
macro(ov_rpm_cpack_set_dirs)
# override default locations for RPM
set(OV_CPACK_TOOLSDIR ${CMAKE_INSTALL_BINDIR}) # only C++ tools are here
set(OV_CPACK_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
set(OV_CPACK_LIBRARYDIR ${CMAKE_INSTALL_LIBDIR})
set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_LIBDIR})
set(OV_CPACK_ARCHIVEDIR ${CMAKE_INSTALL_LIBDIR})
set(OV_CPACK_PLUGINSDIR ${CMAKE_INSTALL_LIBDIR}/openvino-${OpenVINO_VERSION})
set(OV_CPACK_IE_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/inferenceengine${OpenVINO_VERSION})
set(OV_CPACK_NGRAPH_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph${OpenVINO_VERSION})
set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION})
set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION})
# non-native stuff
set(OV_CPACK_PYTHONDIR ${OV_CPACK_PLUGINSDIR})
set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino-${OpenVINO_VERSION}) # internal
set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples)
set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR})
unset(OV_CPACK_SHAREDIR)
# skipped during rpm packaging
set(OV_CPACK_WHEELSDIR "tools")
# for BW compatibility
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR})
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})
endmacro()
ov_rpm_cpack_set_dirs()
#
# Override CPack components name for RPM generator
# This is needed to change the granularity, i.e. merge several components
# into a single one
#
macro(ov_override_component_names)
# merge C++ and C runtimes
set(OV_CPACK_COMP_CORE_C "${OV_CPACK_COMP_CORE}")
set(OV_CPACK_COMP_CORE_C_DEV "${OV_CPACK_COMP_CORE_DEV}")
# merge all pythons into a single component
set(OV_CPACK_COMP_PYTHON_OPENVINO "pyopenvino")
set(OV_CPACK_COMP_PYTHON_IE_API "${OV_CPACK_COMP_PYTHON_OPENVINO}")
set(OV_CPACK_COMP_PYTHON_NGRAPH "${OV_CPACK_COMP_PYTHON_OPENVINO}")
# merge all C / C++ samples as a single samples component
set(OV_CPACK_COMP_CPP_SAMPLES "samples")
set(OV_CPACK_COMP_C_SAMPLES "${OV_CPACK_COMP_CPP_SAMPLES}")
# set(OV_CPACK_COMP_PYTHON_SAMPLES "${OV_CPACK_COMP_CPP_SAMPLES}")
# move requirements.txt to core-dev
set(OV_CPACK_COMP_DEV_REQ_FILES "${OV_CPACK_COMP_CORE_DEV}")
# move core_tools to core-dev
set(OV_CPACK_COMP_CORE_TOOLS "${OV_CPACK_COMP_CORE_DEV}")
endmacro()
ov_override_component_names()
#
# Common RPM specific settings
#
macro(ov_rpm_specific_settings)
# multiple packages are generated
set(CPACK_RPM_COMPONENT_INSTALL ON)
# automatically find dependencies for binaries
set(CPACK_RPM_PACKAGE_AUTOREQPROV ON)
# enable dependencies between components
set(CPACK_RPM_ENABLE_COMPONENT_DEPENDS ON)
# homepage
set(CPACK_RPM_PACKAGE_URL "https://docs.openvino.ai/")
# enable for debug cpack run
if(NOT DEFINED CPACK_RPM_PACKAGE_DEBUG)
set(CPACK_RPM_PACKAGE_DEBUG OFF)
endif()
# naming convention for rpm package files
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
# need to update this version once we rebuild the same package with additional fixes
# set(CPACK_RPM_PACKAGE_RELEASE "1")
# enable this if someday we change the version scheme
# set(CPACK_RPM_PACKAGE_EPOCH "2")
endmacro()
ov_rpm_specific_settings()
# needed to override cmake auto generated files
set(def_postinst "${OpenVINO_BINARY_DIR}/_CPack_Packages/postinst")
set(def_postrm "${OpenVINO_BINARY_DIR}/_CPack_Packages/postrm")
set(def_triggers "${OpenVINO_BINARY_DIR}/_CPack_Packages/triggers")
set(triggers_content "activate-noawait ldconfig\n\n")
set(post_content "#!/bin/sh\n\nset -e;\nset -e\n\n")
file(REMOVE ${def_postinst} ${def_postrm} ${def_triggers})
file(WRITE "${def_postinst}" "${post_content}")
file(WRITE "${def_postrm}" "${post_content}")
file(WRITE "${def_triggers}" "${triggers_content}")
#
# Functions helpful for packaging your modules with RPM cpack
#
#
# ov_rpm_add_changelog_and_copyright(<comp name>)
#
function(ov_rpm_add_changelog_and_copyright comp)
string(TOUPPER "${comp}" ucomp)
if(NOT DEFINED CPACK_RPM_${ucomp}_PACKAGE_NAME)
message(FATAL_ERROR "CPACK_RPM_${ucomp}_PACKAGE_NAME is not defined")
else()
set(package_name "${CPACK_RPM_${ucomp}_PACKAGE_NAME}")
endif()
set(package_name "${CPACK_RPM_${ucomp}_PACKAGE_NAME}")
# copyright
install(FILES "${OpenVINO_SOURCE_DIR}/cmake/developer_package/packaging/copyright"
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/${package_name}/
COMPONENT ${comp})
# create changelog.gz
find_host_program(gzip_PROGRAM NAMES gzip DOC "Path to gzip tool")
if(NOT gzip_PROGRAM)
message(FATAL_ERROR "Failed to find gzip tool")
endif()
set(changelog_src "${OpenVINO_SOURCE_DIR}/cmake/developer_package/packaging/changelog")
set(package_bin_dir "${OpenVINO_BINARY_DIR}/_CPack_Packages/${package_name}")
set(changelog_output "${package_bin_dir}/changelog")
file(REMOVE "${changelog_output}")
file(REMOVE "${changelog_output}.gz")
file(MAKE_DIRECTORY "${package_bin_dir}")
configure_file("${changelog_src}" "${changelog_output}" COPYONLY)
execute_process(COMMAND gzip -n -9 "${changelog_output}"
WORKING_DIRECTORY "${package_bin_dir}"
OUTPUT_VARIABLE output_message
ERROR_VARIABLE error_message
RESULT_VARIABLE exit_code
OUTPUT_STRIP_TRAILING_WHITESPACE)
# install changelog.gz
install(FILES "${changelog_output}.gz"
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/${package_name}/
COMPONENT ${comp})
endfunction()
#
# ov_rpm_add_rpmlint_suppression(<comp name> <suppression1, suppression2, ...>)
#
function(ov_rpm_add_rpmlint_suppression comp)
set(lines ${ARGN})
string(TOUPPER "${comp}" ucomp)
if(NOT DEFINED CPACK_RPM_${ucomp}_PACKAGE_NAME)
message(FATAL_ERROR "CPACK_RPM_${ucomp}_PACKAGE_NAME is not defined")
else()
set(package_name "${CPACK_RPM_${ucomp}_PACKAGE_NAME}")
endif()
foreach(line IN LISTS lines)
set(line "${package_name} binary: ${line}")
if(content)
set(content "${content}\n${line}")
else()
set(content "${line}")
endif()
endforeach()
set(rpmlint_override_file "${OpenVINO_BINARY_DIR}/_CPack_Packages/rpmlint/${package_name}")
file(REMOVE ${rpmlint_override_file})
file(WRITE ${rpmlint_override_file} ${content})
install(FILES ${rpmlint_override_file}
DESTINATION ${CMAKE_INSTALL_DATADIR}/rpmlint/overrides/
COMPONENT ${comp})
endfunction()
#
# ov_rpm_generate_conflicts(<comp name>)
#
function(ov_rpm_generate_conflicts comp)
set(cpack_name_versions ${ARGN})
string(TOUPPER "${comp}" ucomp)
# sanity check
if(NOT DEFINED CPACK_RPM_${ucomp}_PACKAGE_NAME)
message(FATAL_ERROR "CPACK_RPM_${ucomp}_PACKAGE_NAME is not defined")
else()
if(NOT DEFINED cpack_name_ver)
message(FATAL_ERROR "Internal variable 'cpack_name_ver' is not defined")
endif()
string(REPLACE "${cpack_name_ver}" "" package_name_base "${CPACK_RPM_${ucomp}_PACKAGE_NAME}")
endif()
foreach(cpack_name_version IN LISTS cpack_name_versions)
if(package_names)
set(package_names "${package_names}, ${package_name_base}${cpack_name_version}")
else()
set(package_names "${package_name_base}${cpack_name_version}")
endif()
endforeach()
set(CPACK_RPM_${ucomp}_PACKAGE_CONFLICTS "${package_names}" PARENT_SCOPE)
endfunction()
#
# ov_rpm_add_latest_component(<comp>)
#
# Adds latest component for `comp`, but without a version
# Description and other stuff (arch) is taken from the main component
#
macro(ov_rpm_add_latest_component comp)
string(TOUPPER "${comp}" ucomp)
set(comp_name "${comp}_latest")
set(upper_case "${ucomp}_LATEST")
set(CPACK_COMPONENT_${upper_case}_DESCRIPTION "${CPACK_COMPONENT_${ucomp}_DESCRIPTION}")
set(CPACK_COMPONENT_${upper_case}_ARCHITECTURE "${CPACK_COMPONENT_${ucomp}_ARCHITECTURE}")
set(CPACK_COMPONENT_${upper_case}_DEPENDS "${comp}")
# take package name
if(DEFINED CPACK_RPM_${ucomp}_PACKAGE_NAME)
string(REPLACE "-${cpack_name_ver}" ""
CPACK_RPM_${upper_case}_PACKAGE_NAME
"${CPACK_RPM_${ucomp}_PACKAGE_NAME}")
else()
message(FATAL_ERROR "CPACK_RPM_${ucomp}_PACKAGE_NAME is not defined")
endif()
ov_rpm_add_rpmlint_suppression(${comp_name}
# it's umbrella package
"empty-binary-package")
# add latest to a list of rpm packages
list(APPEND CPACK_COMPONENTS_ALL ${comp_name})
endmacro()

View File

@ -0,0 +1,41 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
find_program(rpmlint_PROGRAM NAMES rpmlint DOC "Path to rpmlint tool")
if(NOT rpmlint_PROGRAM)
message(WARNING "Failed to find 'rpmlint' tool, use 'sudo dnf install rpmlint' to install it")
return()
endif()
execute_process(COMMAND "${rpmlint_PROGRAM}" --version
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
RESULT_VARIABLE rpmlint_code
OUTPUT_VARIABLE rpmlint_version)
if(NOT rpmlint_code EQUAL 0)
message(FATAL_ERROR "Internal error: Failed to determine rpmlint version")
else()
message(STATUS "${rpmlint_version}")
endif()
set(rpmlint_passed ON)
foreach(rpm_file IN LISTS CPACK_PACKAGE_FILES)
execute_process(COMMAND "${rpmlint_PROGRAM}" ${rpm_file}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
RESULT_VARIABLE rpmlint_exit_code
OUTPUT_VARIABLE rpmlint_output)
get_filename_component(rpm_name "${rpm_file}" NAME)
if(NOT rpmlint_exit_code EQUAL 0)
message("Package ${rpm_name}:")
message("${rpmlint_output}")
set(rpmlint_passed OFF)
endif()
endforeach()
if(NOT rpmlint_passed)
message(FATAL_ERROR "rpmlint has found some mistakes")
endif()

View File

@ -4,6 +4,8 @@
if(CPACK_GENERATOR STREQUAL "DEB")
include(cmake/packaging/debian.cmake)
elseif(CPACK_GENERATOR STREQUAL "RPM")
include(cmake/packaging/rpm.cmake)
elseif(CPACK_GENERATOR STREQUAL "NSIS")
include(cmake/packaging/nsis.cmake)
endif()

306
cmake/packaging/rpm.cmake Normal file
View File

@ -0,0 +1,306 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
#
# OpenVINO Core components including frontends, plugins, etc
#
function(_ov_add_plugin comp is_pseudo)
string(TOUPPER "${comp}" ucomp)
if(NOT DEFINED CPACK_RPM_${ucomp}_PACKAGE_NAME)
message(FATAL_ERROR "CPACK_RPM_${ucomp}_PACKAGE_NAME is not defined")
else()
set(package_name "${CPACK_RPM_${ucomp}_PACKAGE_NAME}")
endif()
if(NOT DEFINED cpack_full_ver)
message(FATAL_ERROR "Internal variable 'cpack_full_ver' is not defined")
endif()
if(is_pseudo)
if(pseudo_plugins_recommends)
set(pseudo_plugins_recommends "${pseudo_plugins_recommends}, ${package_name} (= ${cpack_full_ver})")
else()
set(pseudo_plugins_recommends "${package_name} (= ${cpack_full_ver})")
endif()
endif()
if(all_plugins_suggest)
set(all_plugins_suggest "${all_plugins_suggest}, ${package_name} (= ${cpack_full_ver})")
else()
set(all_plugins_suggest "${package_name} (= ${cpack_full_ver})")
endif()
list(APPEND installed_plugins ${comp})
set(pseudo_plugins_recommends "${pseudo_plugins_recommends}" PARENT_SCOPE)
set(all_plugins_suggest "${all_plugins_suggest}" PARENT_SCOPE)
set(installed_plugins "${installed_plugins}" PARENT_SCOPE)
endfunction()
macro(ov_cpack_settings)
# fill a list of components which are part of rpm
set(cpack_components_all ${CPACK_COMPONENTS_ALL})
unset(CPACK_COMPONENTS_ALL)
foreach(item IN LISTS cpack_components_all)
# filter out some components, which are not needed to be wrapped to .deb package
if(# NOT ${item} MATCHES ".*(python).*" AND
# python wheels are not needed to be wrapped by rpm packages
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS AND
# even for case of system TBB we have installation rules for wheels packages
# so, need to skip this explicitly
NOT item MATCHES "^tbb(_dev)?$" AND
# the same for pugixml
NOT item STREQUAL "pugixml" AND
# we have copyright file for rpm package
NOT item STREQUAL OV_CPACK_COMP_LICENSING AND
# not appropriate components
NOT item STREQUAL OV_CPACK_COMP_DEPLOYMENT_MANAGER AND
NOT item STREQUAL OV_CPACK_COMP_INSTALL_DEPENDENCIES AND
NOT item STREQUAL OV_CPACK_COMP_SETUPVARS)
list(APPEND CPACK_COMPONENTS_ALL ${item})
endif()
endforeach()
list(REMOVE_DUPLICATES CPACK_COMPONENTS_ALL)
# version with 3 components
set(cpack_name_ver "${OpenVINO_VERSION}")
# full version with epoch and release components
set(cpack_full_ver "${CPACK_PACKAGE_VERSION}")
# take release version into account
if(DEFINED CPACK_RPM_PACKAGE_RELEASE)
set(cpack_full_ver "${cpack_full_ver}-${CPACK_RPM_PACKAGE_RELEASE}")
endif()
# take epoch version into account
if(DEFINED CPACK_RPM_PACKAGE_EPOCH)
set(cpack_full_ver "${CPACK_RPM_PACKAGE_EPOCH}:${cpack_full_ver}")
endif()
# a list of conflicting package versions
set(conflicting_versions
# 2022 release series
# - 2022.1.0 is the last public release with rpm packages from Intel install team
# - 2022.1.1 does not have rpm packages enabled, distributed only as archives
2022.1.0)
# core
set(CPACK_COMPONENT_CORE_DESCRIPTION "OpenVINO C / C++ Runtime libraries")
set(CPACK_RPM_CORE_PACKAGE_NAME "libopenvino-${cpack_name_ver}")
# we need triggers to run ldconfig for openvino
set(CPACK_RPM_CORE_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}")
# use lintian to check packages in post-build step
set(CPACK_POST_BUILD_SCRIPTS "${IEDevScripts_DIR}/packaging/rpm_post_build.cmake")
# We currently don't have versioning for openvino core library
ov_rpm_add_rpmlint_suppression(core
"shlib-without-versioned-soname"
"package-name-doesnt-match-sonames")
# core_dev
set(CPACK_COMPONENT_CORE_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Development files")
set(CPACK_COMPONENT_CORE_DEV_DEPENDS "core")
set(CPACK_RPM_CORE_DEV_PACKAGE_NAME "libopenvino-dev-${cpack_name_ver}")
ov_rpm_generate_conflicts(core_dev ${conflicting_versions})
ov_rpm_add_rpmlint_suppression(core_dev
# CVS-79409: create man page for compile_tool
"binary-without-manpage")
#
# Plugins
#
# hetero
if(ENABLE_HETERO)
set(CPACK_COMPONENT_HETERO_DESCRIPTION "OpenVINO Hetero plugin")
set(CPACK_COMPONENT_HETERO_DEPENDS "core")
set(CPACK_RPM_HETERO_PACKAGE_NAME "libopenvino-hetero-${cpack_name_ver}")
set(CPACK_RPM_HETERO_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(hetero ON)
endif()
# auto batch
if(ENABLE_AUTO_BATCH)
set(CPACK_COMPONENT_BATCH_DESCRIPTION "OpenVINO Automatic Batching plugin")
set(CPACK_COMPONENT_BATCH_DEPENDS "core")
set(CPACK_RPM_BATCH_PACKAGE_NAME "libopenvino-auto-batch-${cpack_name_ver}")
_ov_add_plugin(batch ON)
endif()
# multi / auto plugins
if(ENABLE_MULTI)
if(ENABLE_AUTO)
set(CPACK_COMPONENT_MULTI_DESCRIPTION "OpenVINO Auto / Multi plugin")
else()
set(CPACK_COMPONENT_MULTI_DESCRIPTION "OpenVINO Multi plugin")
endif()
set(CPACK_COMPONENT_MULTI_DEPENDS "core")
set(CPACK_RPM_MULTI_PACKAGE_NAME "libopenvino-auto-${cpack_name_ver}")
set(CPACK_RPM_MULTI_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(multi ON)
elseif(ENABLE_AUTO)
set(CPACK_COMPONENT_AUTO_DESCRIPTION "OpenVINO Auto plugin")
set(CPACK_COMPONENT_AUTO_DEPENDS "core")
set(CPACK_RPM_AUTO_PACKAGE_NAME "libopenvino-auto-${cpack_name_ver}")
set(CPACK_RPM_AUTO_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(auto ON)
endif()
# intel-cpu
if(ENABLE_INTEL_CPU OR DEFINED openvino_arm_cpu_plugin_SOURCE_DIR)
if(ENABLE_INTEL_CPU)
set(CPACK_COMPONENT_CPU_DESCRIPTION "Intel® CPU")
else()
set(CPACK_COMPONENT_CPU_DESCRIPTION "ARM CPU")
endif()
set(CPACK_COMPONENT_CPU_DEPENDS "core")
set(CPACK_RPM_CPU_PACKAGE_NAME "libopenvino-intel-cpu-${cpack_name_ver}")
set(CPACK_RPM_CPU_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(cpu OFF)
endif()
# intel-gpu
if(ENABLE_INTEL_GPU)
set(CPACK_COMPONENT_GPU_DESCRIPTION "Intel® Processor Graphics")
set(CPACK_COMPONENT_GPU_DEPENDS "core")
set(CPACK_RPM_GPU_PACKAGE_NAME "libopenvino-intel-gpu-${cpack_name_ver}")
set(CPACK_RPM_GPU_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
# auto batch exhances GPU
# set(CPACK_RPM_BATCH_PACKAGE_ENHANCES "${CPACK_RPM_GPU_PACKAGE_NAME} = (${cpack_full_ver})")
_ov_add_plugin(gpu OFF)
endif()
# intel-myriad
if(ENABLE_INTEL_MYRIAD)
set(CPACK_COMPONENT_MYRIAD_DESCRIPTION "Intel® Movidius™ VPU")
set(CPACK_COMPONENT_MYRIAD_DEPENDS "core")
set(CPACK_RPM_MYRIAD_PACKAGE_NAME "libopenvino-intel-vpu-${cpack_name_ver}")
set(CPACK_RPM_MYRIAD_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(myriad OFF)
endif()
# intel-gna
if(ENABLE_INTEL_GNA)
set(CPACK_COMPONENT_GNA_DESCRIPTION "Intel® Gaussian Neural Accelerator")
set(CPACK_COMPONENT_GNA_DEPENDS "core")
set(CPACK_RPM_GNA_PACKAGE_NAME "libopenvino-intel-gna-${cpack_name_ver}")
# since we have libgna.so we need to call ldconfig and have `def_triggers` here
set(CPACK_RPM_GNA_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}")
ov_rpm_add_rpmlint_suppression(gna
# package name matches libopenvino_intel_gna_plugin.so
# but lintian looks at libgna.so.2 since it's a versioned library
"package-name-doesnt-match-sonames")
_ov_add_plugin(gna OFF)
endif()
# add pseudo plugins are recommended to core component
if(pseudo_plugins_recommends)
# see https://superuser.com/questions/70031/what-is-the-difference-between-recommended-and-suggested-packages-ubuntu.
# we suppose that pseudo plugins are needed for core
set(CPACK_RPM_CORE_PACKAGE_RECOMMENDS "${pseudo_plugins_recommends}")
endif()
#
# Python bindings
#
if(ENABLE_PYTHON)
set(CPACK_COMPONENT_PYOPENVINO_PYTHON3.6_DESCRIPTION "OpenVINO Python bindings")
if(installed_plugins)
set(CPACK_COMPONENT_PYOPENVINO_PYTHON3.6_DEPENDS "${installed_plugins}")
else()
set(CPACK_COMPONENT_PYOPENVINO_PYTHON3.6_DEPENDS "core")
endif()
set(CPACK_RPM_PYOPENVINO_PYTHON3.6_PACKAGE_NAME "libopenvino-python-${cpack_name_ver}")
set(CPACK_RPM_PYOPENVINO_PYTHON3.6_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
endif()
#
# Samples
#
set(samples_build_deps "cmake, g++, gcc, libc6-dev, make")
set(samples_build_deps_suggest "libopencv-core-dev, libopencv-imgproc-dev, libopencv-imgcodecs-dev")
# c_samples / cpp_samples
set(CPACK_COMPONENT_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Samples")
set(CPACK_COMPONENT_SAMPLES_DEPENDS "core_dev")
set(CPACK_RPM_SAMPLES_PACKAGE_NAME "openvino-samples-${cpack_name_ver}")
set(CPACK_RPM_SAMPLES_PACKAGE_SUGGESTS "${samples_build_deps_suggest}, ${all_plugins_suggest}")
set(CPACK_RPM_SAMPLES_PACKAGE_DEPENDS "libgflags-dev, nlohmann-json3-dev, zlib1g-dev")
# can be skipped with --no-install-recommends
set(CPACK_RPM_SAMPLES_PACKAGE_RECOMMENDS "${samples_build_deps}")
set(CPACK_RPM_SAMPLES_PACKAGE_ARCHITECTURE "all")
# python_samples
set(CPACK_COMPONENT_PYTHON_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Python Samples")
set(CPACK_RPM_PYTHON_SAMPLES_PACKAGE_NAME "openvino-samples-python-${cpack_name_ver}")
set(CPACK_RPM_PYTHON_SAMPLES_PACKAGE_DEPENDS "python3")
set(CPACK_RPM_PYTHON_SAMPLES_PACKAGE_ARCHITECTURE "all")
#
# Add umbrella packages
#
# all libraries
set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries")
if(installed_plugins)
set(CPACK_COMPONENT_LIBRARIES_DEPENDS "${installed_plugins}")
else()
set(CPACK_COMPONENT_LIBRARIES_DEPENDS "core")
endif()
set(CPACK_RPM_LIBRARIES_PACKAGE_NAME "openvino-libraries-${cpack_name_ver}")
ov_rpm_add_rpmlint_suppression(libraries
# it's umbrella package
"empty-binary-package")
# all libraries-dev
set(CPACK_COMPONENT_LIBRARIES_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
set(CPACK_COMPONENT_LIBRARIES_DEV_DEPENDS "core_dev;libraries")
set(CPACK_RPM_LIBRARIES_DEV_PACKAGE_NAME "openvino-libraries-dev-${cpack_name_ver}")
ov_rpm_generate_conflicts(libraries_dev ${conflicting_versions})
ov_rpm_add_rpmlint_suppression(libraries_dev
# it's umbrella package
"empty-binary-package")
# all openvino
set(CPACK_COMPONENT_OPENVINO_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
set(CPACK_COMPONENT_OPENVINO_DEPENDS "libraries_dev;samples;python_samples")
set(CPACK_RPM_OPENVINO_PACKAGE_NAME "openvino-${cpack_name_ver}")
ov_rpm_generate_conflicts(openvino ${conflicting_versions})
ov_rpm_add_rpmlint_suppression(openvino
# it's umbrella package
"empty-binary-package")
list(APPEND CPACK_COMPONENTS_ALL "libraries;libraries_dev;openvino")
#
# Install latest symlink packages
#
# NOTE: we expicitly don't add runtime latest packages
# since a user needs to depend on specific VERSIONED runtime package
# with fixed SONAMEs, while latest package can be updated multiple times
# ov_rpm_add_latest_component(libraries)
ov_rpm_add_latest_component(libraries_dev)
ov_rpm_add_latest_component(openvino)
# users can manually install specific version of package
# e.g. sudo apt-get install openvino=2022.1.0
# even if we have latest package version 2022.2.0
#
# install rpm common files
#
foreach(comp IN LISTS CPACK_COMPONENTS_ALL)
ov_rpm_add_changelog_and_copyright("${comp}")
endforeach()
endmacro()

View File

@ -107,6 +107,7 @@ elif [ -f /etc/redhat-release ]; then
tar \
xz \
p7zip \
rpm-build \
unzip \
yum-plugin-ovl \
which \