diff options
author | David Roman <davidroman96@gmail.com> | 2019-07-09 22:58:31 +0200 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2020-02-13 08:26:31 +0200 |
commit | e5ced3ba64948849d68a23f423841c3bf8428c2b (patch) | |
tree | 10f8a0861cbbfb4f466d76b3b6be4067d45c0d58 /net-p2p | |
parent | www-servers/nginx-unit: Remove obsolete PHP (diff) | |
download | gentoo-e5ced3ba64948849d68a23f423841c3bf8428c2b.tar.gz gentoo-e5ced3ba64948849d68a23f423841c3bf8428c2b.tar.bz2 gentoo-e5ced3ba64948849d68a23f423841c3bf8428c2b.zip |
net-p2p/go-ipfs: new package
non binary version of go-ipfs-bin
Package-Manager: Portage-2.3.68, Repoman-2.3.16
Signed-off-by: David Roman <davidroman96@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/12412
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/go-ipfs/Manifest | 2 | ||||
-rw-r--r-- | net-p2p/go-ipfs/files/ipfs-at.service | 18 | ||||
-rw-r--r-- | net-p2p/go-ipfs/files/ipfs.confd | 1 | ||||
-rw-r--r-- | net-p2p/go-ipfs/files/ipfs.init | 17 | ||||
-rw-r--r-- | net-p2p/go-ipfs/files/ipfs.service | 19 | ||||
-rw-r--r-- | net-p2p/go-ipfs/go-ipfs-0.4.23.ebuild | 69 | ||||
-rw-r--r-- | net-p2p/go-ipfs/metadata.xml | 12 |
7 files changed, 138 insertions, 0 deletions
diff --git a/net-p2p/go-ipfs/Manifest b/net-p2p/go-ipfs/Manifest new file mode 100644 index 000000000000..7389951ffca2 --- /dev/null +++ b/net-p2p/go-ipfs/Manifest @@ -0,0 +1,2 @@ +DIST go-ipfs-0.4.23.bash 20753 BLAKE2B c34d29a48cf249b7a646a8a7b6015b9c4a4a5d8656187ec5984b0dfb741a8ca7b2f2d0a10bc0288aa862679c6d52145936b46497936565ba7cdb2ba847fda5b8 SHA512 acd3bdb689964aa5e15965bfea3cd1267f54a2014c05f49f4e536902cbdab3e22038f4f5db5ecc273c147135b265fcb82a41db22bfc3fd8f6ddc8ae43fd053ea +DIST go-ipfs-0.4.23.tar.gz 9415138 BLAKE2B 20f9aa246e2170fd8438fbb98ee92a4b1657f1d3e059530cc8e0a1d98a84ea7bdf5de97980f7b345110bcdbd7ed999a5d814c12eaa051aecc28d2d0a47f88272 SHA512 d87513392336fc537bf9c8578d34d650482001c37c1636d64f68fe5d5291c21990c72286c26f43cb6bc2c9c9df14bae69996b60ad6744f335276d52b0cb6978e diff --git a/net-p2p/go-ipfs/files/ipfs-at.service b/net-p2p/go-ipfs/files/ipfs-at.service new file mode 100644 index 000000000000..c9ce91294177 --- /dev/null +++ b/net-p2p/go-ipfs/files/ipfs-at.service @@ -0,0 +1,18 @@ +[Unit] +Description=InterPlanetary File System +After=network.target + +[Service] +CPUSchedulingPolicy=batch +Environment=IPFS_PATH= +ExecStart=/usr/bin/ipfs daemon --enable-gc --migrate +ExecStop=/usr/bin/ipfs shutdown +LimitNOFILE=8192 +PrivateTmp=yes +ProtectSystem=full +Restart=on-failure +Type=simple +User=%i + +[Install] +WantedBy=multi-user.target diff --git a/net-p2p/go-ipfs/files/ipfs.confd b/net-p2p/go-ipfs/files/ipfs.confd new file mode 100644 index 000000000000..f1e8eb77adf5 --- /dev/null +++ b/net-p2p/go-ipfs/files/ipfs.confd @@ -0,0 +1 @@ +IPFS_PATH=/var/lib/ipfs/.ipfs diff --git a/net-p2p/go-ipfs/files/ipfs.init b/net-p2p/go-ipfs/files/ipfs.init new file mode 100644 index 000000000000..52f48c52d1cd --- /dev/null +++ b/net-p2p/go-ipfs/files/ipfs.init @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +export IPFS_PATH=${IPFS_PATH:-/var/lib/ipfs/.ipfs} + +pidfile="/run/ipfs.pid" +command="/usr/bin/ipfs" +command_args="daemon --enable-gc --migrate" +command_user="ipfs:ipfs" +start_stop_daemon_args="--wait 1000 -b \ + -1 /var/log/ipfs/ipfs.log \ + -2 /var/log/ipfs/ipfs.log" + +depend() { + need net +} diff --git a/net-p2p/go-ipfs/files/ipfs.service b/net-p2p/go-ipfs/files/ipfs.service new file mode 100644 index 000000000000..12e9d19fd965 --- /dev/null +++ b/net-p2p/go-ipfs/files/ipfs.service @@ -0,0 +1,19 @@ +[Unit] +Description=InterPlanetary File System +After=network.target + +[Service] +CPUSchedulingPolicy=batch +Environment=IPFS_PATH=/var/lib/ipfs/.ipfs +ExecStart=/usr/bin/ipfs daemon --enable-gc --migrate +ExecStop=/usr/bin/ipfs shutdown +Group=ipfs +LimitNOFILE=8192 +PrivateTmp=yes +ProtectSystem=full +Restart=on-failure +Type=simple +User=ipfs + +[Install] +WantedBy=multi-user.target diff --git a/net-p2p/go-ipfs/go-ipfs-0.4.23.ebuild b/net-p2p/go-ipfs/go-ipfs-0.4.23.ebuild new file mode 100644 index 000000000000..4b2936e8a480 --- /dev/null +++ b/net-p2p/go-ipfs/go-ipfs-0.4.23.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit bash-completion-r1 go-module golang-build systemd + +DESCRIPTION="Main implementation of IPFS" +HOMEPAGE="https://ipfs.io/" +SRC_URI="https://dist.ipfs.io/go-ipfs/v${PV}/go-ipfs-source.tar.gz -> ${P}.tar.gz + https://raw.githubusercontent.com/ipfs/go-ipfs/v${PV}/misc/completion/ipfs-completion.bash -> ${P}.bash" +EGO_PN="github.com/ipfs/go-ipfs" + +LICENSE="Apache-2.0 BSD BSD-2 CC0-1.0 ISC MIT MPL-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + !net-p2p/go-ipfs-bin + acct-group/ipfs + acct-user/ipfs + sys-fs/fuse:0 +" + +S="${WORKDIR}" + +DOCS=(CHANGELOG.md CONTRIBUTING.md README.md docs/) + +src_compile() { + local mygoargs=( + -v + -work + -x + -tags release + ) + + go build "${mygoargs[@]}" -o ipfs ${EGO_PN}/cmd/ipfs || die + go build "${mygoargs[@]}" -o ipfswatch ${EGO_PN}/cmd/ipfswatch || die +} + +src_test() { + go test ${EGO_PN}/cmd/ipfs/... ${EGO_PN}/cmd/ipfswatch/... || die +} + +src_install() { + dobin ipfs + dobin ipfswatch + + einstalldocs + + systemd_dounit "${FILESDIR}/ipfs.service" + systemd_newunit "${FILESDIR}/ipfs-at.service" "ipfs@.service" + + newinitd "${FILESDIR}/ipfs.init" ipfs + newconfd "${FILESDIR}/ipfs.confd" ipfs + + newbashcomp "${DISTDIR}/${P}.bash" "ipfs" + keepdir /var/log/ipfs +} + +pkg_preinst() { + fowners -R ipfs:ipfs /var/log/ipfs +} + +pkg_postinst() { + elog 'To be able to use the ipfs service you will need to create the ipfs repository' + elog '(eg: su -s /bin/sh -c "ipfs init -e" ipfs)' + elog 'or change IPFS_PATH of /etc/conf.d/ipfs with another with proper permissions.' +} diff --git a/net-p2p/go-ipfs/metadata.xml b/net-p2p/go-ipfs/metadata.xml new file mode 100644 index 000000000000..b69fe2e3c4ab --- /dev/null +++ b/net-p2p/go-ipfs/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>davidroman96@gmail.com</email> + <name>David Roman</name> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> +</pkgmetadata> |