Renamed package name from bmx6-qmp to bmx6 and bmx6-luci to luci-app-bmx6
[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-qmp
28
29 PKG_SOURCE_PROTO:=git
30
31 Public Sources:
32 #PKG_SOURCE_URL:=git://git.bmx6.net/bmx6.git
33 PKG_SOURCE_URL:=git://github.com/axn/bmx6.git
34
35 PKG_REV:=7219010098ea67f8ea08a06a68e7a765b114ca16
36
37 Private Sources:
38 #PKG_SOURCE_URL:=file:///usr/src/bmx6/bmx6-private.git
39
40 PKG_VERSION:=r2013022001
41
42 PKG_RELEASE:=4
43 #PKG_INSTALL:=1 # this tries to install straight to /usr/sbin/bmx6
44
45 PKG_SOURCE_VERSION:=$(PKG_REV)
46 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
47 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
48 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
49
50 include $(INCLUDE_DIR)/package.mk
51
52
53 TARGET_CFLAGS += $(FPIC)
54
55 #-DNO_TRAFFIC_DUMP -DNO_DYN_PLUGIN -DNO_DEBUG_DUMP -DNO_DEBUG_ALL -DNO_DEBUG_TRACK -DNO_DEBUG_SYS
56
57 MAKE_ARGS += \
58 EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
59 EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
60 REVISION_VERSION="$(PKG_REV)" \
61 CC="$(TARGET_CC)" \
62 INSTALL_DIR="$(PKG_INSTALL_DIR)" \
63 STRIP="/bin/false" \
64 build_all
65
66
67 define Package/bmx6-qmp/Default
68 SECTION:=net
69 CATEGORY:=qMp
70 TITLE:=BMX6 layer 3 routing daemon (QMP version)
71 URL:=http://bmx6.net/
72 MAINTAINER:=Axel Neumann <neumann@cgws.de>
73 endef
74
75 define Package/bmx6-qmp/description
76 BMX6 layer 3 routing daemon (QMP version) supporting IPv4, IPv6, and IPv4 over IPv6 - http://www.bmx6.net
77 endef
78
79 define Package/bmx6-qmp
80 $(call Package/bmx6-qmp/Default)
81 MENU:=1
82 endef
83
84 define Package/bmx6-qmp-uci-config
85 $(call Package/bmx6-qmp/Default)
86 DEPENDS:=bmx6-qmp +libuci
87 TITLE:=configuration plugin based on uci (recommended!)
88 endef
89
90
91 define Package/bmx6-qmp-json
92 $(call Package/bmx6-qmp/Default)
93 DEPENDS:=bmx6-qmp +libjson
94 TITLE:=josn plugin based on jsonc
95 endef
96
97 define Package/bmx6-qmp-sms
98 $(call Package/bmx6-qmp/Default)
99 DEPENDS:=bmx6-qmp
100 TITLE:=sms plugin
101 endef
102
103 define Package/bmx6-qmp-quagga
104 $(call Package/bmx6-qmp/Default)
105 DEPENDS:=bmx6-qmp +qmp-quagga
106 TITLE:=bmx6 quagga plugin to redistribute/export routes (needs manet/bmx6 patched quagga 0.99.21)
107 endef
108
109 define Build/Configure
110 mkdir -p $(PKG_INSTALL_DIR)
111 endef
112
113 define Build/Compile
114 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
115 endef
116
117
118 define Package/bmx6-qmp/install
119 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
120 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6
121 endef
122
123
124 define Package/bmx6-qmp-uci-config/conffiles
125 /etc/config/bmx6
126 endef
127
128
129 define Package/bmx6-qmp-uci-config/install
130 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
131 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
132 $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6
133 $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6
134 endef
135
136 define Package/bmx6-qmp-json/install
137 $(INSTALL_DIR) $(1)/usr/lib
138 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_json/bmx6_json.so $(1)/usr/lib/bmx6_json.so
139 endef
140
141 define Package/bmx6-qmp-sms/install
142 $(INSTALL_DIR) $(1)/usr/lib
143 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
144 endef
145
146 define Package/bmx6-qmp-quagga/install
147 $(INSTALL_DIR) $(1)/usr/lib
148 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
149 endef
150
151 $(eval $(call BuildPackage,bmx6-qmp))
152 $(eval $(call BuildPackage,bmx6-qmp-uci-config))
153 $(eval $(call BuildPackage,bmx6-qmp-json))
154 $(eval $(call BuildPackage,bmx6-qmp-sms))
155 $(eval $(call BuildPackage,bmx6-qmp-quagga))
156
157