c0ccf46d283b2abd71cae8a72edc63feb105e766
[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)+hg1765
16 PKG_RELEASE:=1
17
18 PKG_HGREV:=fc691af9a18d
19 PKG_SOURCE:=$(PKG_HGREV).tar.gz
20 PKG_SOURCE_URL:=http://gredler.at/hg/olsrd-0.5.6/archive
21 PKG_MD5SUM:=17fe345abf208ea1411d0a2041cf3c4e
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 TARGET_CFLAGS += $(FPIC)
123
124 define Build/Compile
125         $(MAKE) -C "$(PKG_BUILD_DIR)" olsrd libs \
126                 $(TARGET_CONFIGURE_OPTS) \
127                 NODEBUG=1 \
128                 CFLAGS="$(TARGET_CFLAGS) -DSVEN_OLA_UNBLOAT" \
129                 OS="linux" \
130                 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
131                 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
132                 SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin/" \
133                 ETCDIR="$(PKG_INSTALL_DIR)/etc" \
134                 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
135                 STRIP="true" \
136                 INSTALL_LIB="true" \
137                 SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo nameservice secure txtinfo quagga"
138 endef
139
140 define Package/olsrd-luci/install
141         $(INSTALL_DIR) $(1)/usr/sbin
142         $(INSTALL_DIR) $(1)/etc/config
143         $(INSTALL_DIR) $(1)/etc/init.d
144         $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
145         $(INSTALL_BIN) ./files/etc/init.d/olsrd $(1)/etc/init.d/
146         $(INSTALL_CONF) ./files/etc/config/olsrd $(1)/etc/config/
147 endef
148
149 define Package/olsrd-luci-mod-arprefresh/install
150         $(INSTALL_DIR) $(1)/usr/lib
151         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/
152 endef
153
154 define Package/olsrd-luci-mod-dot-draw/install
155         $(INSTALL_DIR) $(1)/usr/lib
156         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
157 endef
158
159 define Package/olsrd-luci-mod-bmf/install
160         $(INSTALL_DIR) $(1)/usr/lib
161         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/
162 endef
163
164 define Package/olsrd-luci-mod-dyn-gw/install
165         $(INSTALL_DIR) $(1)/usr/lib
166         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/
167 endef
168
169 define Package/olsrd-luci-mod-dyn-gw-plain/install
170         $(INSTALL_DIR) $(1)/usr/lib
171         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.* $(1)/usr/lib/
172 endef
173
174 define Package/olsrd-luci-mod-httpinfo/install
175         $(INSTALL_DIR) $(1)/usr/lib
176         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/
177 endef
178
179 define Package/olsrd-luci-mod-nameservice/install
180         $(INSTALL_DIR) $(1)/usr/lib
181         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/
182 endef
183
184 define Package/olsrd-luci-mod-secure/install
185         $(INSTALL_DIR) $(1)/usr/lib
186         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/
187 endef
188
189 define Package/olsrd-luci-mod-txtinfo/install
190         $(INSTALL_DIR) $(1)/usr/lib
191         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/
192 endef
193
194 define Package/olsrd-luci-mod-quagga/install
195         $(INSTALL_DIR) $(1)/usr/lib
196         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/quagga/olsrd_quagga.so.* $(1)/usr/lib/
197 endef
198
199
200 $(eval $(call BuildPackage,olsrd-luci))
201 $(eval $(call BuildPackage,olsrd-luci-mod-arprefresh))
202 $(eval $(call BuildPackage,olsrd-luci-mod-dot-draw))
203 $(eval $(call BuildPackage,olsrd-luci-mod-bmf))
204 $(eval $(call BuildPackage,olsrd-luci-mod-dyn-gw))
205 $(eval $(call BuildPackage,olsrd-luci-mod-dyn-gw-plain))
206 $(eval $(call BuildPackage,olsrd-luci-mod-httpinfo))
207 $(eval $(call BuildPackage,olsrd-luci-mod-nameservice))
208 $(eval $(call BuildPackage,olsrd-luci-mod-secure))
209 $(eval $(call BuildPackage,olsrd-luci-mod-txtinfo))
210 $(eval $(call BuildPackage,olsrd-luci-mod-quagga))