commit:     21e61a7e5a617c5ef1434d967aa6a2b79da02889
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Wed Aug 17 14:18:26 2022 +0000
Commit:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
CommitDate: Wed Aug 17 14:18:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=21e61a7e

net-p2p/popura: install docs, set file capabilities

Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>

 net-p2p/popura/popura-0.4.3.ebuild | 26 +++++++++++++++-----------
 net-p2p/popura/popura-9999.ebuild  | 18 +++++++++---------
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/net-p2p/popura/popura-0.4.3.ebuild 
b/net-p2p/popura/popura-0.4.3.ebuild
index 28d1a02a3..719ec1948 100644
--- a/net-p2p/popura/popura-0.4.3.ebuild
+++ b/net-p2p/popura/popura-0.4.3.ebuild
@@ -3,31 +3,32 @@
 
 EAPI=8
 
-inherit go-module linux-info systemd
+inherit go-module linux-info systemd fcaps
 
 DESCRIPTION="Popura: alternative Yggdrasil network client"
 HOMEPAGE="https://github.com/popura-network/Popura/";
-DOCS=( README.md )
-
-KEYWORDS="~amd64"
 SRC_URI="
        https://github.com/popura-network/Popura/archive/v${PV}+popura1.tar.gz 
-> ${P}+popura1.tar.gz
        
https://codeberg.org/BratishkaErik/distfiles/media/branch/master/${P}+popura1-deps.tar.bz2
 "
 
-S="${WORKDIR}/Popura-${PV}-popura1"
-
 LICENSE="LGPL-3 MPL-2.0 MIT Apache-2.0 BSD ZLIB"
 SLOT="0"
+KEYWORDS="~amd64"
 
 DEPEND="
        acct-user/yggdrasil
        acct-group/yggdrasil
 "
 
-RDEPEND="!!net-p2p/yggdrasil-go"
-
 BDEPEND=">=dev-lang/go-1.16.0"
+RDEPEND="!net-p2p/yggdrasil-go"
+
+S="${WORKDIR}/Popura-${PV}-popura1"
+
+FILECAPS=(
+       cap_net_admin,cap_net_bind_service "usr/bin/yggdrasil"
+)
 
 pkg_setup() {
        linux-info_pkg_setup
@@ -40,13 +41,16 @@ pkg_setup() {
 }
 
 src_compile() {
-       PKGNAME="${PN}" PKGVER="${PV}+popura1" \
-       GOFLAGS="-trimpath -buildmode=pie -mod=readonly" \
-       ./build -l "-linkmode external -extldflags \"${LDFLAGS}\""
+       local package="github.com/yggdrasil-network/yggdrasil-go/src/version"
+
+       for CMD in yggdrasil yggdrasilctl ; do
+               ego build -buildmode=pie -ldflags "-s -linkmode external 
-extldflags '${LDFLAGS}' -X ${package}.buildName=${PN} -X 
${package}.buildVersion=v${PV}+popura1" -trimpath ./cmd/$CMD
+       done
 }
 
 src_install() {
        dobin {yggdrasil,yggdrasilctl}
+       dodoc README.md
        systemd_dounit "contrib/systemd/yggdrasil.service"
        systemd_dounit "contrib/systemd/yggdrasil-default-config.service"
        doinitd "contrib/openrc/yggdrasil"

diff --git a/net-p2p/popura/popura-9999.ebuild 
b/net-p2p/popura/popura-9999.ebuild
index 5b58d7b27..26e19a2b1 100644
--- a/net-p2p/popura/popura-9999.ebuild
+++ b/net-p2p/popura/popura-9999.ebuild
@@ -3,26 +3,22 @@
 
 EAPI=8
 
-inherit go-module linux-info systemd git-r3
-
-EGIT_REPO_URI="https://github.com/popura-network/Popura";
+inherit go-module linux-info systemd git-r3 fcaps
 
 DESCRIPTION="Popura: alternative Yggdrasil network client"
 HOMEPAGE="https://github.com/popura-network/Popura";
-DOCS=( README.md )
+EGIT_REPO_URI="https://github.com/popura-network/Popura";
 
 LICENSE="LGPL-3 MPL-2.0 MIT Apache-2.0 BSD ZLIB"
 SLOT="0"
-KEYWORDS=""
 
 DEPEND="
        acct-user/yggdrasil
        acct-group/yggdrasil
 "
 
-RDEPEND="!!net-p2p/yggdrasil-go"
-
 BDEPEND=">=dev-lang/go-1.16.0"
+RDEPEND="!net-p2p/yggdrasil-go"
 
 pkg_setup() {
        linux-info_pkg_setup
@@ -40,12 +36,16 @@ src_unpack() {
 }
 
 src_compile() {
-       GOFLAGS="-trimpath -buildmode=pie -mod=readonly" \
-       ./build -l "-linkmode external -extldflags \"${LDFLAGS}\""
+       local package="github.com/yggdrasil-network/yggdrasil-go/src/version"
+
+       for CMD in yggdrasil yggdrasilctl ; do
+               ego build -buildmode=pie -ldflags "-s -linkmode external 
-extldflags '${LDFLAGS}' -X ${package}.buildName=${PN} -X 
${package}.buildVersion=v${PV}+popura1" -trimpath ./cmd/$CMD
+       done
 }
 
 src_install() {
        dobin {yggdrasil,yggdrasilctl}
+       dodoc README.md
        systemd_dounit "contrib/systemd/yggdrasil.service"
        systemd_dounit "contrib/systemd/yggdrasil-default-config.service"
        doinitd "contrib/openrc/yggdrasil"

Reply via email to