batman: switch to a more recent trunk version, which fixes the build for 2.6.26....
[openwrt/svn-archive/archive.git] / net / batman / Makefile
1 #
2 # Copyright (C) 2008 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$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=batmand
13 PKG_REV:=1105
14 PKG_VERSION:=r$(PKG_REV)
15 PKG_RELEASE:=1
16 #PKG_BRANCH:=batman-0.3
17
18 PKG_SOURCE_PROTO:=svn
19 PKG_SOURCE_VERSION:=$(PKG_REV)
20 PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),$(PKG_NAME))-$(PKG_VERSION)
21 PKG_SOURCE_URL:=http://downloads.open-mesh.net/svn/batman/$(if $(PKG_BRANCH),tags/$(PKG_BRANCH),trunk/batman/)
22 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
23 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26 PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/linux/modules
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/batmand/Default
31 URL:=https://www.open-mesh.net/
32 MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
33 endef
34
35 define Package/batmand
36 $(call Package/batmand/Default)
37 SECTION:=net
38 CATEGORY:=Network
39 DEPENDS:=+libpthread +kmod-tun
40 TITLE:=B.A.T.M.A.N. layer 3 routing daemon
41 endef
42
43 define Package/batmand/description
44 B.A.T.M.A.N. layer 3 routing daemon
45 endef
46
47 define KernelPackage/batgat
48 $(call Package/batmand/Default)
49 SUBMENU:=Network Support
50 DEPENDS:=+batmand
51 TITLE:=B.A.T.M.A.N. gateway module
52 FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX)
53 AUTOLOAD:=$(call AutoLoad,50,batgat)
54 endef
55
56
57 define KernelPackage/batgat/description
58 Kernel gateway module for B.A.T.M.A.N.
59 endef
60
61 MAKE_ARGS += \
62 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
63 CCFLAGS="$(TARGET_CFLAGS)" \
64 OFLAGS="$(TARGET_CFLAGS)" \
65 REVISION="$(PKG_REV)" \
66 CC="$(TARGET_CC)" \
67 NODEBUG=1 \
68 UNAME="Linux" \
69 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
70 STRIP="/bin/true" \
71 batmand install
72
73 define Build/Configure
74 endef
75
76 define Build/Compile
77 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
78 cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
79 $(MAKE) -C "$(LINUX_DIR)" \
80 CROSS_COMPILE="$(TARGET_CROSS)" \
81 ARCH="$(LINUX_KARCH)" \
82 PATH="$(TARGET_PATH)" \
83 SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
84 LINUX_VERSION="$(LINUX_VERSION)" \
85 REVISION="$(PKG_REV)" modules
86 endef
87
88 define Package/batmand/install
89 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
90 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/
91 $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d
92 $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config
93 endef
94
95 $(eval $(call BuildPackage,batmand))
96 $(eval $(call KernelPackage,batgat))