Change menu category and name
[feed/routing.git] / packages / bmx6 / Makefile
1 # Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License along
14 # with this program; if not, write to the Free Software Foundation, Inc.,
15 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 #
17 # The full GNU General Public License is included in this distribution in
18 # the file called "COPYING".
19 #
20 # Contibutors:
21 # Axel Neumann, Simó Albert i Beltran, Pau Escrich
22 #
23
24
25 include $(TOPDIR)/rules.mk
26
27 PKG_NAME:=bmx6
28
29 PKG_SOURCE_PROTO:=git
30
31 PKG_SOURCE_URL:=git://bmx6.net/bmx6.git
32 #PKG_SOURCE_URL:=git://github.com/axn/bmx6.git
33
34 PKG_REV:=7219010098ea67f8ea08a06a68e7a765b114ca16
35
36 PKG_VERSION:=r2013022001
37
38 PKG_RELEASE:=4
39
40 PKG_SOURCE_VERSION:=$(PKG_REV)
41 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
42 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
43 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
44
45 include $(INCLUDE_DIR)/package.mk
46
47
48 TARGET_CFLAGS += $(FPIC)
49
50 MAKE_ARGS += \
51 EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
52 EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
53 REVISION_VERSION="$(PKG_REV)" \
54 CC="$(TARGET_CC)" \
55 INSTALL_DIR="$(PKG_INSTALL_DIR)" \
56 STRIP="/bin/false" \
57 build_all
58
59 define Package/bmx6/Default
60 SECTION:=net
61 CATEGORY:=Network
62 SUBMENU:=Routing and Redirection
63 TITLE:=BMX6 layer 3 routing daemon (QMP version)
64 URL:=http://bmx6.net/
65 MAINTAINER:=Axel Neumann <neumann@cgws.de>
66 endef
67
68 define Package/bmx6/description
69 BMX6 layer 3 routing daemon supporting IPv4, IPv6, and IPv4 over IPv6
70 endef
71
72 define Package/bmx6
73 $(call Package/bmx6/Default)
74 MENU:=1
75 endef
76
77 define Package/bmx6-uci-config
78 $(call Package/bmx6/Default)
79 DEPENDS:=bmx6 +libuci
80 TITLE:=configuration plugin based on uci (recommended!)
81 endef
82
83
84 define Package/bmx6-json
85 $(call Package/bmx6/Default)
86 DEPENDS:=bmx6 +libjson
87 TITLE:=json plugin based on jsonc
88 endef
89
90 define Package/bmx6-sms
91 $(call Package/bmx6/Default)
92 DEPENDS:=bmx6
93 TITLE:=sms plugin
94 endef
95
96 define Package/bmx6-quagga
97 $(call Package/bmx6/Default)
98 DEPENDS:=bmx6 +qmp-quagga @BROKEN
99 TITLE:=bmx6 quagga plugin to redistribute/export routes (needs manet/bmx6 patched quagga 0.99.21)
100 endef
101
102 define Build/Configure
103 mkdir -p $(PKG_INSTALL_DIR)
104 endef
105
106 define Build/Compile
107 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
108 endef
109
110
111 define Package/bmx6/install
112 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
113 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6
114 endef
115
116
117 define Package/bmx6-uci-config/conffiles
118 /etc/config/bmx6
119 endef
120
121
122 define Package/bmx6-uci-config/install
123 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
124 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
125 $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6
126 $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6
127 endef
128
129 define Package/bmx6-json/install
130 $(INSTALL_DIR) $(1)/usr/lib
131 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_json/bmx6_json.so $(1)/usr/lib/bmx6_json.so
132 endef
133
134 define Package/bmx6-sms/install
135 $(INSTALL_DIR) $(1)/usr/lib
136 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
137 endef
138
139 define Package/bmx6-quagga/install
140 $(INSTALL_DIR) $(1)/usr/lib
141 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
142 endef
143
144 $(eval $(call BuildPackage,bmx6))
145 $(eval $(call BuildPackage,bmx6-uci-config))
146 $(eval $(call BuildPackage,bmx6-json))
147 $(eval $(call BuildPackage,bmx6-sms))
148 $(eval $(call BuildPackage,bmx6-quagga))
149