replace lots of manual install commands with INSTALL_* variables
[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.4.10
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.4
18 PKG_MD5SUM:=9807d4451e65cb4ec385155eef7bf3cf
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-dyn-gw
45 $(call Package/olsrd)
46 DEPENDS:=olsrd
47 TITLE:=Dynamic internet gateway plugin
48 MENU:=0
49 endef
50
51 define Package/olsrd-mod-httpinfo
52 $(call Package/olsrd)
53 DEPENDS:=olsrd
54 TITLE:=Small informative web server plugin
55 MENU:=0
56 endef
57
58 define Package/olsrd-mod-nameservice
59 $(call Package/olsrd)
60 DEPENDS:=olsrd
61 TITLE:=Lightweight hostname resolver plugin
62 MENU:=0
63 endef
64
65 define Package/olsrd-mod-power
66 $(call Package/olsrd)
67 DEPENDS:=olsrd
68 TITLE:=Power status 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 STRIP="/bin/true" \
103 all libs install install_libs
104 endef
105
106 define Package/olsrd/install
107 $(INSTALL_DIR) $(1)/etc
108 $(CP) $(PKG_INSTALL_DIR)/etc/olsrd.conf $(1)/etc/
109 $(INSTALL_DIR) $(1)/usr/sbin
110 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/olsrd $(1)/usr/sbin/
111 $(INSTALL_DIR) $(1)/etc/init.d
112 $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
113 endef
114
115 define Package/olsrd-mod-dot-draw/install
116 $(INSTALL_DIR) $(1)/usr/lib
117 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_dot_draw.so.* $(1)/usr/lib/
118 endef
119
120 define Package/olsrd-mod-dyn-gw/install
121 $(INSTALL_DIR) $(1)/usr/lib
122 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_dyn_gw.so.* $(1)/usr/lib/
123 endef
124
125 define Package/olsrd-mod-httpinfo/install
126 $(INSTALL_DIR) $(1)/usr/lib
127 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_httpinfo.so.* $(1)/usr/lib/
128 endef
129
130 define Package/olsrd-mod-nameservice/install
131 $(INSTALL_DIR) $(1)/usr/lib
132 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_nameservice.so.* $(1)/usr/lib/
133 endef
134
135 define Package/olsrd-mod-power/install
136 $(INSTALL_DIR) $(1)/usr/lib
137 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_power.so.* $(1)/usr/lib/
138 endef
139
140 define Package/olsrd-mod-secure/install
141 $(INSTALL_DIR) $(1)/etc/olsrd.d
142 $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/
143 $(INSTALL_DIR) $(1)/usr/lib
144 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_secure.so.* $(1)/usr/lib/
145 endef
146
147 define Package/olsrd-mod-tas/install
148 $(INSTALL_DIR) $(1)/usr/lib
149 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/olsrd_tas.so.* $(1)/usr/lib/
150 endef
151
152
153 $(eval $(call BuildPackage,olsrd))
154 $(eval $(call BuildPackage,olsrd-mod-dot-draw))
155 $(eval $(call BuildPackage,olsrd-mod-dyn-gw))
156 $(eval $(call BuildPackage,olsrd-mod-httpinfo))
157 $(eval $(call BuildPackage,olsrd-mod-nameservice))
158 $(eval $(call BuildPackage,olsrd-mod-power))
159 $(eval $(call BuildPackage,olsrd-mod-secure))
160 $(eval $(call BuildPackage,olsrd-mod-tas))