DESCRIPTION:= is obselete
[packages.git] / net / click / Makefile
1 # Copyright (C) 2006 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6 # $Id$
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=click
11 PKG_VERSION:=cvs.2006.03.02
12 PKG_RELEASE:=1
13 PKG_MD5SUM:=7aed4ba94926010d76febb797b288e98
14
15 ROOFNET_VERSION:=0.0.1
16
17 PKG_SOURCE_URL:=http://pdos.csail.mit.edu/~jbicket/click_snapshots/
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/click
27   SECTION:=net
28   CATEGORY:=Network
29   DEPENDS:=@BROKEN
30   MENU:=1
31   TITLE:=The Click Modular Router
32   URL:=http://www.read.cs.ucla.edu/click/
33 endef
34
35 define Package/click/description
36 The Click Modular Router
37 endef
38
39 define Package/roofnet
40   SECTION:=net
41   CATEGORY:=Network
42   DEPENDS:=@BROKEN click
43   TITLE:=roofnet mesh networking scripts
44   URL:=http://pdos.csail.mit.edu/roofnet/
45 endef
46
47 define Package/roofnet/description
48 roofnet mesh networking scripts
49 endef
50
51 BUILDOPTS = \
52                 BUILD_CXX="g++ -I $(PKG_BUILD_DIR)/include-host" \
53                 BUILD_DL_LIBS="-ldl"
54
55 define Build/Configure
56         (cd $(PKG_BUILD_DIR); \
57                 rm -rf config.{cache,status} ; \
58                 CONFIG_SITE= \
59                 ./configure; \
60                 rm -rf include-host; \
61                 $(CP) include include-host; \
62                 rm -rf config.{cache,status} ; \
63                 $(TARGET_CONFIGURE_OPTS) \
64                 CXXFLAGS="-static -Os -MD" \
65                 CFLAGS="-static -MD" \
66                 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
67                 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
68                 $(BUILDOPTS) \
69                 ./configure \
70                   --prefix=/usr \
71                   --target=$(GNU_TARGET_NAME) \
72                   --host=$(GNU_TARGET_NAME) \
73                   --build=$(GNU_HOST_NAME) \
74                   --enable-wifi \
75                   --disable-linuxmodule \
76                   --enable-tools=mixed \
77                   --disable-dynamic-linking \
78         )
79 endef
80
81
82 define Build/Compile
83         rm -rf $(PKG_INSTALL_DIR)
84         mkdir -p $(PKG_INSTALL_DIR)
85         $(CONF_OPTS) \
86         $(MAKE) -C $(PKG_BUILD_DIR) \
87                 $(BUILDOPTS) \
88                 tools elementmap.xml
89         (cd $(PKG_BUILD_DIR)/userlevel; \
90                 ../tools/click-mkmindriver/click-mkmindriver -p roofnet -C .. \
91                         -f $(PKG_BUILD_DIR)/conf/wifi/sample.click \
92                         -A --all -E IPNameInfo -E FromHost -E ToHost -E Discard; \
93                 $(MAKE) -f Makefile.roofnet; \
94         )
95 endef
96
97 define Package/click/install
98         $(INSTALL_DIR) $(1)/usr/bin
99         $(CP) $(PKG_BUILD_DIR)/userlevel/roofnetclick $(1)/usr/bin/click 
100         $(CP) $(PKG_BUILD_DIR)/tools/click-align/click-align $(1)/usr/bin/click-align
101 endef
102
103 define Package/roofnet/install
104         $(INSTALL_DIR) $(1)/usr/bin
105         $(CP) $(PKG_BUILD_DIR)/conf/wifi/gen_config_roofnet.sh $(1)/usr/bin
106         $(CP) $(PKG_BUILD_DIR)/conf/wifi/srcr.click $(1)/usr/bin
107         $(CP) $(PKG_BUILD_DIR)/conf/wifi/read_handler $(1)/usr/bin
108         $(CP) $(PKG_BUILD_DIR)/conf/wifi/write_handler $(1)/usr/bin
109         mkdir -p $(1)/etc/init.d
110         $(INSTALL_BIN) ./files/roofnet.init $(1)/etc/init.d/roofnet
111 endef
112
113 $(eval $(call BuildPackage,click))
114 $(eval $(call BuildPackage,roofnet))