Repository : ssh://git@open-mesh.org/openwrt-feed-devel
On branch : master
commit 4e16ebaf5a17a3f1c84a84e99ecc5b51b565ce21 Author: Sven Eckelmann sven@narfation.org Date: Sun Oct 7 15:47:51 2018 +0200
batman-adv-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
4e16ebaf5a17a3f1c84a84e99ecc5b51b565ce21 batman-adv-devel/Config.devel.in | 50 ++++++++++++++++++++++++++++++++++++++++ batman-adv-devel/Config.in | 11 --------- batman-adv-devel/Makefile | 40 ++++++++++++++++++++++++-------- 3 files changed, 81 insertions(+), 20 deletions(-)
diff --git a/batman-adv-devel/Config.devel.in b/batman-adv-devel/Config.devel.in new file mode 100644 index 0000000..cb60763 --- /dev/null +++ b/batman-adv-devel/Config.devel.in @@ -0,0 +1,50 @@ +if PACKAGE_kmod-batman-adv-devel + +choice + prompt "Selected batman-adv-devel download method" + default batman-adv-devel_SOURCE_GIT + + config batman-adv-devel_SOURCE_GIT + bool "git repository" + + config batman-adv-devel_SOURCE_DIRECTORY + bool "directory" + +endchoice + +endif + +if batman-adv-devel_SOURCE_GIT + +config batman-adv-devel_REPOSITORY + string + prompt "batman-adv-devel repository to build" + depends on PACKAGE_kmod-batman-adv-devel + default "https://git.open-mesh.org/batman-adv.git" + help + Enter a batman-adv-devel repository url + +config batman-adv-devel_BRANCH + string + prompt "batman-adv-devel branch to build" + depends on PACKAGE_kmod-batman-adv-devel + default "master" + help + Enter a batman-adv branch name or git tag to override package + default value. This allows to build from non-master branches + to test unreleased features. + +endif + + +if batman-adv-devel_SOURCE_DIRECTORY + +config batman-adv-devel_DIRECTORY + string + prompt "batman-adv-devel source directory" + depends on PACKAGE_kmod-batman-adv-devel + default "/tmp/batman-adv-devel" + help + Enter a batman-adv-devel source directory + +endif diff --git a/batman-adv-devel/Config.in b/batman-adv-devel/Config.in index 4df1528..188a818 100644 --- a/batman-adv-devel/Config.in +++ b/batman-adv-devel/Config.in @@ -33,14 +33,3 @@ config KMOD_BATMAN_ADV_DEVEL_BATMAN_V bool "enable batman v routing algorithm" depends on PACKAGE_kmod-batman-adv-devel default y - -config KMOD_BATMAN_ADV_DEVEL_BATMAN_BRANCH - string - prompt "batman-adv branch to build package with" - depends on PACKAGE_kmod-batman-adv-devel - default "master" - help - Enter a batman-adv 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/batman-adv-devel/Makefile b/batman-adv-devel/Makefile index 108885b..bd2e1a7 100644 --- a/batman-adv-devel/Makefile +++ b/batman-adv-devel/Makefile @@ -9,13 +9,26 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv-devel
-PKG_BRANCH:=$(call qstrip,$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATMAN_BRANCH)) -PKG_BATMAN_SHORTREV:=$(shell git ls-remote https://git@git.open-mesh.org/batman-adv.git $(PKG_BRANCH) | cut -c1-7) -PKG_BATMAN_FNAME:=batman-adv-devel-$(PKG_BATMAN_SHORTREV).tar.gz -PKG_BATMAN_DIR:=batman-adv-$(PKG_BATMAN_SHORTREV) +ifdef CONFIG_batman-adv-devel_SOURCE_GIT + +PKG_BRANCH:=$(call qstrip,$(CONFIG_batman-adv-devel_BRANCH)) +PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_batman-adv-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_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_VERSION:=$(PKG_REV) + +endif + +ifdef CONFIG_batman-adv-devel_SOURCE_DIRECTORY + +PKG_REV:=0 +PKG_VERSION:=0.$(PKG_REV) + +endif
-PKG_SOURCE_URL:=https://git.open-mesh.org/snapshot/ -PKG_SOURCE:=$(PKG_BATMAN_FNAME) PKG_LICENSE:=GPL-2.0 PKG_EXTMOD_SUBDIRS=net/batman-adv
@@ -24,8 +37,6 @@ STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backpor include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/$(PKG_BATMAN_DIR) - define KernelPackage/batman-adv-devel URL:=https://www.open-mesh.org/ MAINTAINER:=Simon Wunderlich sw@simonwunderlich.de @@ -43,6 +54,7 @@ development version. endef
define KernelPackage/batman-adv-devel/config + source "$(SOURCE)/Config.devel.in" source "$(SOURCE)/Config.in" endef
@@ -73,7 +85,7 @@ NOSTDINC_FLAGS = \ -I$(PKG_BUILD_DIR)/include/ \ -include backport/backport.h \ -include $(PKG_BUILD_DIR)/compat-hacks.h \ - -DBATADV_SOURCE_VERSION=\"$(PKG_BATMAN_SHORTREV)\" \ + -DBATADV_SOURCE_VERSION=\"$(PKG_VERSION)\" \
COMPAT_SOURCES = \ $(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),../../compat-sources/net/core/skbuff.o,) \ @@ -92,6 +104,16 @@ define Build/Compile modules endef
+ifdef CONFIG_batman-adv-devel_SOURCE_DIRECTORY + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) $(CONFIG_batman-adv-devel_DIRECTORY)/* $(PKG_BUILD_DIR)/ + $(call Build/Prepare/Default) +endef + +endif + define KernelPackage/batman-adv-devel/install $(CP) ./files/. $(1)/ endef