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