add B.A.T.M.A.N. from #1448

git-svn-id: svn://svn.openwrt.org/openwrt/packages@6592 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
thepeople 2007-03-17 03:59:59 +00:00
parent 3a7be611d5
commit 7742429af9
4 changed files with 138 additions and 0 deletions

57
net/batman/Makefile Normal file
View File

@ -0,0 +1,57 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
include $(TOPDIR)/rules.mk
PKG_NAME:=batman-III
PKG_VERSION:=0.2.0a
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tbz2
PKG_SOURCE_URL:=http://downloads.open-mesh.net/batman
PKG_MD5SUM:=d5ac8329633590ed072a6b7ecccacf0b
PKG_CAT:=bzcat
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(INCLUDE_DIR)/package.mk
define Package/batman
SECTION:=net
CATEGORY:=Network
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
endef
define Build/Compile
rm -rf $(PKG_INSTALL_DIR)
mkdir -p $(PKG_INSTALL_DIR)
$(MAKE) -C "$(PKG_BUILD_DIR)" \
$(TARGET_CONFIGURE_OPTS) \
NODEBUG=1 \
OFLAGS="$(TARGET_CFLAGS)" \
OS="linux" \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
STRIP="/bin/true" \
batmand install
endef
define Package/batman/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/
$(CP) -a ./files/* $(1)/
chmod -R 755 $(1)/etc/init.d/batman
endef
$(eval $(call BuildPackage,batman))

View File

@ -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

View File

@ -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}'-v '$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
}

View File

@ -0,0 +1,18 @@
--- batman-III-0.2.0a.old/Makefile 2007-02-28 15:41:11.000000000 +0100
+++ batman-III-0.2.0a/Makefile 2007-02-28 15:42:02.000000000 +0100
@@ -27,6 +27,7 @@
CFLAGS = -Wall -O0 -g3
LDFLAGS = -lpthread
#LDFLAGS = -static -lpthread
+SBINDIR = $(INSTALL_PREFIX)/usr/sbin
UNAME=$(shell uname)
@@ -67,3 +68,7 @@
clean:
rm -f batmand batmand-mips* *.o *~
+
+install:
+ mkdir -p $(SBINDIR)
+ install -m 755 batmand $(SBINDIR)