batman-adv: upgrade package to latest release (2011.1.0)
[openwrt/svn-archive/archive.git] / net / batman-adv / Makefile
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=batman-adv
12
13 PKG_VERSION:=2011.1.0
14 PKG_MD5SUM:=a05a3ff72bbc12859539f6a9e14af098
15 BATCTL_MD5SUM:=d3c7cca45c223a0ab80373fcb434dd5e
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_TOOL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/batctl-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/kernel.mk
25
26 define KernelPackage/batman-adv
27 URL:=http://www.open-mesh.org/
28 MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
29 SUBMENU:=Network Support
30 DEPENDS:=@!LINUX_2_4
31 TITLE:=B.A.T.M.A.N. Adv
32 FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
33 AUTOLOAD:=$(call AutoLoad,50,batman-adv)
34 endef
35
36 define KernelPackage/batman-adv/description
37 B.A.T.M.A.N. advanced is a kernel module which allows to
38 build layer 2 mesh networks. This package contains the
39 version $(PKG_VERSION) of the kernel module plus its user space
40 configuration & managerment tool batctl.
41 endef
42
43 define KernelPackage/batman-adv/config
44 source "$(SOURCE)/Config.in"
45 endef
46
47 MAKE_BATMAN_ADV_ARGS += \
48 CROSS_COMPILE="$(TARGET_CROSS)" \
49 ARCH="$(LINUX_KARCH)" \
50 PATH="$(TARGET_PATH)" \
51 $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
52 SUBDIRS="$(PKG_BUILD_DIR)" \
53 LINUX_VERSION="$(LINUX_VERSION)" \
54 REVISION="" modules
55
56 MAKE_BATCTL_ARGS += \
57 CFLAGS="$(TARGET_CFLAGS)" \
58 CCFLAGS="$(TARGET_CFLAGS)" \
59 OFLAGS="$(TARGET_CFLAGS)" \
60 REVISION="" \
61 CC="$(TARGET_CC)" \
62 NODEBUG=1 \
63 UNAME="Linux" \
64 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
65 STRIP="/bin/true" \
66 batctl install
67
68 ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
69 define Download/batctl
70 FILE:=batctl-$(PKG_VERSION).tar.gz
71 URL:=$(PKG_SOURCE_URL)
72 MD5SUM:=$(BATCTL_MD5SUM)
73 endef
74 $(eval $(call Download,batctl))
75
76 BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
77 endif
78
79 define Build/Compile
80 tar xzf "$(DL_DIR)/batctl-$(PKG_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)"
81 cp $(PKG_BUILD_DIR)/Makefile.kbuild $(PKG_BUILD_DIR)/Makefile
82 $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATMAN_ADV_ARGS)
83 $(BUILD_BATCTL)
84 endef
85
86 define Build/Clean
87 rm -rf $(BUILD_DIR)/$(PKG_NAME)/
88 endef
89
90 ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
91 define KernelPackage/batman-adv/install
92 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
93 $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
94 $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
95 $(INSTALL_DIR) $(1)/usr/sbin
96 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
97 endef
98 else
99 define KernelPackage/batman-adv/install
100 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
101 $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
102 $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
103 endef
104 endif
105
106 $(eval $(call KernelPackage,batman-adv))