[packages] Use default templates instead of custom reimplementations where applicable
[openwrt/svn-archive/archive.git] / net / olsrd / Makefile
1 #
2 # Copyright (C) 2009 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-r8
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.5
16 PKG_MD5SUM:=aef6f4350c44fd0ad015a26621ef9607
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-watchdog
100 $(call Package/olsrd/template)
101 DEPENDS:=olsrd
102 TITLE:=Watchdog plugin
103 endef
104
105 define Package/olsrd-mod-secure/conffiles
106 /etc/olsrd.d/olsrd_secure_key
107 endef
108
109 define Build/Configure
110 endef
111
112 define Build/Compile
113 $(MAKE) -C "$(PKG_BUILD_DIR)" \
114 $(TARGET_CONFIGURE_OPTS) \
115 NODEBUG=1 \
116 CFLAGS="$(TARGET_CFLAGS)" \
117 OS="linux" \
118 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
119 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
120 SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin/" \
121 ETCDIR="$(PKG_INSTALL_DIR)/etc" \
122 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
123 STRIP="true" \
124 INSTALL_LIB="true" \
125 SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo nameservice quagga secure txtinfo watchdog" \
126 all libs install install_libs
127 endef
128
129 define Package/olsrd/install
130 $(INSTALL_DIR) $(1)/etc/config
131 $(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd
132 $(INSTALL_DIR) $(1)/usr/sbin
133 $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
134 $(INSTALL_DIR) $(1)/etc/init.d
135 $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
136 endef
137
138 define Package/olsrd-mod-arprefresh/install
139 $(INSTALL_DIR) $(1)/usr/lib
140 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/
141 endef
142
143 define Package/olsrd-mod-dot-draw/install
144 $(INSTALL_DIR) $(1)/usr/lib
145 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
146 endef
147
148 define Package/olsrd-mod-bmf/install
149 $(INSTALL_DIR) $(1)/usr/lib
150 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/
151 endef
152
153 define Package/olsrd-mod-dyn-gw/install
154 $(INSTALL_DIR) $(1)/usr/lib
155 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/
156 endef
157
158 define Package/olsrd-mod-dyn-gw-plain/install
159 $(INSTALL_DIR) $(1)/usr/lib
160 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.* $(1)/usr/lib/
161 endef
162
163 define Package/olsrd-mod-httpinfo/install
164 $(INSTALL_DIR) $(1)/usr/lib
165 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/
166 endef
167
168 define Package/olsrd-mod-nameservice/install
169 $(INSTALL_DIR) $(1)/usr/lib
170 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/
171 endef
172
173 define Package/olsrd-mod-quagga/install
174 $(INSTALL_DIR) $(1)/usr/lib
175 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/quagga/olsrd_quagga.so.* $(1)/usr/lib/
176 endef
177
178 define Package/olsrd-mod-secure/install
179 $(INSTALL_DIR) $(1)/etc/olsrd.d
180 $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/
181 $(INSTALL_DIR) $(1)/usr/lib
182 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/
183 endef
184
185 define Package/olsrd-mod-txtinfo/install
186 $(INSTALL_DIR) $(1)/usr/lib
187 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/
188 endef
189
190 define Package/olsrd-mod-watchdog/install
191 $(INSTALL_DIR) $(1)/usr/lib
192 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/watchdog/olsrd_watchdog.so.* $(1)/usr/lib/
193 endef
194
195 $(eval $(call BuildPackage,olsrd))
196 $(eval $(call BuildPackage,olsrd-mod-arprefresh))
197 $(eval $(call BuildPackage,olsrd-mod-dot-draw))
198 $(eval $(call BuildPackage,olsrd-mod-bmf))
199 $(eval $(call BuildPackage,olsrd-mod-dyn-gw))
200 $(eval $(call BuildPackage,olsrd-mod-dyn-gw-plain))
201 $(eval $(call BuildPackage,olsrd-mod-httpinfo))
202 $(eval $(call BuildPackage,olsrd-mod-nameservice))
203 $(eval $(call BuildPackage,olsrd-mod-quagga))
204 $(eval $(call BuildPackage,olsrd-mod-secure))
205 $(eval $(call BuildPackage,olsrd-mod-txtinfo))
206 $(eval $(call BuildPackage,olsrd-mod-watchdog))