Added package target to generate .deb packages
authorWesley Hirsch <wesley.hirsch@riftio.com>
Tue, 7 Feb 2017 22:02:30 +0000 (17:02 -0500)
committerWesley Hirsch <wesley.hirsch@riftio.com>
Tue, 7 Feb 2017 22:02:30 +0000 (17:02 -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: I1f460e66145bb7d62267092a718c738e96863b8a
Signed-off-by: Wesley Hirsch <wesley.hirsch@riftio.com>
Makefile

index c83dd16..8a1789f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,8 @@ 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) --standalone-submodule $(TOP_SRC_PATH) --
+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 +46,13 @@ 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=$(TOP_SRC_PATH)
+       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=$(TOP_SRC_PATH) -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