47892ca763745e122253a443d429eda7c2c4f84a
[packages.git] / net / wing / Makefile
1 #
2 # Copyright (C) 2006-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=wing
11 PKG_VERSION:=20110709
12 PKG_RELEASE:=1
13 PKG_REV:=6aaea18b8e199781dc600681882cb2648f43ec38
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=git://github.com/rriggio/click.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=$(PKG_REV)
19 PKG_SOURCE_PROTO:=git
20
21 PKG_BUILD_DEPENDS:=wing/host
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/host-build.mk
25
26 define Package/wing
27         TITLE:=Wireless mesh networking toolkit
28         SECTION:=net
29         CATEGORY:=Network
30         MAINTAINER:=Roberto Riggio <roberto.riggio@create-net.org>
31         DEPENDS:=+kmod-tun +libpcap +libstdcpp
32         URL:=http://www.wing-project.org/
33 endef
34
35 define Package/wing/Description
36         Wing is a wireless mesh routing software. The routing protocol
37         is derived from Roofnet. It supports multiple radio interfaces
38         and link quality routing using the ETX, ETT, or WCETT metric.
39 endef
40
41 EXTRA_CFLAGS=-MD
42
43 CONFIGURE_ARGS += \
44         --enable-tools=host \
45         --enable-userlevel \
46         --enable-wifi \
47         --disable-linuxmodule \
48         --disable-dynamic-linking \
49
50 HOST_CONFIGURE_ARGS += \
51         --enable-userlevel \
52         --enable-wifi \
53         --disable-linuxmodule \
54
55 define Host/Compile
56         $(call Host/Install/Default, tools elementmap.xml install)
57 endef
58
59 define Build/Compile
60         (cd $(PKG_BUILD_DIR)/userlevel; \
61                 $(STAGING_DIR_HOST)/bin/click-mkmindriver -p $(PKG_NAME) -C $(STAGING_DIR_HOST) \
62                 -f $(PKG_BUILD_DIR)/conf/wing/sample.click \
63                 -A --all -E Discard -E Print -E PrintWifi -E Strip -E Null \
64                 -E InfiniteSource -E RatedSource -E EtherEncap -E UDPIPEncap \
65                 -E RadiotapEncapHT -E SetTXRateHT \
66                 -E WINGETTMetric -E WINGETXMetric -E WINGHopCountMetric \
67                 -E ProbeTXRate -E MadwifiRate -E AutoRateFallback -E Minstrel \
68                 -E FairBuffer -E DeAggregator -E DWRRSched -E WFQSched -E WRRSched; \
69         );
70         $(call Build/Install/Default, MINDRIVER=$(PKG_NAME) install)
71 endef
72
73 define Package/wing/install
74         $(INSTALL_DIR) $(1)/usr/bin
75         $(INSTALL_DIR) $(1)/etc/wing
76         $(INSTALL_DIR) $(1)/usr/share/click
77         $(CP) ./files/* $(1)/
78         $(CP) $(PKG_BUILD_DIR)/conf/wing/click_config $(1)/usr/bin/
79         $(CP) $(PKG_BUILD_DIR)/conf/wing/write_handler $(1)/usr/bin/
80         $(CP) $(PKG_BUILD_DIR)/conf/wing/read_handler $(1)/usr/bin/
81         $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)click $(1)/usr/bin/click
82         $(CP) $(PKG_INSTALL_DIR)/usr/bin/click-align $(1)/usr/bin/click-align
83         $(CP) $(PKG_BUILD_DIR)/conf/wing/*click $(1)/etc/wing/
84         $(CP) $(PKG_INSTALL_DIR)/usr/share/click/elementmap.xml $(1)/usr/share/click/elementmap.xml
85 endef
86
87 $(eval $(call HostBuild))
88 $(eval $(call BuildPackage,wing))
89