2011-05-13 16:40:28 +02:00
|
|
|
#
|
2013-03-21 22:11:30 +01:00
|
|
|
# Linux-specific packaging script
|
2011-05-13 16:40:28 +02:00
|
|
|
#
|
|
|
|
|
2013-03-21 22:11:30 +01:00
|
|
|
ifndef OPENPILOT_IS_COOL
|
|
|
|
$(error Top level Makefile must be used to build this target)
|
|
|
|
endif
|
|
|
|
|
2015-01-09 05:29:01 +01:00
|
|
|
DEB_VER := $(PACKAGE_LBL)-1
|
2015-01-08 23:05:29 +01:00
|
|
|
DEB_DIR := $(ROOT_DIR)/package/linux/debian
|
2011-12-19 01:58:42 +01:00
|
|
|
DEB_BUILD_DIR := $(ROOT_DIR)/debian
|
|
|
|
|
|
|
|
SED_DATE_STRG = $(shell date -R)
|
2015-01-09 05:29:01 +01:00
|
|
|
SED_SCRIPT = s/<VERSION>/$(DEB_VER)/;s/<DATE>/$(SED_DATE_STRG)/
|
2011-12-19 01:58:42 +01:00
|
|
|
|
2015-01-09 04:49:28 +01:00
|
|
|
DEB_ARCH := $(shell dpkg --print-architecture)
|
2015-01-09 05:29:01 +01:00
|
|
|
DEB_PACKAGE_NAME := openpilot_$(DEB_VER)_$(DEB_ARCH)
|
2011-12-19 01:58:42 +01:00
|
|
|
|
2013-03-21 22:11:30 +01:00
|
|
|
.PHONY: package
|
2015-01-08 23:05:29 +01:00
|
|
|
package:
|
2012-12-05 16:40:14 +01:00
|
|
|
$(V1) echo "Building Linux package, please wait..."
|
2015-01-08 23:54:02 +01:00
|
|
|
$(V1) cp -rL $(DEB_DIR) $(DEB_BUILD_DIR)
|
2015-01-30 23:04:10 +01:00
|
|
|
$(V1) sed -i -e "$(SED_SCRIPT)" $(DEB_BUILD_DIR)/changelog
|
|
|
|
$(V1) dpkg-buildpackage -b -us -uc
|
2015-01-08 23:05:29 +01:00
|
|
|
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).deb $(BUILD_DIR)/$(DEB_PACKAGE_NAME).deb
|
|
|
|
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).changes $(BUILD_DIR)/$(DEB_PACKAGE_NAME).changes
|
2012-12-05 16:40:14 +01:00
|
|
|
$(V1) rm -rf $(DEB_BUILD_DIR)
|