Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: net-p2p/yggdrasil-go/
Date: Thu, 11 Aug 2022 13:45:20
Message-Id: 1660076718.93cfd952aceadb153940160f01c56888fb5b59cd.andrewammerlaan@gentoo
1 commit: 93cfd952aceadb153940160f01c56888fb5b59cd
2 Author: Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
3 AuthorDate: Tue Aug 9 20:25:18 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 9 20:25:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=93cfd952
7
8 net-p2p/yggdrasil-go: install docs, set file capabilities
9
10 Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>
11
12 net-p2p/yggdrasil-go/yggdrasil-go-0.4.4.ebuild | 18 +++++++++++++-----
13 net-p2p/yggdrasil-go/yggdrasil-go-9999.ebuild | 18 +++++++++++++-----
14 2 files changed, 26 insertions(+), 10 deletions(-)
15
16 diff --git a/net-p2p/yggdrasil-go/yggdrasil-go-0.4.4.ebuild b/net-p2p/yggdrasil-go/yggdrasil-go-0.4.4.ebuild
17 index 726c54483..f8bfdf265 100644
18 --- a/net-p2p/yggdrasil-go/yggdrasil-go-0.4.4.ebuild
19 +++ b/net-p2p/yggdrasil-go/yggdrasil-go-0.4.4.ebuild
20 @@ -3,7 +3,7 @@
21
22 EAPI=8
23
24 -inherit go-module linux-info systemd
25 +inherit go-module linux-info systemd fcaps
26
27 DESCRIPTION="An experiment in scalable routing as an encrypted IPv6 overlay network"
28 HOMEPAGE="https://yggdrasil-network.github.io/"
29 @@ -24,6 +24,10 @@ DEPEND="
30
31 BDEPEND=">=dev-lang/go-1.17.0"
32
33 +FILECAPS=(
34 + cap_net_admin,cap_net_bind_service "usr/bin/yggdrasil"
35 +)
36 +
37 pkg_setup() {
38 linux-info_pkg_setup
39 if ! linux_config_exists; then
40 @@ -35,15 +39,19 @@ pkg_setup() {
41 }
42
43 src_compile() {
44 - PKGNAME="${PN}" PKGVER="${PV}" \
45 - GOFLAGS="-trimpath -buildmode=pie -mod=readonly" \
46 - ./build -l "-linkmode external -extldflags \"${LDFLAGS}\""
47 + local package="github.com/yggdrasil-network/yggdrasil-go/src/version"
48 +
49 + for CMD in yggdrasil yggdrasilctl ; do
50 + ego build -buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS}' -X ${package}.buildName=${PN} -X ${package}.buildVersion=v${PV}" -trimpath ./cmd/$CMD
51 + done
52 +
53 }
54
55 src_install() {
56 dobin {yggdrasil,yggdrasilctl}
57 + dodoc README.md
58 + dodoc CHANGELOG.md
59 systemd_dounit "contrib/systemd/yggdrasil.service"
60 systemd_dounit "contrib/systemd/yggdrasil-default-config.service"
61 doinitd "contrib/openrc/yggdrasil"
62 - einstalldocs
63 }
64
65 diff --git a/net-p2p/yggdrasil-go/yggdrasil-go-9999.ebuild b/net-p2p/yggdrasil-go/yggdrasil-go-9999.ebuild
66 index d803f16d4..20419a673 100644
67 --- a/net-p2p/yggdrasil-go/yggdrasil-go-9999.ebuild
68 +++ b/net-p2p/yggdrasil-go/yggdrasil-go-9999.ebuild
69 @@ -3,13 +3,12 @@
70
71 EAPI=8
72
73 -inherit go-module linux-info systemd git-r3
74 +inherit go-module linux-info systemd git-r3 fcaps
75
76 EGIT_REPO_URI="https://github.com/yggdrasil-network/yggdrasil-go"
77
78 DESCRIPTION="An experiment in scalable routing as an encrypted IPv6 overlay network"
79 HOMEPAGE="https://yggdrasil-network.github.io/"
80 -DOCS=( README.md )
81
82 LICENSE="LGPL-3 MIT Apache-2.0 BSD ZLIB"
83 SLOT="0"
84 @@ -20,7 +19,11 @@ DEPEND="
85 acct-group/yggdrasil
86 "
87
88 -BDEPEND=">=dev-lang/go-1.16.0"
89 +BDEPEND=">=dev-lang/go-1.17.0"
90 +
91 +FILECAPS=(
92 + cap_net_admin,cap_net_bind_service "usr/bin/yggdrasil"
93 +)
94
95 pkg_setup() {
96 linux-info_pkg_setup
97 @@ -38,12 +41,17 @@ src_unpack() {
98 }
99
100 src_compile() {
101 - GOFLAGS="-trimpath -buildmode=pie -mod=readonly" \
102 - ./build -l "-linkmode external -extldflags \"${LDFLAGS}\""
103 + local package="github.com/yggdrasil-network/yggdrasil-go/src/version"
104 +
105 + for CMD in yggdrasil yggdrasilctl ; do
106 + ego build -buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS}' -X ${package}.buildName=${PN} -X ${package}.buildVersion=v${PV}" -trimpath ./cmd/$CMD
107 + done
108 }
109
110 src_install() {
111 dobin {yggdrasil,yggdrasilctl}
112 + dodoc README.md
113 + dodoc CHANGELOG.md
114 systemd_dounit "contrib/systemd/yggdrasil.service"
115 systemd_dounit "contrib/systemd/yggdrasil-default-config.service"
116 doinitd "contrib/openrc/yggdrasil"