1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

Merge remote-tracking branch 'dev/parched/OP-1695_ubuntu_PPA' into next

This commit is contained in:
James Duley 2015-03-10 11:40:59 +13:00
commit ba5f395f41
8 changed files with 90 additions and 43 deletions

View File

@ -81,8 +81,10 @@ $(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),de
# Make sure this isn't being run as root unless installing (no whoami on Windows, but that is ok here)
ifeq ($(shell whoami 2>/dev/null),root)
ifeq ($(filter install all_clean,$(MAKECMDGOALS)),)
$(error You should not be running this as root)
ifeq ($(filter install,$(MAKECMDGOALS)),)
ifndef FAKEROOTKEY
$(error You should not be running this as root)
endif
endif
endif
@ -785,15 +787,19 @@ endif
# - calls paltform-specific packaging script
# Define some variables
export PACKAGE_LBL := $(shell $(VERSION_INFO) --format=\$${LABEL})
export PACKAGE_NAME := OpenPilot
export PACKAGE_SEP := -
PACKAGE_LBL := $(shell $(VERSION_INFO) --format=\$${LABEL})
PACKAGE_NAME := OpenPilot
PACKAGE_SEP := -
PACKAGE_FULL_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(PACKAGE_LBL)
# Source distribution is never dirty because it uses git archive
DIST_NAME := $(DIST_DIR)/$(subst dirty-,,$(PACKAGE_FULL_NAME)).tar
.PHONY: package
include $(ROOT_DIR)/package/$(UNAME).mk
package: all_fw all_ground uavobjects_matlab $(PACKAGE_DIR)
package: all_fw all_ground uavobjects_matlab | $(PACKAGE_DIR)
ifneq ($(GCS_BUILD_CONF),release)
# We can only package release builds
$(error Packaging is currently supported for release builds only)
@ -882,20 +888,20 @@ build-info:
DIST_VER_INFO := $(DIST_DIR)/version-info.json
.PHONY: $(DIST_VER_INFO) # Because to many deps to list
$(DIST_VER_INFO): $(DIST_DIR)
$(DIST_VER_INFO): .git/index | $(DIST_DIR)
$(V1) $(VERSION_INFO) --jsonpath="$(DIST_DIR)"
.PHONY: dist
dist: $(DIST_DIR) $(DIST_VER_INFO)
@$(ECHO) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_DIR))"
$(eval DIST_NAME := $(call toprel, "$(DIST_DIR)/OpenPilot-$(shell git describe).tar"))
$(V1) git archive --prefix="OpenPilot/" -o "$(DIST_NAME)" HEAD
$(DIST_NAME).gz: $(DIST_VER_INFO) .git/index | $(DIST_DIR)
@$(ECHO) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_NAME).gz)"
$(V1) git archive --prefix="$(PACKAGE_NAME)/" -o "$(DIST_NAME)" HEAD
$(V1) tar --append --file="$(DIST_NAME)" \
--transform='s,.*version-info.json,OpenPilot/version-info.json,' \
--transform='s,.*version-info.json,$(PACKAGE_NAME)/version-info.json,' \
$(call toprel, "$(DIST_VER_INFO)")
$(V1) gzip -f "$(DIST_NAME)"
.PHONY: dist
dist: $(DIST_NAME).gz
##############################
#

View File

@ -72,7 +72,7 @@ MSG_FLASH_IMG = $(QUOTE) FLASH_IMG $(MSG_EXTRA) $(QUOTE)
toprel = $(subst $(realpath $(ROOT_DIR))/,,$(abspath $(1)))
# Function to replace special characters like is done for the symbols.
replace_special_chars = $(subst ~,_,$(subst @,_,$(subst :,_,$(subst -,_,$(subst .,_,$(subst /,_,$1))))))
replace_special_chars = $(subst +,_,$(subst ~,_,$(subst @,_,$(subst :,_,$(subst -,_,$(subst .,_,$(subst /,_,$1)))))))
# Display compiler version information.
.PHONY: gccversion

View File

@ -228,7 +228,8 @@ class Repo:
json_data['last_tag'] = self._last_tag
json_data['num_commits_past_tag'] = self._num_commits_past_tag
json_data['branch'] = self._branch
json_data['dirty'] = self._dirty
# version-info.json is for use with git archive which doesn't take in dirty changes
json_data['dirty'] = False
json_path = os.path.join(path, 'version-info.json')
with open(json_path, 'w') as json_file:

View File

@ -6,26 +6,72 @@ ifndef OPENPILOT_IS_COOL
$(error Top level Makefile must be used to build this target)
endif
DEB_VER := $(subst RELEASE-,,$(PACKAGE_LBL))-1
DEB_DIR := $(ROOT_DIR)/package/linux/debian
DEB_BUILD_DIR := $(ROOT_DIR)/debian
# Are we using a debian based distro?
ifneq ($(shell which dpkg 2> /dev/null),)
SED_DATE_STRG = $(shell date -R)
SED_SCRIPT = s/<VERSION>/$(DEB_VER)/;s/<DATE>/$(SED_DATE_STRG)/
DEB_DIST := unstable
# Instead of RELEASE-15.01-RC1 debian wants 15.01~RC1
UPSTREAM_VER := $(subst -,~,$(subst RELEASE-,,$(PACKAGE_LBL)))
DEB_REV := 1
ifeq ($(DEB_DIST), trusty)
DEB_REV := $(DEB_REV)$(DEB_DIST)1
endif
DEB_NAME := openpilot
DEB_ORIG_SRC := $(PACKAGE_DIR)/$(DEB_NAME)_$(UPSTREAM_VER).orig.tar.gz
DEB_PACKAGE_DIR := $(PACKAGE_DIR)/$(DEB_NAME)-$(UPSTREAM_VER)
DEB_ARCH := $(shell dpkg --print-architecture)
DEB_PACKAGE_NAME := $(DEB_NAME)_$(UPSTREAM_VER)-$(DEB_REV)_$(DEB_ARCH)
DEB_DIR := package/linux/debian
DEB_ARCH := $(shell dpkg --print-architecture)
DEB_PACKAGE_NAME := openpilot_$(DEB_VER)_$(DEB_ARCH)
SED_DATE_STRG = $(shell date -R)
SED_SCRIPT = s/<VERSION>/$(UPSTREAM_VER)-$(DEB_REV)/;s/<DATE>/$(SED_DATE_STRG)/;s/<DIST>/$(DEB_DIST)/
# Ubuntu 14.04 (Trusty Tahr) has different names for the qml-modules
TRUSTY_DEPS_SED := s/qml-module-qtquick-controls/qtdeclarative5-controls-plugin/g; \
s/qml-module-qtquick-dialogs/qtdeclarative5-dialogs-plugin/g; \
s/qml-module-qtquick-localstorage/qtdeclarative5-localstorage-plugin/g; \
s/qml-module-qtquick-particles2/qtdeclarative5-particles-plugin/g; \
s/qml-module-qtquick2/qtdeclarative5-qtquick2-plugin/g; \
s/qml-module-qtquick-window2/qtdeclarative5-window-plugin/g; \
s/qml-module-qtquick-xmllistmodel/qtdeclarative5-xmllistmodel-plugin/g;
# Leave off Qt and ARM compiler dependencies if calling package target under the assumption that
# OP is providing them or the user already has them installed because OP is already built.
PACKAGE_DEPS_SED := s/python.*/python/;s/{misc:Depends}.*/{misc:Depends}/;
.PHONY: package
package:
$(V1) echo "Building Linux package, please wait..."
$(V1) cp -rL $(DEB_DIR) $(DEB_BUILD_DIR)
$(V1) sed -i -e "$(SED_SCRIPT)" $(DEB_BUILD_DIR)/changelog
package: debian
@$(ECHO) "Building Linux package, please wait..."
# Override clean and build because OP has already performed them.
$(V1) printf "override_dh_auto_clean:\noverride_dh_auto_build:\n\t#\n" >> debian/rules
$(V1) sed -i -e "$(PACKAGE_DEPS_SED)" debian/control
$(V1) dpkg-buildpackage -b -us -uc
$(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
$(V1) rm -rf $(DEB_BUILD_DIR)
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).deb $(PACKAGE_DIR)
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).changes $(PACKAGE_DIR)
$(V1) rm -r debian
.PHONY: debian
debian: $(DEB_DIR)
$(V1) rm -rf debian
$(V1) cp -rL $(DEB_DIR) debian
$(V1) sed -i -e "$(SED_SCRIPT)" debian/changelog
ifeq ($(DEB_DIST), trusty)
$(V1) sed -i -e "$(TRUSTY_DEPS_SED)" debian/control
endif
.PHONY: package_src
package_src: $(DEB_ORIG_SRC_NAME) $(DEB_PACKAGE_DIR)
$(V1) cd $(DEB_PACKAGE_DIR) && dpkg-buildpackage -S -us -uc
$(DEB_ORIG_SRC): $(DIST_NAME).gz | $(PACKAGE_DIR)
$(V1) cp $(DIST_NAME).gz $(DEB_ORIG_SRC)
$(DEB_PACKAGE_DIR): $(DEB_ORIG_SRC) debian | $(PACKAGE_DIR)
$(V1) tar -xf $(DEB_ORIG_SRC) -C $(PACKAGE_DIR)
$(V1) mv debian $(PACKAGE_DIR)/$(PACKAGE_NAME)
$(V1) rm -rf $(DEB_PACKAGE_DIR) && mv $(PACKAGE_DIR)/$(PACKAGE_NAME) $(DEB_PACKAGE_DIR)
endif # Debian based distro?
##############################
#
# Install OpenPilot

View File

@ -1,4 +1,4 @@
openpilot (<VERSION>) unstable; urgency=low
openpilot (<VERSION>) <DIST>; urgency=low
* Release from upstream Git (testing - unstable)

View File

@ -1,15 +1,15 @@
Source: openpilot
Section: unknown
Section: electronics
Priority: optional
Maintainer: James Duley <james@openpilot.org>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.4
Build-Depends: debhelper (>= 9), libudev-dev, libusb-1.0-0-dev, libsdl1.2-dev, python, gcc-arm-none-eabi (>=4.9), qt5-default, qttools5-dev-tools, libqt5svg5-dev, qtdeclarative5-dev, qml-module-qtquick-controls, libqt5serialport5-dev, qtmultimedia5-dev, qtscript5-dev, libqt5opengl5-dev
Standards-Version: 3.9.5
Homepage: http://www.openpilot.org
Vcs-Git: git://git.openpilot.org/OpenPilot.git
Vcs-Browser: http://git.openpilot.org/changelog/OpenPilot
Package: openpilot
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}, qml-module-qtquick-controls, qml-module-qtquick-dialogs, qml-module-qtquick-xmllistmodel, qml-module-qtquick-localstorage, qml-module-qtquick-particles2, qml-module-qtquick-window2, qml-module-qtquick2
Description: OpenPilot GCS
OpenPilot Ground Control Station software

9
package/linux/debian/rules Normal file → Executable file
View File

@ -11,15 +11,8 @@ export DH_OPTIONS
%:
dh $@
# Disabled because OpenPilot makefile cleans and builds.
override_dh_auto_clean:
#
override_dh_auto_build:
#dh_auto_build -- all
override_dh_auto_test:
# Fails non-silently because it is run under fakeroot.
dh_auto_build -- all
override_dh_auto_install:
dh_auto_install -- prefix=/usr

View File

@ -0,0 +1 @@
3.0 (quilt)