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