From eb28616ca1c69184b7b2b4cf4ba96cf4df29f978 Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Mon, 18 Feb 2019 09:22:44 -0500 Subject: JVPP-22: Update packaging - rpm package name update according to naming conventions - vpp instalation verification - update versioning script Change-Id: I962895ce636aec949930ea452d1e924024c4b780 Signed-off-by: Michal Cmarada --- java/CMakeLists.txt | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'java') diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 460a955..1f72782 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -274,11 +274,6 @@ endif () unset(vpp_version) set(COLUMNS 200) -execute_process( - COMMAND dpkg -l vpp - COMMAND grep vpp - COMMAND awk "{print $3}" OUTPUT_VARIABLE vpp_version) -string(REGEX REPLACE "\n$" "" vpp_version "${vpp_version}") set(CPACK_PACKAGE_DESCRIPTION "VPP-Java-API-bindings This package contains VPP java api bindings.") @@ -291,6 +286,8 @@ set(CPACK_OUTPUT_FILE_PREFIX build-root/packages) set(CPACK_PACKAGE_FILE_NAME "vpp-api-java_${JVPP_VERSION}") if (${RELEASE_ID} IN_LIST DebianBasedOS) set(CPACK_GENERATOR DEB) + execute_process(COMMAND ./version deb-vpp-version OUTPUT_VARIABLE vpp_version) + string(STRIP "${vpp_version}" vpp_version) set(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}") @@ -309,13 +306,27 @@ if (${RELEASE_ID} IN_LIST DebianBasedOS) elseif (${RELEASE_ID} IN_LIST RHBasedOS) set(CPACK_GENERATOR RPM) + execute_process(COMMAND ./version rpm-vpp-version OUTPUT_VARIABLE vpp_version) + string(STRIP "${vpp_version}" vpp_version) # Excluding /usr/share/java top level directory due to conflict with javapackages-tools (openjdk dependency) set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/java") set(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") - set(CPACK_RPM_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}") set(CPACK_RPM_PACKAGE_SECTION "${CPACK_PACKAGE_SECTION}") - set(CPACK_RPM_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) + execute_process(COMMAND uname -m OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE) + string(STRIP "${CPACK_RPM_PACKAGE_ARCHITECTURE}" CPACK_RPM_PACKAGE_ARCHITECTURE) + execute_process(COMMAND ./version rpm-version OUTPUT_VARIABLE CPACK_RPM_PACKAGE_VERSION) + string(STRIP "${CPACK_RPM_PACKAGE_VERSION}" CPACK_RPM_PACKAGE_VERSION) + execute_process(COMMAND ./version rpm-release OUTPUT_VARIABLE CPACK_RPM_PACKAGE_RELEASE) + string(STRIP "${CPACK_RPM_PACKAGE_RELEASE}" CPACK_RPM_PACKAGE_RELEASE) + execute_process(COMMAND ./version os-version-id OUTPUT_VARIABLE OS_VERSION_ID) + string(STRIP "${OS_VERSION_ID}" OS_VERSION_ID) + + # according to naming conventions file name should consist of: + # name-version-release.architecture.rpm (e.g. vpp-api-java-19.04-SNAPSHOT~9_ge3665c6~b7.x86_64.rpm) + if (${RELEASE_ID} MATCHES "CentOS" AND ${OS_VERSION_ID} MATCHES "7") + set(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE}") + endif () set(CPACK_RPM_PACKAGE_PRIORITY extra) set(CPACK_RPM_PACKAGE_DEPENDS "vpp (>= ${vpp_version}), vpp-plugins (>= ${vpp_version})") @@ -323,8 +334,9 @@ elseif (${RELEASE_ID} IN_LIST RHBasedOS) message("\nRPM package:") message(" Name: ${CPACK_RPM_PACKAGE_NAME}") message(" Version: ${CPACK_RPM_PACKAGE_VERSION}") + message(" Release: ${CPACK_RPM_PACKAGE_RELEASE}") message(" Description: ${CPACK_RPM_PACKAGE_DESCRIPTION}") - message(" File name: ${CPACK_RPM_PACKAGE_FILE_NAME}") + message(" File name: ${CPACK_PACKAGE_FILE_NAME}") message(" Depends on: ${CPACK_RPM_PACKAGE_DEPENDS}\n") endif () if (PackZip) -- cgit 1.2.3-korg