1 # Copyright (C) 2014-2017 Eloi Carbo <eloicaso@openmailbox.org>
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.
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.
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/>.
17 include $(TOPDIR
)/rules.mk
18 include $(INCLUDE_DIR
)/kernel.mk
21 BIRD_PKG
:= bird1-ipv4
22 PKG_NAME
:= $(BIRD_PKG
)-openwrt
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
)
30 include $(INCLUDE_DIR
)/package.mk
38 TITLE
:=The BIRD UCI module
(v1.6
) (IPv4
)
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
47 define Package
/$(uci
)/description
48 $(BIRD_PKG
) UCI integration module
51 define Package
/$(uci
)/conffiles
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
/
65 define Package
/$(uci
)/postinst
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
78 $(eval
$(call BuildPackage
,$(uci
)))
80 define Package
/$(luci
)
81 TITLE
:=LuCI support for
$(BIRD_PKG
)
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
90 define Package
/$(luci
)/description
91 $(BIRD
) application for LuCI
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
)/
103 $(eval
$(call BuildPackage
,$(luci
)))