Repository : ssh://git@open-mesh.org/openwrt-feed-devel
On branch : master
commit f341283108cd308e5a7956b84b71a97008c6375e Author: Sven Eckelmann sven@narfation.org Date: Sun Oct 7 15:47:51 2018 +0200
batctl-devel: Add option to select download source
The current way to download the alfred master branch sources via a special script on open-mesh.org doesn't work anymore because each https download requires the checksum of this file. Thus the whole download implementation has to be replaced to get everything via the native OpenWrt download helpers.
The supported methods are now:
* download via git - free selection of the git repository remote - free selection of the branch or tag * copy from local source directory
Signed-off-by: Sven Eckelmann sven@narfation.org
f341283108cd308e5a7956b84b71a97008c6375e batctl-devel/Config.devel.in | 50 ++++++++++++++++++++++++++++++++++++++++++++ batctl-devel/Config.in | 9 -------- batctl-devel/Makefile | 38 ++++++++++++++++++++++++++------- 3 files changed, 80 insertions(+), 17 deletions(-)
diff --git a/batctl-devel/Config.devel.in b/batctl-devel/Config.devel.in new file mode 100644 index 0000000..fbdd9a9 --- /dev/null +++ b/batctl-devel/Config.devel.in @@ -0,0 +1,50 @@ +if PACKAGE_batctl-devel + +choice + prompt "Selected batctl-devel download method" + default batctl-devel_SOURCE_GIT + + config batctl-devel_SOURCE_GIT + bool "git repository" + + config batctl-devel_SOURCE_DIRECTORY + bool "directory" + +endchoice + +endif + +if batctl-devel_SOURCE_GIT + +config batctl-devel_REPOSITORY + string + prompt "batctl-devel repository to build" + depends on PACKAGE_batctl-devel + default "https://git.open-mesh.org/batctl.git" + help + Enter a batctl-devel repository url + +config batctl-devel_BRANCH + string + prompt "batctl-devel branch to build" + depends on PACKAGE_batctl-devel + default "master" + help + Enter a batctl branch name or git tag to override package + default value. This allows to build from non-master branches + to test unreleased features. + +endif + + +if batctl-devel_SOURCE_DIRECTORY + +config batctl-devel_DIRECTORY + string + prompt "batctl-devel source directory" + depends on PACKAGE_batctl-devel + default "/tmp/batctl-devel" + help + Enter a batctl-devel source directory + +endif diff --git a/batctl-devel/Config.in b/batctl-devel/Config.in deleted file mode 100644 index 09f9c5f..0000000 --- a/batctl-devel/Config.in +++ /dev/null @@ -1,9 +0,0 @@ -config BATCTL_DEVEL_BATCTL_BRANCH - string - prompt "batctl branch to build package with" - depends on PACKAGE_batctl-devel - default "master" - help - Enter a batctl branch name or git tag to override package - default value. This allows to build from non-master branches - to test unreleased features. diff --git a/batctl-devel/Makefile b/batctl-devel/Makefile index d740f60..4c0ba24 100644 --- a/batctl-devel/Makefile +++ b/batctl-devel/Makefile @@ -9,15 +9,27 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batctl-devel
-PKG_BRANCH:=$(call qstrip,$(CONFIG_BATCTL_DEVEL_BATCTL_BRANCH)) -PKG_VERSION:=$(shell git ls-remote https://git@git.open-mesh.org/batctl.git $(PKG_BRANCH) | cut -c1-7) -PKG_BATCTL_FNAME:=batctl-devel-$(PKG_VERSION).tar.gz -PKG_BATCTL_DIR:=batctl-$(PKG_VERSION) +ifdef CONFIG_batctl-devel_SOURCE_GIT
-PKG_SOURCE_URL:=https://git.open-mesh.org/snapshot/ -PKG_SOURCE:=$(PKG_BATCTL_FNAME) +PKG_BRANCH:=$(call qstrip,$(CONFIG_batctl-devel_BRANCH)) +PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_batctl-devel_REPOSITORY)) +PKG_REV:=$(shell git ls-remote $(PKG_SOURCE_URL) $(PKG_BRANCH)|cut -c1-40) +PKG_VERSION:=0.$(PKG_REV) +PKG_SOURCE_PROTO:=git
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_BATCTL_DIR) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_VERSION:=$(PKG_REV) + +endif + +ifdef CONFIG_batctl-devel_SOURCE_DIRECTORY + +PKG_REV:=0 +PKG_VERSION:=0.$(PKG_REV) + +endif + +PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
@@ -38,7 +50,7 @@ development version ($(PKG_VERSION)). endef
define Package/batctl-devel/config - source "$(SOURCE)/Config.in" + source "$(SOURCE)/Config.devel.in" endef
# The linker can identify unused sections of a binary when each symbol is stored @@ -69,6 +81,16 @@ MAKE_BATCTL_ARGS += \ REVISION="openwrt-$(PKG_VERSION)"
+ifdef CONFIG_batctl-devel_SOURCE_DIRECTORY + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) $(CONFIG_batctl-devel_DIRECTORY)/* $(PKG_BUILD_DIR)/ + $(call Build/Prepare/Default) +endef + +endif + define Build/Compile $(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS) endef