5cd9899939f962b48cc9fa033ae10d9e1b4c4f91
[openwrt/svn-archive/archive.git] / net / olsrd / Makefile
1 #
2 # Copyright (C) 2008 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:=olsrd
11 PKG_VERSION:=0.5.6-r4
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.5
16 PKG_MD5SUM:=16076660413bcf625ba8772fdb3d607f
17
18 include $(INCLUDE_DIR)/package.mk
19
20 TARGET_CFLAGS += $(FPIC)
21
22 define Package/olsrd/template
23 SECTION:=net
24 CATEGORY:=Network
25 TITLE:=OLSR (Optimized Link State Routing) daemon
26 URL:=http://www.olsr.org/
27 endef
28
29 define Package/olsrd
30 $(call Package/olsrd/template)
31 MENU:=1
32 DEPENDS:=+libpthread
33 endef
34
35 define Package/olsrd/conffiles
36 /etc/config/olsrd
37 endef
38
39 define Package/olsrd-mod-arprefresh
40 $(call Package/olsrd/template)
41 DEPENDS:=olsrd
42 TITLE:=Kernel ARP cache refresh plugin
43 endef
44
45 define Package/olsrd-mod-dot-draw
46 $(call Package/olsrd/template)
47 DEPENDS:=olsrd
48 TITLE:=Dot topology information plugin
49 endef
50
51 define Package/olsrd-mod-bmf
52 $(call Package/olsrd/template)
53 DEPENDS:=olsrd +kmod-tun
54 TITLE:=Basic multicast forwarding plugin
55 endef
56
57 define Package/olsrd-mod-dyn-gw
58 $(call Package/olsrd/template)
59 DEPENDS:=olsrd
60 TITLE:=Dynamic internet gateway plugin
61 endef
62
63 define Package/olsrd-mod-dyn-gw-plain
64 $(call Package/olsrd/template)
65 DEPENDS:=olsrd
66 TITLE:=Dynamic internet gateway plain plugin
67 endef
68
69 define Package/olsrd-mod-httpinfo
70 $(call Package/olsrd/template)
71 DEPENDS:=olsrd
72 TITLE:=Small informative web server plugin
73 endef
74
75 define Package/olsrd-mod-nameservice
76 $(call Package/olsrd/template)
77 DEPENDS:=olsrd
78 TITLE:=Lightweight hostname resolver plugin
79 endef
80
81 define Package/olsrd-mod-quagga
82 $(call Package/olsrd/template)
83 DEPENDS:=olsrd
84 TITLE:=Quagga plugin
85 endef
86
87 define Package/olsrd-mod-secure
88 $(call Package/olsrd/template)
89 DEPENDS:=olsrd
90 TITLE:=Message signing plugin to secure routing domain
91 endef
92
93 define Package/olsrd-mod-txtinfo
94 $(call Package/olsrd/template)
95 DEPENDS:=olsrd
96 TITLE:=Small informative web server plugin
97 endef
98
99 define Package/olsrd-mod-secure/conffiles
100 /etc/olsrd.d/olsrd_secure_key
101 endef
102
103 define Build/Configure
104 endef
105
106 define Build/Compile
107 rm -rf $(PKG_INSTALL_DIR)
108 mkdir -p $(PKG_INSTALL_DIR)
109 $(MAKE) -C "$(PKG_BUILD_DIR)" \
110 $(TARGET_CONFIGURE_OPTS) \
111 NODEBUG=1 \
112 CFLAGS="$(TARGET_CFLAGS)" \
113 OS="linux" \
114 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
115 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
116 SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin/" \
117 ETCDIR="$(PKG_INSTALL_DIR)/etc" \
118 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
119 STRIP="true" \
120 INSTALL_LIB="true" \
121 SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo nameservice secure txtinfo quagga" \
122 all libs install install_libs
123 endef
124
125 define Package/olsrd/install
126 $(INSTALL_DIR) $(1)/etc/config
127 $(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
130 $(INSTALL_DIR) $(1)/etc/init.d
131 $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
132 endef
133
134 define Package/olsrd-mod-arprefresh/install
135 $(INSTALL_DIR) $(1)/usr/lib
136 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/
137 endef
138
139 define Package/olsrd-mod-dot-draw/install
140 $(INSTALL_DIR) $(1)/usr/lib
141 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
142 endef
143
144 define Package/olsrd-mod-bmf/install
145 $(INSTALL_DIR) $(1)/usr/lib
146 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/
147 endef
148
149 define Package/olsrd-mod-dyn-gw/install
150 $(INSTALL_DIR) $(1)/usr/lib
151 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/
152 endef
153
154 define Package/olsrd-mod-dyn-gw-plain/install
155 $(INSTALL_DIR) $(1)/usr/lib
156 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.* $(1)/usr/lib/
157 endef
158
159 define Package/olsrd-mod-httpinfo/install
160 $(INSTALL_DIR) $(1)/usr/lib
161 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/
162 endef
163
164 define Package/olsrd-mod-nameservice/install
165 $(INSTALL_DIR) $(1)/usr/lib
166 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/
167 endef
168
169 define Package/olsrd-mod-quagga/install
170 $(INSTALL_DIR) $(1)/usr/lib
171 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/quagga/olsrd_quagga.so.* $(1)/usr/lib/
172 endef
173
174 define Package/olsrd-mod-secure/install
175 $(INSTALL_DIR) $(1)/etc/olsrd.d
176 $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/
177 $(INSTALL_DIR) $(1)/usr/lib
178 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/
179 endef
180
181 define Package/olsrd-mod-txtinfo/install
182 $(INSTALL_DIR) $(1)/usr/lib
183 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/
184 endef
185
186 $(eval $(call BuildPackage,olsrd))
187 $(eval $(call BuildPackage,olsrd-mod-arprefresh))
188 $(eval $(call BuildPackage,olsrd-mod-dot-draw))
189 $(eval $(call BuildPackage,olsrd-mod-bmf))
190 $(eval $(call BuildPackage,olsrd-mod-dyn-gw))
191 $(eval $(call BuildPackage,olsrd-mod-dyn-gw-plain))
192 $(eval $(call BuildPackage,olsrd-mod-httpinfo))
193 $(eval $(call BuildPackage,olsrd-mod-nameservice))
194 $(eval $(call BuildPackage,olsrd-mod-quagga))
195 $(eval $(call BuildPackage,olsrd-mod-secure))
196 $(eval $(call BuildPackage,olsrd-mod-txtinfo))