[packages] add preliminary freeswitch v1.0.4 package (closes: #4891)
[openwrt/svn-archive/archive.git] / net / batman-advanced / 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: Makefile 5624 2006-11-23 00:29:07Z nbd $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=batman-adv
12 PKG_REV:=1334
13 PKG_VERSION:=r$(PKG_REV)
14 PKG_RELEASE:=1
15
16 PKG_SOURCE_PROTO:=svn
17 PKG_SOURCE_VERSION:=$(PKG_REV)
18 PKG_SOURCE_SUBDIR:=batman-adv-$(PKG_VERSION)
19 PKG_SOURCE_URL:=http://downloads.open-mesh.net/svn/batman/trunk/
20 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
22
23 PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman-adv-kernelland
24
25 PKG_TOOL_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-batctl-install
26 PKG_TOOL_BUILD_DIR:=$(PKG_BUILD_DIR)/batctl
27
28 include $(INCLUDE_DIR)/package.mk
29 include $(INCLUDE_DIR)/kernel.mk
30
31 define Package/batman-adv/Default
32 URL:=http://www.open-mesh.net/
33 MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
34 endef
35
36 define KernelPackage/batman-adv-kernelland
37 $(call Package/batman-adv/Default)
38 SUBMENU:=Network Support
39 DEPENDS:=@LINUX_2_6
40 TITLE:=B.A.T.M.A.N. layer 2
41 FILES:=$(PKG_KMOD_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
42 AUTOLOAD:=$(call AutoLoad,50,batman-adv)
43 endef
44
45
46 define KernelPackage/batman-adv-kernelland/description
47 B.A.T.M.A.N. layer 2
48 endef
49
50 MAKE_BATADV_KERNELLAND_ARGS += \
51 CROSS_COMPILE="$(TARGET_CROSS)" \
52 ARCH="$(LINUX_KARCH)" \
53 PATH="$(TARGET_PATH)" \
54 SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
55 LINUX_VERSION="$(LINUX_VERSION)" \
56 REVISION="$(PKG_REV)" modules
57
58 MAKE_BATCTL_ARGS += \
59 CFLAGS="$(TARGET_CFLAGS)" \
60 CCFLAGS="$(TARGET_CFLAGS)" \
61 OFLAGS="$(TARGET_CFLAGS)" \
62 REVISION="$(PKG_REV)" \
63 CC="$(TARGET_CC)" \
64 NODEBUG=1 \
65 UNAME="Linux" \
66 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
67 STRIP="/bin/true" \
68 batctl install
69
70 define Build/Configure
71 endef
72
73 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batman-adv-kernelland),)
74 BUILD_KMOD_ADV = $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATADV_KERNELLAND_ARGS)
75 endif
76
77 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batman-adv-kernelland),)
78 BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
79 endif
80
81 define Build/Compile
82 cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
83 $(BUILD_KMOD_ADV)
84 $(BUILD_BATCTL)
85 endef
86
87 define KernelPackage/batman-adv-kernelland/install
88 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin
89 $(INSTALL_BIN) ./files/etc/init.d/batman-adv-kernelland $(1)/etc/init.d
90 $(INSTALL_DATA) ./files/etc/config/batman-adv-kernelland $(1)/etc/config
91 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
92 endef
93
94 $(eval $(call KernelPackage,batman-adv-kernelland))