libnpupnp: update to 5.1.1
[feed/packages.git] / net / nebula / Makefile
1 # Copyright 2021-2023 Stan Grishin (stangri@melmac.ca)
2 # This is free software, licensed under the MIT License.
3
4 include $(TOPDIR)/rules.mk
5
6 PKG_NAME:=nebula
7 PKG_VERSION:=1.7.2
8 PKG_RELEASE:=1
9
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:=c4771ce6eb3e142f88f5f4c12443cfca140bf96b2746c74f9536bd1a362f3f88
13
14 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
15 PKG_LICENSE:=MIT
16 PKG_LICENSE_FILES:=LICENSE
17
18 PKG_BUILD_DEPENDS:=golang/host
19 PKG_BUILD_PARALLEL:=1
20 PKG_BUILD_FLAGS:=no-mips16
21
22 GO_PKG:=github.com/slackhq/nebula
23 GO_PKG_BUILD_PKG:= \
24 github.com/slackhq/nebula/cmd/nebula \
25 github.com/slackhq/nebula/cmd/nebula-cert
26 GO_PKG_LDFLAGS_X:=\
27 main.Build=$(PKG_VERSION)
28
29 include $(INCLUDE_DIR)/package.mk
30 include ../../lang/golang/golang-package.mk
31
32 define Package/nebula
33 SECTION:=net
34 CATEGORY:=Network
35 TITLE:=nebula
36 URL:=https://docs.openwrt.melmac.net/nebula/
37 DEPENDS:=$(GO_ARCH_DEPENDS) +kmod-tun
38 endef
39
40 define Package/nebula-cert
41 SECTION:=net
42 CATEGORY:=Network
43 TITLE:=nebula-cert
44 URL:=https://docs.openwrt.melmac.net/nebula/
45 DEPENDS:=$(GO_ARCH_DEPENDS)
46 endef
47
48 define Package/nebula-proto
49 SECTION:=net
50 CATEGORY:=Network
51 TITLE:=nebula-proto
52 URL:=https://docs.openwrt.melmac.net/nebula/
53 DEPENDS:=nebula
54 PKGARCH:=all
55 endef
56
57 define Package/nebula-service
58 SECTION:=net
59 CATEGORY:=Network
60 TITLE:=nebula-service
61 URL:=https://docs.openwrt.melmac.net/nebula/
62 DEPENDS:=nebula
63 CONFLICTS:=nebula-proto
64 PKGARCH:=all
65 endef
66
67 define Build/Compile
68 $(call GoPackage/Build/Compile)
69 endef
70
71 define Package/nebula/description
72 Nebula is a scalable overlay networking tool with a focus on performance, simplicity
73 and security. It lets you seamlessly connect computers anywhere in the world.
74 This package contains only nebula binary. Unless you want to start nebula manually,
75 you may want to also install *either* 'nebula-service' *or* 'nebula-proto' package.
76 endef
77
78 define Package/nebula-cert/description
79 Nebula is a scalable overlay networking tool with a focus on performance, simplicity
80 and security. It lets you seamlessly connect computers anywhere in the world.
81 This package contains only nebula-cert binary.
82 endef
83
84 define Package/nebula-proto/description
85 Nebula is a scalable overlay networking tool with a focus on performance, simplicity
86 and security. It lets you seamlessly connect computers anywhere in the world.
87 This package contains only OpenWrt protocol/interface support for nebula.
88 endef
89
90 define Package/nebula-service/description
91 Nebula is a scalable overlay networking tool with a focus on performance, simplicity
92 and security. It lets you seamlessly connect computers anywhere in the world.
93 This package contains only OpenWrt-specific init.d script for nebula.
94 endef
95
96 define Package/nebula/install
97 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
98 $(INSTALL_DIR) $(1)/usr/sbin
99 $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
100 $(INSTALL_DIR) $(1)/usr/share/doc/nebula
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nebula $(1)/usr/sbin/
102 $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE $(1)/usr/share/doc/nebula/LICENSE
103 $(INSTALL_DATA) ./files/nebula.upgrade $(1)/lib/upgrade/keep.d/nebula
104 endef
105
106 define Package/nebula-cert/install
107 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
108 $(INSTALL_DIR) $(1)/usr/sbin
109 $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
110 $(INSTALL_DIR) $(1)/usr/share/doc/nebula-cert
111 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nebula-cert $(1)/usr/sbin/
112 $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE $(1)/usr/share/doc/nebula-cert/LICENSE
113 $(INSTALL_DATA) ./files/nebula.upgrade $(1)/lib/upgrade/keep.d/nebula-cert
114 endef
115
116 define Package/nebula-proto/install
117 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
118 $(INSTALL_DIR) $(1)/lib/netifd/proto
119 $(INSTALL_BIN) ./files/nebula.proto $(1)/lib/netifd/proto/nebula.sh
120 $(SED) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/lib/netifd/proto/nebula.sh
121 endef
122
123 define Package/nebula-service/install
124 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
125 $(INSTALL_DIR) $(1)/etc/init.d
126 $(INSTALL_BIN) ./files/nebula.init $(1)/etc/init.d/nebula
127 $(SED) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc/init.d/nebula
128 endef
129
130 $(eval $(call GoBinPackage,nebula))
131 $(eval $(call BuildPackage,nebula))
132
133 $(eval $(call GoBinPackage,nebula-cert))
134 $(eval $(call BuildPackage,nebula-cert))
135
136 $(eval $(call BuildPackage,nebula-proto))
137
138 $(eval $(call BuildPackage,nebula-service))