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