Merge pull request #332 from ecsv/batadv-2017.4
[feed/routing.git] / bird-openwrt / bird6-openwrt / Makefile
1 # Copyright (C) 2014 - Eloi Carbó Solé (GSoC2014)
2 # BGP/Bird integration with OpenWRT and QMP
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
17
18 include $(TOPDIR)/rules.mk
19 include $(INCLUDE_DIR)/kernel.mk
20
21 BIRD:=bird6
22 PKG_NAME:=$(BIRD)-openwrt
23 PKG_RELEASE:=0.2
24 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
25 PKG_LICENSE:=GPL-3.0+
26 uci:=$(BIRD)-uci
27 luci:=luci-app-$(BIRD)
28
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define Build/Prepare
33 endef
34 define Build/Compile
35 endef
36
37 define Package/$(uci)
38 TITLE:=The BIRD UCI module
39 SECTION:=net
40 CATEGORY:=Network
41 SUBMENU:=Routing and Redirection
42 MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
43 URL:=https://github.com/eloicaso/bird6-openwrt/
44 DEPENDS:=+$(BIRD) +libuci +uci
45 endef
46
47 define Package/$(uci)/description
48 $(BIRD) UCI integration module
49 endef
50
51 define Package/$(uci)/install
52 $(INSTALL_DIR) $(1)/etc/$(BIRD)/init.d
53 $(INSTALL_DIR) $(1)/etc/config
54 $(INSTALL_BIN) ./src/init.d/$(BIRD) $(1)/etc/$(BIRD)/init.d/
55 $(CP) ./src/uci-defaults/$(uci)-install-init.d $(1)/etc/$(BIRD)/init.d/
56 $(CP) ./src/config/$(BIRD) $(1)/etc/config/
57 endef
58
59 define Package/$(uci)/postinst
60 #!/bin/sh
61 if [ -z $${IPKG_INSTROOT} ]; then
62 ( . /etc/bird6/init.d/bird6-uci-install-init.d ) && rm -f /etc/bird6/init.d/bird6-uci-install-init.d
63 fi
64 endef
65
66
67 $(eval $(call BuildPackage,$(uci)))
68
69
70
71 define Package/$(luci)
72 TITLE:=LuCI support for $(BIRD)
73 SECTION:=luci
74 CATEGORY:=LuCI
75 SUBMENU:=3. Applications
76 MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
77 URL:=https://github.com/eloicaso/bird6-openwrt/
78 DEPENDS:=+$(BIRD)-uci +luci-base
79 endef
80
81 define Package/$(luci)/description
82 $(BIRD) application for LuCI
83 endef
84
85 define Package/$(luci)/install
86 $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
87 $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
88 $(CP) ./src/model/* $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
89 $(CP) ./src/controller/* $(1)/usr/lib/lua/luci/controller/
90 endef
91
92 $(eval $(call BuildPackage,$(luci)))