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 <lindner_marek@yahoo.de>
+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))
+++ /dev/null
-config batman general
- option interface ath0
- option announce
- option gateway_class
- option originator_interval
- option preferred_gateway
- option routing_class
- option visualisation_srv
--- /dev/null
+config batman general
+ option interface ath0
+ option announce
+ option gateway_class
+ option originator_interval
+ option preferred_gateway
+ option routing_class
+ option visualisation_srv
+++ /dev/null
-#!/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
-}
--- /dev/null
+#!/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
+}
+++ /dev/null
-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)