From: Marek Lindner Date: Wed, 16 Jan 2008 19:15:46 +0000 (+0000) Subject: port batman package to batman 0.3 integrate batman kernel modul for tunneling TODO... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0818aeec49c264f94dc885ab7ae71d37e8a59788;p=openwrt%2Fsvn-archive%2Fpackages.git port batman package to batman 0.3 integrate batman kernel modul for tunneling TODO: batman svn is ssl only :( SVN-Revision: 10215 --- diff --git a/net/batman/Makefile b/net/batman/Makefile index dda6beac5..f5b4580fc 100644 --- a/net/batman/Makefile +++ b/net/batman/Makefile @@ -9,45 +9,84 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batmand -PKG_VERSION:=0.2-rv502 +PKG_REV:=949 +PKG_VERSION:=r$(PKG_REV) PKG_RELEASE:=1 +PKG_BRANCH:=batman -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)_sources -PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_sources.tgz -PKG_SOURCE_URL:=http://downloads.open-mesh.net/batman/stable/sources/ \ - http://downloads.open-mesh.net/batman/stable/sources/old/ -PKG_MD5SUM:=cf1c92ef3455cfbfedf2c577e013b6c0 - +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_BRANCH)d-$(PKG_VERSION) +PKG_SOURCE_URL:=https://dev.open-mesh.net/svn/batman/trunk/$(PKG_BRANCH) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install +PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/linux/modules + include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk -define Package/batman +define Package/batmand/Default SECTION:=net CATEGORY:=Network + URL:=https://www.open-mesh.net/ + MAINTAINER:=Marek Lindner +endef + +define Package/batmand +$(call Package/batmand/Default) DEPENDS:=+libpthread +kmod-tun TITLE:=B.A.T.M.A.N. Better Approach To Mobile Ad-hoc Networking - URL:=https://www.open-mesh.net/ endef -define Build/Configure +define Package/batmand/description +B.A.T.M.A.N. layer 3 routing daemon +endef + +define Package/batgat +$(call Package/batmand/Default) + DEPENDS:=batmand + TITLE:=B.A.T.M.A.N. gateway module + FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX) +endef + +define Package/batgat/description +Kernel gateway module for B.A.T.M.A.N. endef -MAKE_FLAGS += \ +MAKE_ARGS += \ CFLAGS="$(TARGET_CFLAGS)" \ CCFLAGS="$(TARGET_CFLAGS)" \ OFLAGS="$(TARGET_CFLAGS)" \ + CC="$(TARGET_CC)" \ NODEBUG=1 \ UNAME="Linux" \ INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ STRIP="/bin/true" \ batmand install -define Package/batman/install +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) + $(shell [ -e $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild ] && mv $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile) + $(MAKE) -C "$(LINUX_DIR)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + ARCH="$(LINUX_KARCH)" \ + PATH="$(TARGET_PATH)" \ + SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \ + LINUX_VERSION="$(LINUX_VERSION)" \ + REVISION="$(PKG_REV)" modules +endef + +define Package/batmand/install $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/ - $(INSTALL_BIN) ./files/etc/init.d/batman $(1)/etc/init.d - $(INSTALL_DATA) ./files/etc/config/batman $(1)/etc/config + $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d + $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config endef -$(eval $(call BuildPackage,batman)) +$(eval $(call BuildPackage,batmand)) +$(eval $(call BuildPackage,batgat)) diff --git a/net/batman/files/etc/config/batman b/net/batman/files/etc/config/batman deleted file mode 100644 index 15587bcca..000000000 --- a/net/batman/files/etc/config/batman +++ /dev/null @@ -1,8 +0,0 @@ -config batman general - option interface ath0 - option announce - option gateway_class - option originator_interval - option preferred_gateway - option routing_class - option visualisation_srv diff --git a/net/batman/files/etc/config/batmand b/net/batman/files/etc/config/batmand new file mode 100644 index 000000000..15587bcca --- /dev/null +++ b/net/batman/files/etc/config/batmand @@ -0,0 +1,8 @@ +config batman general + option interface ath0 + option announce + option gateway_class + option originator_interval + option preferred_gateway + option routing_class + option visualisation_srv diff --git a/net/batman/files/etc/init.d/batman b/net/batman/files/etc/init.d/batman deleted file mode 100644 index b0e9886c7..000000000 --- a/net/batman/files/etc/init.d/batman +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh /etc/rc.common -START=100 -. /lib/config/uci.sh -uci_load batman -start () { - interface=$(uci get batman.general.interface) - if [ "$interface" = "" ]; then - echo $1 Error, you must specify at least a network interface - exit - fi - announce=$(uci get batman.general.announce) - gateway_class=$(uci get batman.general.gateway_class) - originator_interval=$(uci get batman.general.originator_interval) - preferred_gateway=$(uci get batman.general.preferred_gateway) - routing_class=$(uci get batman.general.routing_class) - visualisation_srv=$(uci get batman.general.visualisation_srv) - batman_args="" - - if [ $announce ]; then - batman_args=${batman_args}'-a '$announce' ' - fi - - if [ $gateway_class ]; then - batman_args=${batman_args}'-g '$gateway_class' ' - fi - - if [ $originator_interval ]; then - batman_args=${batman_args}'-o '$originator_interval' ' - fi - - if [ $preferred_gateway ]; then - batman_args=${batman_args}'-p '$preferred_gateway' ' - fi - - if [ $routing_class ]; then - batman_args=${batman_args}'-r '$routing_class' ' - fi - - if [ $visualisation_srv ]; then - batman_args=${batman_args}'-s '$visualisation_srv' ' - fi - - batman_args=${batman_args}$interface - batmand $batman_args >/dev/null 2>&1 -} - -restart () { - $0 stop - sleep 3 - $0 start -} - -stop () { - killall batmand -} diff --git a/net/batman/files/etc/init.d/batmand b/net/batman/files/etc/init.d/batmand new file mode 100644 index 000000000..b0e9886c7 --- /dev/null +++ b/net/batman/files/etc/init.d/batmand @@ -0,0 +1,55 @@ +#!/bin/sh /etc/rc.common +START=100 +. /lib/config/uci.sh +uci_load batman +start () { + interface=$(uci get batman.general.interface) + if [ "$interface" = "" ]; then + echo $1 Error, you must specify at least a network interface + exit + fi + announce=$(uci get batman.general.announce) + gateway_class=$(uci get batman.general.gateway_class) + originator_interval=$(uci get batman.general.originator_interval) + preferred_gateway=$(uci get batman.general.preferred_gateway) + routing_class=$(uci get batman.general.routing_class) + visualisation_srv=$(uci get batman.general.visualisation_srv) + batman_args="" + + if [ $announce ]; then + batman_args=${batman_args}'-a '$announce' ' + fi + + if [ $gateway_class ]; then + batman_args=${batman_args}'-g '$gateway_class' ' + fi + + if [ $originator_interval ]; then + batman_args=${batman_args}'-o '$originator_interval' ' + fi + + if [ $preferred_gateway ]; then + batman_args=${batman_args}'-p '$preferred_gateway' ' + fi + + if [ $routing_class ]; then + batman_args=${batman_args}'-r '$routing_class' ' + fi + + if [ $visualisation_srv ]; then + batman_args=${batman_args}'-s '$visualisation_srv' ' + fi + + batman_args=${batman_args}$interface + batmand $batman_args >/dev/null 2>&1 +} + +restart () { + $0 stop + sleep 3 + $0 start +} + +stop () { + killall batmand +} diff --git a/net/batman/patches/100-makefile.patch b/net/batman/patches/100-makefile.patch deleted file mode 100644 index a46a59475..000000000 --- a/net/batman/patches/100-makefile.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: batmand_0.2-rv478_sources/Makefile -=================================================================== ---- batmand_0.2-rv478_sources.orig/Makefile 2007-07-31 14:26:18.000000000 -0500 -+++ batmand_0.2-rv478_sources/Makefile 2007-07-31 14:28:43.000000000 -0500 -@@ -21,6 +21,7 @@ - CFLAGS = -Wall -O1 -g3 -DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA - STRIP= strip - LDFLAGS = -lpthread -static -+SBINDIR = $(INSTALL_PREFIX)/usr/sbin - - CFLAGS_MIPS = -Wall -O1 -g3 - LDFLAGS_MIPS = -lpthread -@@ -264,3 +265,7 @@ - - clean-long: - rm -rf batmand_* -+ -+install: -+ mkdir -p $(SBINDIR) -+ install -m 0755 batmand $(SBINDIR)