add new olsrd init script and default config by Alina Friedrichsen
[openwrt/svn-archive/archive.git] / net / olsrd / Makefile
1 #
2 # Copyright (C) 2007 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-rc7
13 PKG_RELEASE:=1
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:=10fbf796792d51eda735d171b6c86941
19
20 include $(INCLUDE_DIR)/package.mk
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 MENU:=1
28 endef
29
30 define Package/olsrd
31 $(call Package/olsrd/template)
32 MENU:=1
33 DEPENDS:=+libpthread
34 endef
35
36 define Package/olsrd/conffiles
37 /etc/olsrd.conf
38 endef
39
40 define Package/olsrd-mod-dot-draw
41 $(call Package/olsrd/template)
42 DEPENDS:=olsrd
43 TITLE:=Dot topology information plugin
44 endef
45
46 define Package/olsrd-mod-bmf
47 $(call Package/olsrd/template)
48 DEPENDS:=olsrd +kmod-tun
49 TITLE:=Basic multicast forwarding plugin
50 endef
51
52 define Package/olsrd-mod-dyn-gw
53 $(call Package/olsrd/template)
54 DEPENDS:=olsrd
55 TITLE:=Dynamic internet gateway plugin
56 endef
57
58 define Package/olsrd-mod-httpinfo
59 $(call Package/olsrd/template)
60 DEPENDS:=olsrd
61 TITLE:=Small informative web server plugin
62 endef
63
64 define Package/olsrd-mod-nameservice
65 $(call Package/olsrd/template)
66 DEPENDS:=olsrd
67 TITLE:=Lightweight hostname resolver plugin
68 endef
69
70 define Package/olsrd-mod-secure
71 $(call Package/olsrd/template)
72 DEPENDS:=olsrd
73 TITLE:=Message signing plugin to secure routing domain
74 endef
75
76 define Package/olsrd-mod-txtinfo
77 $(call Package/olsrd/template)
78 DEPENDS:=olsrd
79 TITLE:=Small informative web server plugin
80 endef
81
82 define Package/olsrd-mod-secure/conffiles
83 /etc/olsrd.d/olsrd_secure_key
84 endef
85
86 define Build/Configure
87 endef
88
89 define Build/Compile
90 rm -rf $(PKG_INSTALL_DIR)
91 mkdir -p $(PKG_INSTALL_DIR)
92 $(MAKE) -C "$(PKG_BUILD_DIR)" \
93 $(TARGET_CONFIGURE_OPTS) \
94 NODEBUG=1 \
95 CFLAGS="$(TARGET_CFLAGS)" \
96 OS="linux" \
97 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
98 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
99 SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin/" \
100 ETCDIR="$(PKG_INSTALL_DIR)/etc" \
101 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
102 STRIP="true" \
103 INSTALL_LIB="true" \
104 SUBDIRS="bmf dot_draw dyn_gw httpinfo nameservice secure txtinfo" \
105 all libs install install_libs
106 endef
107
108 define Package/olsrd/install
109 $(INSTALL_DIR) $(1)/etc/config
110 $(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd
111 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/cfgparser/olsrd.conf.example $(1)/etc/olsrd.conf
112 $(INSTALL_DIR) $(1)/usr/sbin
113 $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
114 $(INSTALL_DIR) $(1)/etc/init.d
115 $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
116 endef
117
118 define Package/olsrd-mod-dot-draw/install
119 $(INSTALL_DIR) $(1)/usr/lib
120 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
121 endef
122
123 define Package/olsrd-mod-bmf/install
124 $(INSTALL_DIR) $(1)/usr/lib
125 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/
126 endef
127
128 define Package/olsrd-mod-dyn-gw/install
129 $(INSTALL_DIR) $(1)/usr/lib
130 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/
131 endef
132
133 define Package/olsrd-mod-httpinfo/install
134 $(INSTALL_DIR) $(1)/usr/lib
135 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/
136 endef
137
138 define Package/olsrd-mod-nameservice/install
139 $(INSTALL_DIR) $(1)/usr/lib
140 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/
141 endef
142
143 define Package/olsrd-mod-secure/install
144 $(INSTALL_DIR) $(1)/etc/olsrd.d
145 $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/
146 $(INSTALL_DIR) $(1)/usr/lib
147 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/
148 endef
149
150 define Package/olsrd-mod-txtinfo/install
151 $(INSTALL_DIR) $(1)/usr/lib
152 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/
153 endef
154
155 $(eval $(call BuildPackage,olsrd))
156 $(eval $(call BuildPackage,olsrd-mod-dot-draw))
157 $(eval $(call BuildPackage,olsrd-mod-bmf))
158 $(eval $(call BuildPackage,olsrd-mod-dyn-gw))
159 $(eval $(call BuildPackage,olsrd-mod-httpinfo))
160 $(eval $(call BuildPackage,olsrd-mod-nameservice))
161 $(eval $(call BuildPackage,olsrd-mod-secure))
162 $(eval $(call BuildPackage,olsrd-mod-txtinfo))