View | Details | Raw Unified | Return to bug 230601 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/ipfs-go/Makefile (-8 / +38 lines)
Lines 1-29 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	ipfs
3
PORTNAME=	ipfs
4
PORTVERSION=	0.4.15
5
DISTVERSIONPREFIX=	v
4
DISTVERSIONPREFIX=	v
6
PORTREVISION=	1
5
DISTVERSION=	0.4.17
7
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
8
MASTER_SITES=	https://dist.ipfs.io/go-ipfs/${DISTVERSIONPREFIX}${DISTVERSION}/
7
MASTER_SITES=	https://people.freebsd.org/~yuri/:gx
9
PKGNAMESUFFIX=	-go
8
PKGNAMESUFFIX=	-go
10
DISTNAME=	go-ipfs_${DISTVERSIONPREFIX}${DISTVERSION}_freebsd-${ARCH}
9
DISTFILES=	ipfs-go-gx-${DISTVERSION}.tar.xz:gx
11
10
12
MAINTAINER=	jhixson@FreeBSD.org
11
MAINTAINER=	jhixson@FreeBSD.org
13
COMMENT=	IPFS implementation in Go
12
COMMENT=	IPFS implementation in Go
14
13
15
LICENSE=	MIT
14
LICENSE=	MIT
15
LICENSE_FILE=	${WRKSRC}/LICENSE
16
16
17
ONLY_FOR_ARCHS=	amd64
17
ONLY_FOR_ARCHS=	amd64 i386
18
18
19
PLIST_FILES=	bin/${PORTNAME}${PKGNAMESUFFIX}
19
BUILD_DEPENDS=	${LOCALBASE}/bin/go:lang/go
20
20
21
NO_BUILD=	yes
21
USE_GITHUB=	yes
22
WRKSRC=		${WRKDIR}/go-ipfs
22
GH_PROJECT=	go-ipfs
23
GH_SUBDIR=	src/github.com/ipfs/go-ipfs
23
24
24
USE_RC_SUBR=	${PORTNAME}${PKGNAMESUFFIX}
25
USE_RC_SUBR=	${PORTNAME}${PKGNAMESUFFIX}
25
26
27
SUB_FILES=	ipfs-go
28
SUB_LIST=	IPFS_USER=${IPFS_USER} \
29
		IPFS_GROUP=${IPFS_GROUP} \
30
		IPFS_LOGDIR=${IPFS_LOGDIR}
31
PLIST_SUB=	IPFS_USER=${IPFS_USER} \
32
		IPFS_GROUP=${IPFS_GROUP} \
33
		IPFS_HOME=${IPFS_HOME} \
34
		IPFS_LOGDIR=${IPFS_LOGDIR}
35
36
IPFS_USER=	ipfs-go
37
IPFS_GROUP=	ipfs-go
38
IPFS_HOME=	/var/db/${PORTNAME}${PKGNAMESUFFIX}
39
IPFS_LOGDIR=	/var/log/${PORTNAME}${PKGNAMESUFFIX}
40
41
USERS=		${IPFS_USER}
42
GROUPS=		${IPFS_GROUP}
43
44
post-patch:
45
	${RLN} ${WRKDIR}/gx ${WRKSRC}/src
46
47
do-build:
48
	# To update ipfs-go-gx-${DISTVERSION}.tar.xz deps bundle:
49
	# comment out post-patch, run the command below, tar ${WRKSRC}/src/gx and re-upload .tar.xz
50
	# cd ${WRKSRC}/${GH_SUBDIR} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} gx install
51
	cd ${WRKSRC}/${GH_SUBDIR} && \
52
		${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build ./cmd/ipfs
53
26
do-install:
54
do-install:
55
	${MKDIR} ${STAGEDIR}${IPFS_HOME}
56
	${MKDIR} ${STAGEDIR}${IPFS_LOGDIR}
27
	${INSTALL_PROGRAM} ${WRKSRC}/ipfs ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
57
	${INSTALL_PROGRAM} ${WRKSRC}/ipfs ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
28
58
29
.include <bsd.port.mk>
59
.include <bsd.port.mk>
(-)sysutils/ipfs-go/distinfo (-3 / +5 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1528920460
1
TIMESTAMP = 1534183965
2
SHA256 (go-ipfs_v0.4.15_freebsd-amd64.tar.gz) = 13e2514a62b17a81e2e1ce2dbcb38d7924a932c62f6a775f090a7458ef9fcccd
2
SHA256 (ipfs-go-gx-0.4.17.tar.xz) = 7f9f233048b61416789ff8573ec4adddbccdc21557f135d998167f2c2b04144f
3
SIZE (go-ipfs_v0.4.15_freebsd-amd64.tar.gz) = 9888465
3
SIZE (ipfs-go-gx-0.4.17.tar.xz) = 11255440
4
SHA256 (ipfs-go-ipfs-v0.4.17_GH0.tar.gz) = 2562401bee0609d321bbf5e9c383de4124f634dcfd9394f1d23146a49f281718
5
SIZE (ipfs-go-ipfs-v0.4.17_GH0.tar.gz) = 728972
(-)sysutils/ipfs-go/files/ipfs-go.in (-14 / +24 lines)
Lines 1-38 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
#
3
# $FreeBSD$
2
# $FreeBSD$
4
#
5
3
6
# PROVIDE: ipfs_go
4
# PROVIDE: ipfs_go
7
# REQUIRE: NETWORKING
5
# REQUIRE: DAEMON NETWORKING
8
# BEFORE: LOGIN
6
# BEFORE: LOGIN
9
# KEYWORD: shutdown
7
# KEYWORD: shutdown
10
8
11
# Define these ipfs_go_* variables in /etc/rc.conf[.local]:
9
# Add the following lines to /etc/rc.conf to enable ipfs_go:
10
# ipfs_go_enable="YES"
12
#
11
#
13
# ipfs_go_enable="YES"
12
# ipfs_go_enable (bool):    Set to YES to enable ipfs_go
14
# ipfs_go_path="/tank/ipfs"
13
#                           Default: NO
14
# ipfs_go_user (str):       ipfs_go daemon user
15
#                           Default: %%IPFS_USER%%
16
# ipfs_go_group (str):      ipfs_go daemon group
17
#                           Default: %%IPFS_GROUP%%
15
18
16
. /etc/rc.subr
19
. /etc/rc.subr
17
20
21
name=ipfs_go
22
rcvar=ipfs_go_enable
23
load_rc_config $name
24
18
: ${ipfs_go_enable:="NO"}
25
: ${ipfs_go_enable:="NO"}
19
: ${ipfs_go_path:="/root/.ipfs"}
26
: ${ipfs_go_user:="%%IPFS_USER%%"}
27
: ${ipfs_go_group:="%%IPFS_GROUP%%"}
20
28
21
name=ipfs_go
29
logfile="%%IPFS_LOGDIR%%/${name}.log"
22
rcvar=ipfs_go_enable
30
pidfile="/var/run/${name}.pid"
23
command="%%PREFIX%%/bin/ipfs-go"
31
command="%%PREFIX%%/bin/ipfs-go"
24
32
# command=/usr/sbin/daemon
25
start_precmd="ipfs_go_prestart"
33
start_precmd="ipfs_go_prestart"
26
start_cmd="ipfs_go_start"
34
start_cmd="ipfs_go_start"
27
35
28
ipfs_go_prestart() {
36
ipfs_go_prestart() {
29
        [ -d ${ipfs_go_path}/datastore ] || env IPFS_PATH=${ipfs_go_path} ${command} init
37
    install -d -o ${ipfs_go_user} -g ${ipfs_go_group} -m750 %%IPFS_LOGDIR%%
38
    [ -d ~%%IPFS_USER%%/.ipfs ] || /usr/bin/su - ${ipfs_go_user} -c "${command} init"
30
}
39
}
31
40
32
ipfs_go_start() {
41
ipfs_go_start() {
33
	echo running ${command} daemon
42
    echo "Starting ${name}"
34
	env IPFS_PATH=${ipfs_go_path} daemon -f ${command} daemon
43
    export USER=${ipfs_go_user}
44
    export HOME=$(echo ~%%IPFS_USER%%)
45
    /usr/sbin/daemon -p ${pidfile} -u ${ipfs_go_user} ${command} daemon >> ${logfile} 2>&1
35
}
46
}
36
47
37
load_rc_config $name
38
run_rc_command "$1"
48
run_rc_command "$1"
(-)sysutils/ipfs-go/pkg-plist (+3 lines)
Line 0 Link Here
1
bin/ipfs-go
2
@dir(%%IPFS_USER%%,%%IPFS_GROUP%%,0750) %%IPFS_HOME%%
3
@dir(%%IPFS_USER%%,%%IPFS_GROUP%%,0750) %%IPFS_LOGDIR%%
(-)UIDs (-2 / +1 lines)
Lines 829-836 Link Here
829
# free: 880
829
# free: 880
830
# free: 881
830
# free: 881
831
# free: 882
831
# free: 882
832
# free: 883
832
ipfs-go:*:883:883::0:0:ipfs-go user:/var/db/ipfs-go:/bin/sh
833
# free: 884
834
telegraf:*:884:884::0:0:telegraf user:/nonexistent:/usr/sbin/nologin
833
telegraf:*:884:884::0:0:telegraf user:/nonexistent:/usr/sbin/nologin
835
tcpdump:*:885:885::0:0:tcpdump user:/nonexistent:/usr/sbin/nologin
834
tcpdump:*:885:885::0:0:tcpdump user:/nonexistent:/usr/sbin/nologin
836
miniflux:*:886:886::0:0:Miniflux:/nonexistent:/usr/sbin/nologin
835
miniflux:*:886:886::0:0:Miniflux:/nonexistent:/usr/sbin/nologin
(-)GIDs (-1 / +1 lines)
Lines 823-829 Link Here
823
# free: 880
823
# free: 880
824
# free: 881
824
# free: 881
825
# free: 882
825
# free: 882
826
# free: 883
826
ipfs-go:*:883:
827
telegraf:*:884:
827
telegraf:*:884:
828
tcpdump:*:885:
828
tcpdump:*:885:
829
miniflux:*:886:
829
miniflux:*:886:

Return to bug 230601