Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/go-ipfs/
Date: Thu, 30 Jun 2022 20:25:52
Message-Id: 1656620625.de362e13b3af2976bce18b2031cf5b0d5c3c479d.sam@gentoo
1 commit: de362e13b3af2976bce18b2031cf5b0d5c3c479d
2 Author: David Roman <davidroman96 <AT> gmail <DOT> com>
3 AuthorDate: Mon Jun 13 20:10:21 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 20:23:45 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de362e13
7
8 net-p2p/go-ipfs: add 0.13.0
9
10 Closes: https://bugs.gentoo.org/838238
11 Signed-off-by: David Roman <davidroman96 <AT> gmail.com>
12 Closes: https://github.com/gentoo/gentoo/pull/25884
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 net-p2p/go-ipfs/Manifest | 1 +
16 net-p2p/go-ipfs/go-ipfs-0.13.0.ebuild | 69 +++++++++++++++++++++++++++++++++++
17 2 files changed, 70 insertions(+)
18
19 diff --git a/net-p2p/go-ipfs/Manifest b/net-p2p/go-ipfs/Manifest
20 index ef75daec6299..ef134fe88be1 100644
21 --- a/net-p2p/go-ipfs/Manifest
22 +++ b/net-p2p/go-ipfs/Manifest
23 @@ -1,2 +1,3 @@
24 DIST go-ipfs-0.12.2-deps.tar.xz 368885112 BLAKE2B a77bd1518f1c80369a2d7f4ed3c3a19e0294f662910b588c203bcfa630709ef82e42a622a9a6a8b4e218b1566a446eb80ae0fdbd98232bd2aba6c76ed8a828ec SHA512 1268e9727af7a7c856547bd8cce9a9fe5b58db1a6966c2aeb0923632dc96fee16c354261922d7132f791bcc3c2601728831e2e2ec29d9b7d2d8ea60903eafe50
25 DIST go-ipfs-0.12.2.tar.gz 2112884 BLAKE2B fe6883443eaa55764beffb5b8726678615f1246d41924ca6eddaae0e67d241f85f24d9b9264eaae9a211d8f74009bc30dda2a35734ea38645736e4fe21212bc9 SHA512 a268618d66e5e82c89362e0273c0741a56d13ee95e1f545a0b55fa5a7bd719b0e678c7c6cb7dc268892f992156a1fff2f537688de589d7c05b8b48e9c90b94f1
26 +DIST go-ipfs-0.13.0.tar.gz 13474994 BLAKE2B 068484941ae831f9484e5c8a95614be611dfc6e3e0cd6b3f55e17b3339cbe0f4d76d4eaef2b95a7973028e1910abc92fe54acecd72d949f9a3e4a7be66a6f89c SHA512 2513076c193ec0e2a8ecaef8b6d2de5152ef9f5d1e7140735eb405f325d8b31968d2166dbbea28660b03e3458e44d25fc9f970c753ad9d0f56a3970bca7d9365
27
28 diff --git a/net-p2p/go-ipfs/go-ipfs-0.13.0.ebuild b/net-p2p/go-ipfs/go-ipfs-0.13.0.ebuild
29 new file mode 100644
30 index 000000000000..3418b0d7a9b5
31 --- /dev/null
32 +++ b/net-p2p/go-ipfs/go-ipfs-0.13.0.ebuild
33 @@ -0,0 +1,69 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +inherit bash-completion-r1 go-module systemd
40 +
41 +DESCRIPTION="Main implementation of IPFS"
42 +HOMEPAGE="https://ipfs.io/"
43 +SRC_URI="https://github.com/ipfs/${PN}/releases/download/v${PV}/${PN}-source.tar.gz -> ${P}.tar.gz"
44 +
45 +LICENSE="Apache-2.0 BSD BSD-2 CC0-1.0 ISC MIT MPL-2.0"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~x86"
48 +
49 +RDEPEND="
50 + acct-group/ipfs
51 + acct-user/ipfs
52 + sys-fs/fuse:0
53 +"
54 +
55 +DOCS=( CHANGELOG.md CONTRIBUTING.md README.md docs/ )
56 +
57 +S="${WORKDIR}"
58 +
59 +src_compile() {
60 + default
61 +
62 + local mygoargs
63 + mygoargs=(
64 + -tags release
65 + )
66 +
67 + go build "${mygoargs[@]}" -o ipfs ./cmd/ipfs || die
68 + go build "${mygoargs[@]}" -o ipfswatch ./cmd/ipfswatch || die
69 +
70 + IPFS_PATH="" ./ipfs commands completion bash > ipfs-completion.bash || die
71 +}
72 +
73 +src_test() {
74 + go test ./cmd/ipfs/... ./cmd/ipfswatch/... || die
75 +}
76 +
77 +src_install() {
78 + dobin ipfs
79 + dobin ipfswatch
80 + newbashcomp ipfs-completion.bash ipfs
81 + einstalldocs
82 +
83 + systemd_dounit "${FILESDIR}/ipfs.service"
84 + systemd_newunit "${FILESDIR}/ipfs-at.service" "ipfs@.service"
85 +
86 + newinitd "${FILESDIR}/ipfs.init" ipfs
87 + newconfd "${FILESDIR}/ipfs.confd" ipfs
88 +
89 + keepdir /var/log/ipfs
90 + fowners -R ipfs:ipfs /var/log/ipfs
91 +}
92 +
93 +pkg_postinst() {
94 + elog 'To be able to use the ipfs service you will need to create the ipfs repository'
95 + elog '(eg: su -s /bin/sh -c "ipfs init -e" ipfs)'
96 + elog 'or change IPFS_PATH of /etc/conf.d/ipfs with another with proper permissions.'
97 +
98 + # See https://bugs.gentoo.org/838238
99 + ewarn 'In case go-ipfs CPU usage is too high run the next workaround'
100 + ewarn 'su -s /bin/sh -c "ipfs config profile apply lowpower"'
101 + ewarn 'Be aware that this will make your node less visible to other peers'
102 +}