string (REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
string (REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION}")
string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VERSION}")
-string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" VERSION_SHA1 "${VERSION}")
+string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+).*" "\\1" VERSION_COMMIT "${VERSION}")
+string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+\\-(.*)" "\\1" VERSION_SHA1 "${VERSION}")
set (VERSION_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/version.c.in
message( INFO " - Target arch is ${DETECTED_ARCH}")
set(CPACK_GENERATOR "DEB")
- set(CPACK_ARCHITECTUR ${DETECTED_ARCH})
- set(CPACK_PACKAGE_VERSION_MAJOR ${maa_VERSION_MAJOR})
- set(CPACK_PACKAGE_VERSION_MINOR ${maa_VERSION_MINOR})
- set(CPACK_PACKAGE_VERSION_PATCH ${maa_VERSION_PATCH})
+ set(OPKG_ARCH ${DETECTED_ARCH})
set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR})
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Intel IoT-Devkit") #required
+ set(CPACK_PACKAGE_VERSION ${maa_VERSION_MAJOR}.${maa_VERSION_MINOR}.${maa_VERSION_PATCH}.${VERSION_COMMIT})
+ set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DETECTED_ARCH})
+ set(CPACK_SYSTEM_NAME ${DETECTED_ARCH})
+ set(CPACK_DEBIAN_PACKAGE_PROVIDES "maa-devel maa-dbg maa-docs")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
include (CPack)
endif()
# Write controlfile
FILE(WRITE ${CPACK_OPKG_CONTROL_FILE}
"Package: ${CPACK_PACKAGE_NAME}
-Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
-Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
-Architecture: ${CPACK_ARCHITECTUR}
+Version: ${CPACK_PACKAGE_VERSION}
+Description: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
+Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}
Section: ${CPACK_DEBIAN_PACKAGE_SECTION}
Priority: optional
Maintainer: ${CPACK_DEBIAN_PACKAGE_MAINTAINER}
Depends:
-# Provides:
+Provides: ${CPACK_DEBIAN_PACKAGE_PROVIDES}
Source: https://github.com/intel-iot-devkit/maa
#Essential: no
")
- set(OPKG_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_ARCHITECTUR}")
+set(OPKG_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
execute_process(
- COMMAND "${OPKG_CMD}" "-c" "-o" "0" "${CPACK_PACKAGE_FILE_NAME}" "."
+ COMMAND "${OPKG_CMD}" "-o" "0" "${CPACK_PACKAGE_FILE_NAME}" "."
RESULT_VARIABLE _result
OUTPUT_VARIABLE _res_output
ERROR_VARIABLE _res_error