bird1: Add missing dependency on luci-compat
[feed/routing.git] / bird1-openwrt / bird1-ipv4-openwrt / Makefile
1 # Copyright (C) 2014-2017 Eloi Carbo <eloicaso@openmailbox.org>
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 3 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
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 #
16
17 include $(TOPDIR)/rules.mk
18 include $(INCLUDE_DIR)/kernel.mk
19
20 BIRD := bird4
21 BIRD_PKG := bird1-ipv4
22 PKG_NAME := $(BIRD_PKG)-openwrt
23 PKG_VERSION := 0.3
24 PKG_RELEASE := 1
25 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
26 PKG_LICENSE := GPL-3.0+
27 uci := $(BIRD_PKG)-uci
28 luci := luci-app-$(BIRD_PKG)
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 (v1.6) (IPv4)
39 SECTION:=net
40 CATEGORY:=Network
41 SUBMENU:=Routing and Redirection
42 MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
43 URL:=https://github.com/eloicaso/bird-openwrt/
44 DEPENDS:=+$(BIRD_PKG) +libuci +uci
45 endef
46
47 define Package/$(uci)/description
48 $(BIRD_PKG) UCI integration module
49 endef
50
51 define Package/$(uci)/conffiles
52 /etc/config/$(BIRD)
53 endef
54
55 define Package/$(uci)/install
56 $(INSTALL_DIR) $(1)/etc/$(BIRD)/init.d
57 $(INSTALL_DIR) $(1)/etc/config
58 $(INSTALL_DIR) $(1)/etc/$(BIRD)/filters
59 $(INSTALL_DIR) $(1)/etc/$(BIRD)/functions
60 $(INSTALL_BIN) ./src/init.d/$(BIRD)* $(1)/etc/$(BIRD)/init.d/
61 $(CP) ./src/uci-defaults/* $(1)/etc/$(BIRD)/init.d/
62 $(INSTALL_CONF) ./src/config/$(BIRD) $(1)/etc/config/
63 endef
64
65 define Package/$(uci)/postinst
66 #!/bin/sh
67 if [ -z "$${IPKG_INSTROOT}" ]; then
68 ( . /etc/$(BIRD)/init.d/bird-uci-install-init.d $(BIRD) ) && rm -f /etc/$(BIRD)/init.d/bird-uci-install-init.d
69 ( . /etc/$(BIRD)/init.d/99-relocate-filters $(BIRD) ) && rm -f /etc/$(BIRD)/init.d/99-relocate-filters
70 if [ -f /etc/sysupgrade.conf ] && ! grep $(BIRD) /etc/sysupgrade.conf; then
71 echo /etc/config/$(BIRD) >> /etc/sysupgrade.conf
72 echo /etc/$(BIRD)/filters/ >> /etc/sysupgrade.conf
73 echo /etc/$(BIRD)/functions/ >> /etc/sysupgrade.conf
74 fi
75 fi
76 endef
77
78 $(eval $(call BuildPackage,$(uci)))
79
80 define Package/$(luci)
81 TITLE:=LuCI support for $(BIRD_PKG)
82 SECTION:=luci
83 CATEGORY:=LuCI
84 SUBMENU:=3. Applications
85 MAINTAINER:=Eloi Carbo <eloicaso@openmailbox.org>
86 URL:=https://github.com/eloicaso/bird-openwrt/
87 DEPENDS:=+$(BIRD_PKG)-uci +luci-base +luci-compat
88 endef
89
90 define Package/$(luci)/description
91 $(BIRD) application for LuCI
92 endef
93
94 define Package/$(luci)/install
95 $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
96 $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
97 $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/$(BIRD)/
98 $(CP) ./src/model/* $(1)/usr/lib/lua/luci/model/cbi/$(BIRD)/
99 $(CP) ./src/controller/* $(1)/usr/lib/lua/luci/controller/
100 $(CP) ./src/view/* $(1)/usr/lib/lua/luci/view/$(BIRD)/
101 endef
102
103 $(eval $(call BuildPackage,$(luci)))