fix segfault and set right dependency
[openwrt/svn-archive/archive.git] / net / olsrd / Makefile
1 #
2 # Copyright (C) 2006 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.2
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:=a61029e11c001be2997c1e088576d0f5
19 PKG_CAT:=bzcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/olsrd
26 SECTION:=net
27 CATEGORY:=Network
28 TITLE:=OLSR (Optimized Link State Routing) daemon
29 URL:=http://www.olsr.org/
30 MENU:=1
31 endef
32
33 define Package/olsrd/conffiles
34 /etc/olsrd.conf
35 endef
36
37 define Package/olsrd-mod-dot-draw
38 $(call Package/olsrd)
39 DEPENDS:=olsrd
40 TITLE:=Dot topology information plugin
41 MENU:=0
42 endef
43
44 define Package/olsrd-mod-bmf
45 $(call Package/olsrd)
46 DEPENDS:=olsrd +libpthread +kmod-tun
47 TITLE:=Basic multicast forwarding plugin
48 MENU:=0
49 endef
50
51 define Package/olsrd-mod-dyn-gw
52 $(call Package/olsrd)
53 DEPENDS:=olsrd +libpthread
54 TITLE:=Dynamic internet gateway plugin
55 MENU:=0
56 endef
57
58 define Package/olsrd-mod-httpinfo
59 $(call Package/olsrd)
60 DEPENDS:=olsrd
61 TITLE:=Small informative web server plugin
62 MENU:=0
63 endef
64
65 define Package/olsrd-mod-nameservice
66 $(call Package/olsrd)
67 DEPENDS:=olsrd
68 TITLE:=Lightweight hostname resolver plugin
69 MENU:=0
70 endef
71
72 define Package/olsrd-mod-secure
73 $(call Package/olsrd)
74 DEPENDS:=olsrd
75 TITLE:=Message signing plugin to secure routing domain
76 MENU:=0
77 endef
78
79 define Package/olsrd-mod-secure/conffiles
80 /etc/olsrd.d/olsrd_secure_key
81 endef
82
83 define Package/olsrd-mod-tas
84 $(call Package/olsrd)
85 DEPENDS:=olsrd
86 TITLE:=Tiny Application Server (TAS) plugin
87 MENU:=0
88 endef
89
90 define Build/Configure
91 endef
92
93 define Build/Compile
94 rm -rf $(PKG_INSTALL_DIR)
95 mkdir -p $(PKG_INSTALL_DIR)
96 $(MAKE) -C "$(PKG_BUILD_DIR)" \
97 $(TARGET_CONFIGURE_OPTS) \
98 NODEBUG=1 \
99 OFLAGS="$(TARGET_CFLAGS)" \
100 OS="linux" \
101 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
102 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
103 SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin/" \
104 ETCDIR="$(PKG_INSTALL_DIR)/etc" \
105 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
106 STRIP="/bin/true" \
107 all libs install install_libs
108 endef
109
110 define Package/olsrd/install
111 $(INSTALL_DIR) $(1)/etc
112 $(CP) $(PKG_INSTALL_DIR)/etc/olsrd.conf $(1)/etc/
113 $(INSTALL_DIR) $(1)/usr/sbin
114 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/olsrd $(1)/usr/sbin/
115 $(INSTALL_DIR) $(1)/etc/init.d
116 $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
117 endef
118
119 define Package/olsrd-mod-dot-draw/install
120 $(INSTALL_DIR) $(1)/usr/lib
121 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_dot_draw.so.* $(1)/usr/lib/
122 endef
123
124 define Package/olsrd-mod-bmf/install
125 $(INSTALL_DIR) $(1)/usr/lib
126 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_bmf.so.* $(1)/usr/lib/
127 endef
128
129 define Package/olsrd-mod-dyn-gw/install
130 $(INSTALL_DIR) $(1)/usr/lib
131 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_dyn_gw.so.* $(1)/usr/lib/
132 endef
133
134 define Package/olsrd-mod-httpinfo/install
135 $(INSTALL_DIR) $(1)/usr/lib
136 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_httpinfo.so.* $(1)/usr/lib/
137 endef
138
139 define Package/olsrd-mod-nameservice/install
140 $(INSTALL_DIR) $(1)/usr/lib
141 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_nameservice.so.* $(1)/usr/lib/
142 endef
143
144 define Package/olsrd-mod-secure/install
145 $(INSTALL_DIR) $(1)/etc/olsrd.d
146 $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/
147 $(INSTALL_DIR) $(1)/usr/lib
148 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_secure.so.* $(1)/usr/lib/
149 endef
150
151 define Package/olsrd-mod-tas/install
152 $(INSTALL_DIR) $(1)/usr/lib
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_tas.so.* $(1)/usr/lib/
154 endef
155
156
157 $(eval $(call BuildPackage,olsrd))
158 $(eval $(call BuildPackage,olsrd-mod-dot-draw))
159 $(eval $(call BuildPackage,olsrd-mod-bmf))
160 $(eval $(call BuildPackage,olsrd-mod-dyn-gw))
161 $(eval $(call BuildPackage,olsrd-mod-httpinfo))
162 $(eval $(call BuildPackage,olsrd-mod-nameservice))
163 $(eval $(call BuildPackage,olsrd-mod-secure))
164 $(eval $(call BuildPackage,olsrd-mod-tas))