1 # Copyright 2021-2023 Stan Grishin (stangri@melmac.ca)
2 # This is free software, licensed under the MIT License.
4 include $(TOPDIR
)/rules.mk
10 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
11 PKG_SOURCE_URL
:=https
://codeload.github.com
/slackhq
/nebula
/tar.gz
/v
$(PKG_VERSION
)?
12 PKG_HASH
:=85c048b6d39296eeb8cf2d3324124d834011121383d0550662018190494d433e
14 PKG_MAINTAINER
:=Stan Grishin
<stangri@melmac.ca
>
16 PKG_LICENSE_FILES
:=LICENSE
18 PKG_BUILD_DEPENDS
:=golang
/host
20 PKG_BUILD_FLAGS
:=no-mips16
22 GO_PKG
:=github.com
/slackhq
/nebula
24 github.com
/slackhq
/nebula
/cmd
/nebula \
25 github.com
/slackhq
/nebula
/cmd
/nebula-cert
27 main.Build
=$(PKG_VERSION
)
29 include $(INCLUDE_DIR
)/package.mk
30 include ..
/..
/lang
/golang
/golang-package.mk
36 URL
:=https
://docs.openwrt.melmac.net
/nebula
/
37 DEPENDS
:=$(GO_ARCH_DEPENDS
) +kmod-tun
40 define Package
/nebula-cert
44 URL
:=https
://docs.openwrt.melmac.net
/nebula
/
45 DEPENDS
:=$(GO_ARCH_DEPENDS
)
48 define Package
/nebula-proto
52 URL
:=https
://docs.openwrt.melmac.net
/nebula
/
54 DEPENDS
+=+!BUSYBOX_DEFAULT_AWK
:gawk
55 DEPENDS
+=+!BUSYBOX_DEFAULT_GREP
:grep
56 DEPENDS
+=+!BUSYBOX_DEFAULT_SED
:sed
60 define Package
/nebula-service
64 URL
:=https
://docs.openwrt.melmac.net
/nebula
/
66 DEPENDS
+=+!BUSYBOX_DEFAULT_AWK
:gawk
67 DEPENDS
+=+!BUSYBOX_DEFAULT_SED
:sed
68 CONFLICTS
:=nebula-proto
73 $(call GoPackage
/Build
/Compile
)
76 define Package
/nebula
/description
77 Nebula is a scalable overlay networking tool with a focus on performance
, simplicity
78 and security. It lets you seamlessly connect computers anywhere in the world.
79 This package contains only nebula binary. Unless you want to start nebula manually
,
80 you may want to also
install *either
* 'nebula-service' *or
* 'nebula-proto' package.
83 define Package
/nebula-cert
/description
84 Nebula is a scalable overlay networking tool with a focus on performance
, simplicity
85 and security. It lets you seamlessly connect computers anywhere in the world.
86 This package contains only nebula-cert binary.
89 define Package
/nebula-proto
/description
90 Nebula is a scalable overlay networking tool with a focus on performance
, simplicity
91 and security. It lets you seamlessly connect computers anywhere in the world.
92 This package contains only OpenWrt protocol
/interface support for nebula.
95 define Package
/nebula-service
/description
96 Nebula is a scalable overlay networking tool with a focus on performance
, simplicity
97 and security. It lets you seamlessly connect computers anywhere in the world.
98 This package contains only OpenWrt-specific init.d script for nebula.
101 define Package
/nebula
/install
102 $(call GoPackage
/Package
/Install
/Bin
,$(PKG_INSTALL_DIR
))
103 $(INSTALL_DIR
) $(1)/usr
/sbin
104 $(INSTALL_DIR
) $(1)/lib
/upgrade
/keep.d
105 $(INSTALL_DIR
) $(1)/usr
/share
/doc
/nebula
106 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/nebula
$(1)/usr
/sbin
/
107 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/LICENSE
$(1)/usr
/share
/doc
/nebula
/LICENSE
108 $(INSTALL_DATA
) .
/files
/nebula.upgrade
$(1)/lib
/upgrade
/keep.d
/nebula
111 define Package
/nebula-cert
/install
112 $(call GoPackage
/Package
/Install
/Bin
,$(PKG_INSTALL_DIR
))
113 $(INSTALL_DIR
) $(1)/usr
/sbin
114 $(INSTALL_DIR
) $(1)/lib
/upgrade
/keep.d
115 $(INSTALL_DIR
) $(1)/usr
/share
/doc
/nebula-cert
116 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/nebula-cert
$(1)/usr
/sbin
/
117 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/LICENSE
$(1)/usr
/share
/doc
/nebula-cert
/LICENSE
118 $(INSTALL_DATA
) .
/files
/nebula.upgrade
$(1)/lib
/upgrade
/keep.d
/nebula-cert
121 define Package
/nebula-proto
/install
122 $(call GoPackage
/Package
/Install
/Bin
,$(PKG_INSTALL_DIR
))
123 $(INSTALL_DIR
) $(1)/lib
/netifd
/proto
124 $(INSTALL_BIN
) .
/files
/nebula.proto
$(1)/lib
/netifd
/proto
/nebula.sh
125 $(SED
) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/lib
/netifd
/proto
/nebula.sh
128 define Package
/nebula-service
/install
129 $(call GoPackage
/Package
/Install
/Bin
,$(PKG_INSTALL_DIR
))
130 $(INSTALL_DIR
) $(1)/etc
/init.d
131 $(INSTALL_BIN
) .
/files
/nebula.init
$(1)/etc
/init.d
/nebula
132 $(SED
) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc
/init.d
/nebula
135 $(eval
$(call GoBinPackage
,nebula
))
136 $(eval
$(call BuildPackage
,nebula
))
138 $(eval
$(call GoBinPackage
,nebula-cert
))
139 $(eval
$(call BuildPackage
,nebula-cert
))
141 $(eval
$(call BuildPackage
,nebula-proto
))
143 $(eval
$(call BuildPackage
,nebula-service
))