source: packages/net/batman-adv/Makefile @ 27268

Last change on this file since 27268 was 27268, checked in by marek, 5 years ago

batman-adv: upgrade package to latest release (2011.2.0)

File size: 3.4 KB
Line 
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
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=batman-adv
12
13PKG_VERSION:=2011.2.0
14PKG_MD5SUM:=1ef45406201913cc08ac01e47ad2d034
15BATCTL_MD5SUM:=69e7fe915f2c1867b74e6efe7c627dd5
16
17PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
19
20PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
21PKG_TOOL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/batctl-$(PKG_VERSION)
22
23include $(INCLUDE_DIR)/package.mk
24include $(INCLUDE_DIR)/kernel.mk
25
26define 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)
34endef
35
36define KernelPackage/batman-adv/description
37B.A.T.M.A.N. advanced is a kernel module which allows to
38build layer 2 mesh networks. This package contains the
39version $(PKG_VERSION) of the kernel module plus its user space
40configuration & managerment tool batctl.
41endef
42
43define KernelPackage/batman-adv/config
44        source "$(SOURCE)/Config.in"
45endef
46
47MAKE_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
56MAKE_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
68ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
69define Download/batctl
70  FILE:=batctl-$(PKG_VERSION).tar.gz
71  URL:=$(PKG_SOURCE_URL)
72  MD5SUM:=$(BATCTL_MD5SUM)
73endef
74$(eval $(call Download,batctl))
75
76EXTRACT_BATCTL = tar xzf "$(DL_DIR)/batctl-$(PKG_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)"
77PATCH_BATCTL = $(call Build/DoPatch,"$(PKG_BATCTL_BUILD_DIR)","$(PATCH_DIR)","*batctl*")
78BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
79endif
80
81define Build/DoPatch
82        @if [ -d "$(2)" ]; then \
83                if [ "$$$$(ls $(2) | grep -Ec $(3))" -gt 0 ]; then \
84                        $(PATCH) "$(1)" "$(2)" "$(3)"; \
85                fi; \
86        fi
87endef
88
89define Build/Patch
90        $(call Build/DoPatch,"$(PKG_BUILD_DIR)","$(PATCH_DIR)","*batman*")
91        $(EXTRACT_BATCTL)
92        $(PATCH_BATCTL)
93endef
94
95define Build/Compile
96        cp $(PKG_BUILD_DIR)/Makefile.kbuild $(PKG_BUILD_DIR)/Makefile
97        $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATMAN_ADV_ARGS)
98        $(BUILD_BATCTL)
99endef
100
101define Build/Clean
102        rm -rf $(BUILD_DIR)/$(PKG_NAME)/
103endef
104
105ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
106define KernelPackage/batman-adv/install
107        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
108        $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
109        $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
110        $(INSTALL_DIR) $(1)/usr/sbin
111        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
112endef
113else
114define KernelPackage/batman-adv/install
115        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
116        $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
117        $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
118endef
119endif
120
121$(eval $(call KernelPackage,batman-adv))
Note: See TracBrowser for help on using the repository browser.