2 # Copyright (C) 2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/)
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=tailscale-
$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://codeload.github.com
/tailscale
/tailscale
/tar.gz
/v
$(PKG_VERSION
)?
16 PKG_HASH
:=9c0a9648c921f695fc501536e69c8b4998d318256c8049de538f72fbe1491c18
18 PKG_MAINTAINER
:=Jan Pavlinec
<jan.pavlinec1@gmail.com
>
19 PKG_LICENSE
:=BSD-3-Clause
20 PKG_LICENSE_FILES
:=LICENSE
22 PKG_BUILD_DIR
:=$(BUILD_DIR
)/tailscale-
$(PKG_VERSION
)
23 PKG_BUILD_DEPENDS
:=golang
/host
25 PKG_BUILD_FLAGS
:=no-mips16
28 tailscale.com
/cmd
/tailscale \
29 tailscale.com
/cmd
/tailscaled
30 GO_PKG_LDFLAGS
:=-X
'tailscale.com/version.longStamp=$(PKG_VERSION)-$(PKG_RELEASE) (OpenWrt)'
31 GO_PKG_LDFLAGS_X
:=tailscale.com
/version.shortStamp
=$(PKG_VERSION
)
33 include $(INCLUDE_DIR
)/package.mk
34 include ..
/..
/lang
/golang
/golang-package.mk
36 define Package
/tailscale
/Default
40 TITLE
:=Zero config VPN
41 URL
:=https
://tailscale.com
42 DEPENDS
:=$(GO_ARCH_DEPENDS
)
45 define Package
/tailscaled
46 $(call Package
/tailscale
/Default
)
48 DEPENDS
+= +ca-bundle
+kmod-tun
51 define Package
/tailscale
52 $(call Package
/tailscale
/Default
)
57 define Package
/tailscale
/description
58 It creates a secure network between your servers
, computers
,
59 and cloud instances. Even when separated by firewalls or subnets.
62 Package
/tailscaled
/description
:=$(Package
/tailscale
/description
)
64 define Package
/tailscaled
/conffiles
66 /etc
/tailscale
/tailscaled.state
69 GO_IPTABLES_VERSION
:=0.6.0
70 GO_IPTABLES_FILE
:=$(PKG_NAME
)-go-iptables-
$(GO_IPTABLES_VERSION
).
tar.gz
72 define Download
/go-iptables
73 URL
:=https
://codeload.github.com
/coreos
/go-iptables
/tar.gz
/v
$(GO_IPTABLES_VERSION
)?
74 URL_FILE
:=$(GO_IPTABLES_FILE
)
75 FILE
:=$(GO_IPTABLES_FILE
)
76 HASH
:=a784cc17fcb17879f073eae47bc4c2e899f59f6906dac5a0aa7a9cc9f95ea66d
81 [ ! -d .
/src
/ ] ||
$(CP
) .
/src
/.
$(PKG_BUILD_DIR
)
82 $(eval
$(call Download
,go-iptables
))
84 mkdir
-p
$(PKG_BUILD_DIR
)/patched
/ ; \
85 gzip
-dc
$(DL_DIR
)/$(GO_IPTABLES_FILE
) |
$(HOST_TAR
) -C
$(PKG_BUILD_DIR
)/patched
$(TAR_OPTIONS
) ; \
86 mv
$(PKG_BUILD_DIR
)/patched
/go-iptables-
$(GO_IPTABLES_VERSION
) $(PKG_BUILD_DIR
)/patched
/go-iptables
; \
91 define Package
/tailscale
/install
92 $(INSTALL_DIR
) $(1)/usr
/sbin
93 $(INSTALL_BIN
) $(GO_PKG_BUILD_BIN_DIR
)/tailscale
$(1)/usr
/sbin
96 define Package
/tailscaled
/install
97 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/init.d
$(1)/etc
/config
98 $(INSTALL_BIN
) $(GO_PKG_BUILD_BIN_DIR
)/tailscaled
$(1)/usr
/sbin
99 $(INSTALL_BIN
) .
/files
//tailscale.init
$(1)/etc
/init.d
/tailscale
100 $(INSTALL_DATA
) .
/files
//tailscale.conf
$(1)/etc
/config
/tailscale
103 $(eval
$(call BuildPackage
,tailscale
))
104 $(eval
$(call BuildPackage
,tailscaled
))