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