contrib/package: switch to olsrd dyn_gw_plain plugin and enable it by default
[project/luci.git] / contrib / package / olsrd-luci / Makefile
1 #
2 # Copyright (C) 2008-2009 Freifunk Leipzig
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
10 include $(TOPDIR)/rules.mk
11
12 PKG_BASENAME:=olsrd
13 PKG_NAME:=$(PKG_BASENAME)-luci
14 PKG_VERSION:=0.5.6-r3+hg2227
15 PKG_RELEASE:=2
16
17 PKG_HGREV:=a7316f987848
18 PKG_SOURCE:=$(PKG_HGREV).tar.gz
19 PKG_SOURCE_URL:=http://gredler.at/hg/olsrd/archive
20 PKG_MD5SUM:=b228b5452af158cd4313f9ed416d9c84
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_HGREV)
22 PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
23
24 #PKG_SOURCE:=$(PKG_BASENAME)-$(PKG_VERSION).tar.bz2
25 #PKG_SOURCE_URL:=http://www.olsr.org/releases/0.5
26 #PKG_MD5SUM:=0935688fa0fb5b0e073fe53ec654c5b2
27 #PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
28 #PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xjf $(DL_DIR)/$(PKG_SOURCE)
29
30 include $(INCLUDE_DIR)/package.mk
31
32
33 define Package/olsrd-luci/common_info
34         SECTION:=net
35         CATEGORY:=Network
36         TITLE:=OLSR - Optimized Link State Routing Daemon
37         URL:=http://www.olsr.org/
38         MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
39 endef
40
41 define Package/olsrd-luci
42         $(call Package/olsrd-luci/common_info)
43         MENU:=1
44         DEPENDS:=+libpthread
45 endef
46
47 define Package/olsrd-luci/conffiles
48 /etc/config/olsrd
49 endef
50
51 define Package/olsrd-luci-mod-arprefresh
52         $(call Package/olsrd-luci/common_info)
53         MENU:=1
54         TITLE:=OLSR - ARP Refresh Plugin
55         DEPENDS:=olsrd-luci
56 endef
57
58 define Package/olsrd-luci-mod-dot-draw
59         $(call Package/olsrd-luci/common_info)
60         MENU:=1
61         TITLE:=OLSR - Dot Draw Plugin
62         DEPENDS:=olsrd-luci
63 endef
64
65 define Package/olsrd-luci-mod-bmf
66         $(call Package/olsrd-luci/common_info)
67         MENU:=1
68         TITLE:=OLSR - Basic Multicast Forwarding Plugin
69         DEPENDS:=olsrd-luci +kmod-tun
70 endef
71
72 define Package/olsrd-luci-mod-dyn-gw
73         $(call Package/olsrd-luci/common_info)
74         MENU:=1
75         TITLE:=OLSR - Dynamic Gateway Plugin
76         DEPENDS:=olsrd-luci
77 endef
78
79 define Package/olsrd-luci-mod-dyn-gw-plain
80         $(call Package/olsrd-luci/common_info)
81         MENU:=1
82         TITLE:=OLSR - Dynamic Gateway Plugin (Plain Version)
83         DEPENDS:=olsrd-luci
84 endef
85
86 define Package/olsrd-luci-mod-httpinfo
87         $(call Package/olsrd-luci/common_info)
88         MENU:=1
89         TITLE:=OLSR - HTTP/HTML Info Plugin
90         DEPENDS:=olsrd-luci
91 endef
92
93 define Package/olsrd-luci-mod-nameservice
94         $(call Package/olsrd-luci/common_info)
95         MENU:=1
96         TITLE:=OLSR - Hostname Propagation Plugin
97         DEPENDS:=olsrd-luci
98 endef
99
100 define Package/olsrd-luci-mod-secure
101         $(call Package/olsrd-luci/common_info)
102         MENU:=1
103         TITLE:=OLSR - Security Extensions Plugin
104         DEPENDS:=olsrd-luci
105 endef
106
107 define Package/olsrd-luci-mod-txtinfo
108         $(call Package/olsrd-luci/common_info)
109         MENU:=1
110         TITLE:=OLSR - HTTP/Plaintext Info Plugin
111         DEPENDS:=olsrd-luci
112 endef
113
114 define Package/olsrd-luci-mod-quagga
115         $(call Package/olsrd-luci/common_info)
116         MENU:=1
117         TITLE:=OLSR - Quagga Plugin
118         DEPENDS:=olsrd-luci
119 endef
120
121 TARGET_CFLAGS += $(FPIC)
122
123 define Build/Compile
124         $(MAKE) -C "$(PKG_BUILD_DIR)" olsrd libs \
125                 $(TARGET_CONFIGURE_OPTS) \
126                 NODEBUG=1 \
127                 CFLAGS="$(TARGET_CFLAGS)" \
128                 OS="linux" \
129                 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
130                 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
131                 SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin/" \
132                 ETCDIR="$(PKG_INSTALL_DIR)/etc" \
133                 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
134                 STRIP="true" \
135                 INSTALL_LIB="true" \
136                 SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo nameservice secure txtinfo quagga"
137 endef
138
139 define Package/olsrd-luci/install
140         $(INSTALL_DIR) $(1)/usr/sbin
141         $(INSTALL_DIR) $(1)/etc/config
142         $(INSTALL_DIR) $(1)/etc/init.d
143         $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
144         $(INSTALL_BIN) ./files/etc/init.d/olsrd $(1)/etc/init.d/
145         $(INSTALL_CONF) ./files/etc/config/olsrd $(1)/etc/config/
146 endef
147
148 define Package/olsrd-luci-mod-arprefresh/install
149         $(INSTALL_DIR) $(1)/usr/lib
150         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/
151 endef
152
153 define Package/olsrd-luci-mod-dot-draw/install
154         $(INSTALL_DIR) $(1)/usr/lib
155         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
156 endef
157
158 define Package/olsrd-luci-mod-bmf/install
159         $(INSTALL_DIR) $(1)/usr/lib
160         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/
161 endef
162
163 define Package/olsrd-luci-mod-dyn-gw/install
164         $(INSTALL_DIR) $(1)/usr/lib
165         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/
166 endef
167
168 define Package/olsrd-luci-mod-dyn-gw-plain/install
169         $(INSTALL_DIR) $(1)/usr/lib
170         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.* $(1)/usr/lib/
171 endef
172
173 define Package/olsrd-luci-mod-httpinfo/install
174         $(INSTALL_DIR) $(1)/usr/lib
175         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/
176 endef
177
178 define Package/olsrd-luci-mod-nameservice/install
179         $(INSTALL_DIR) $(1)/usr/lib
180         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/
181 endef
182
183 define Package/olsrd-luci-mod-secure/install
184         $(INSTALL_DIR) $(1)/usr/lib
185         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/
186 endef
187
188 define Package/olsrd-luci-mod-txtinfo/install
189         $(INSTALL_DIR) $(1)/usr/lib
190         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/
191 endef
192
193 define Package/olsrd-luci-mod-quagga/install
194         $(INSTALL_DIR) $(1)/usr/lib
195         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/quagga/olsrd_quagga.so.* $(1)/usr/lib/
196 endef
197
198
199 $(eval $(call BuildPackage,olsrd-luci))
200 $(eval $(call BuildPackage,olsrd-luci-mod-arprefresh))
201 $(eval $(call BuildPackage,olsrd-luci-mod-dot-draw))
202 $(eval $(call BuildPackage,olsrd-luci-mod-bmf))
203 $(eval $(call BuildPackage,olsrd-luci-mod-dyn-gw))
204 $(eval $(call BuildPackage,olsrd-luci-mod-dyn-gw-plain))
205 $(eval $(call BuildPackage,olsrd-luci-mod-httpinfo))
206 $(eval $(call BuildPackage,olsrd-luci-mod-nameservice))
207 $(eval $(call BuildPackage,olsrd-luci-mod-secure))
208 $(eval $(call BuildPackage,olsrd-luci-mod-txtinfo))
209 $(eval $(call BuildPackage,olsrd-luci-mod-quagga))