Added package target to generate .deb packages
authorWesley Hirsch <wesley.hirsch@riftio.com>
Fri, 20 Jan 2017 19:37:10 +0000 (19:37 +0000)
committerWesley Hirsch <wesley.hirsch@riftio.com>
Tue, 7 Feb 2017 21:56:35 +0000 (16:56 -0500)
I'm just calling the underlying `make rw.package` here.
RIFT_PACKAGE_GENERATOR is the variable that controls which types of
packages are generated.

Version numbering uses git describe, which isn't always accurate, but
seems to be reliable enough inside of a CI build system.

Change-Id: I2f6b7f2773fddaf98979b8a51debd01eb853bf24
Signed-off-by: Wesley Hirsch <wesley.hirsch@riftio.com>
Makefile

index 5c9d864..db2cda9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,9 @@ RIFT_BUILD = $(TOP_SRC_PATH)/.build
 RIFT_ARTIFACTS = $(TOP_ROOT_PATH)/artifacts
 RIFT_INSTALL = $(TOP_ROOT_PATH)
 RIFT_SHELL_EXE = $(TOP_ROOT_PATH)/rift-shell -b $(RIFT_BUILD) -i $(RIFT_INSTALL) -a $(RIFT_ARTIFACTS) --
+RELEASE_NUMBER = $(shell git describe | cut -d. -f1 | sed -e 's/^v//')
+BUILD_NUMBER = $(shell git describe | cut -d. -f2-)
+
 
 CONFD = XML_ONLY
 
@@ -44,11 +47,14 @@ cmake::
        mkdir -p $(RIFT_BUILD)
        mkdir -p $(RIFT_ARTIFACTS)
        mkdir -p $(RIFT_INSTALL)
-       cd $(RIFT_BUILD) && $(RIFT_SHELL_EXE) cmake $(TOP_SRC_PATH) -DCMAKE_INSTALL_PREFIX=$(TOP_ROOT_PATH) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DNOT_DEVELOPER_BUILD=$(NOT_DEVELOPER_TYPE) -DCOVERAGE_BUILD=$(COVERAGE_TYPE) -DRIFT_AGENT_BUILD=$(RIFT_AGENT_BUILD) -DPROJECT_TOP_DIR=$(PROJECT_TOP_DIR) -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DRIFT_SUBMODULE_NAME=$(PROJECT_TOP_DIR)
+       cd $(RIFT_BUILD) && $(RIFT_SHELL_EXE) cmake $(TOP_SRC_PATH) -DCMAKE_INSTALL_PREFIX=$(TOP_ROOT_PATH) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DNOT_DEVELOPER_BUILD=$(NOT_DEVELOPER_TYPE) -DCOVERAGE_BUILD=$(COVERAGE_TYPE) -DRIFT_AGENT_BUILD=$(RIFT_AGENT_BUILD) -DPROJECT_TOP_DIR=$(PROJECT_TOP_DIR) -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DRIFT_SUBMODULE_NAME=$(PROJECT_TOP_DIR) -DRIFT_PACKAGE_GENERATOR=DEB -DRELEASE_NUMBER=$(RELEASE_NUMBER) -DBUILD_NUMBER=$(BUILD_NUMBER)
 
 rw: cmake
        $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD)
 
+package: rw
+       $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD) rw.package
+
 install:
        $(RIFT_SHELL_EXE) $(MAKE) -C $(RIFT_BUILD) install