cmake: updated CPackDeb to use DEB outer compression.
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Mon, 9 Jun 2014 12:20:11 +0000 (13:20 +0100)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Mon, 9 Jun 2014 12:20:11 +0000 (13:20 +0100)
* Additional fields added to CMakeLists

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
CMakeLists.txt
cmake/modules/CPackDeb.cmake

index 11e6e07..491edac 100644 (file)
@@ -23,7 +23,8 @@ message (INFO " - MAA Version ${VERSION}")
 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
@@ -68,12 +69,14 @@ if (IPK)
   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()
index 77b9d26..8193837 100644 (file)
@@ -187,21 +187,21 @@ else( ${OPKG_CMD} STREQUAL "OPKG_CMD-NOTFOUND" )
   # 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