Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2018 19:37:36 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r478487 - in head/sysutils/ipfs-go: . files
Message-ID:  <201808301937.w7UJbae7041579@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Thu Aug 30 19:37:36 2018
New Revision: 478487
URL: https://svnweb.freebsd.org/changeset/ports/478487

Log:
  sysutils/ipfs-go: Update 0.4.15 -> 0.4.17
  
  Major port redesign.
  Changed from the binary, pre-built distribution to building from the source.
  
  PR:		230601
  Submitted by:	Dmitri Goutnik <dg@syrec.org>
  Approved by:	jhixson (maintainer timeout; 17 days)

Added:
  head/sysutils/ipfs-go/pkg-plist   (contents, props changed)
Modified:
  head/sysutils/ipfs-go/Makefile
  head/sysutils/ipfs-go/distinfo
  head/sysutils/ipfs-go/files/ipfs-go.in

Modified: head/sysutils/ipfs-go/Makefile
==============================================================================
--- head/sysutils/ipfs-go/Makefile	Thu Aug 30 18:53:09 2018	(r478486)
+++ head/sysutils/ipfs-go/Makefile	Thu Aug 30 19:37:36 2018	(r478487)
@@ -1,29 +1,61 @@
 # $FreeBSD$
 
 PORTNAME=	ipfs
-PORTVERSION=	0.4.15
 DISTVERSIONPREFIX=	v
-PORTREVISION=	1
+DISTVERSION=	0.4.17
 CATEGORIES=	sysutils
-MASTER_SITES=	https://dist.ipfs.io/go-ipfs/${DISTVERSIONPREFIX}${DISTVERSION}/
+MASTER_SITES=	LOCAL/yuri:gx
 PKGNAMESUFFIX=	-go
-DISTNAME=	go-ipfs_${DISTVERSIONPREFIX}${DISTVERSION}_freebsd-${ARCH}
+DISTFILES=	${FULLNAME}-gx-${DISTVERSION}.tar.xz:gx
 
 MAINTAINER=	jhixson@FreeBSD.org
 COMMENT=	IPFS implementation in Go
 
 LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
-ONLY_FOR_ARCHS=	amd64
+ONLY_FOR_ARCHS=	amd64 i386
 
-PLIST_FILES=	bin/${PORTNAME}${PKGNAMESUFFIX}
+BUILD_DEPENDS=	${LOCALBASE}/bin/go:lang/go
 
-NO_BUILD=	yes
-WRKSRC=		${WRKDIR}/go-ipfs
+USE_GITHUB=	yes
+GH_PROJECT=	go-ipfs
+GH_SUBDIR=	src/github.com/ipfs/go-ipfs
 
 USE_RC_SUBR=	${PORTNAME}${PKGNAMESUFFIX}
 
+SUB_FILES=	${FULLNAME}
+SUB_LIST=	IPFS_USER=${IPFS_USER} \
+		IPFS_GROUP=${IPFS_GROUP} \
+		IPFS_LOGDIR=${IPFS_LOGDIR}
+PLIST_SUB=	IPFS_USER=${IPFS_USER} \
+		IPFS_GROUP=${IPFS_GROUP} \
+		IPFS_HOME=${IPFS_HOME} \
+		IPFS_LOGDIR=${IPFS_LOGDIR}
+
+IPFS_USER=	${FULLNAME}
+IPFS_GROUP=	${FULLNAME}
+IPFS_HOME=	/var/db/${PORTNAME}${PKGNAMESUFFIX}
+IPFS_LOGDIR=	/var/log/${PORTNAME}${PKGNAMESUFFIX}
+
+USERS=		${IPFS_USER}
+GROUPS=		${IPFS_GROUP}
+
+FULLNAME=	${PORTNAME}${PKGNAMESUFFIX}
+
+post-patch:
+	@${RLN} ${WRKDIR}/gx ${WRKSRC}/src
+
+do-build:
+	# To update ipfs-go-gx-${DISTVERSION}.tar.xz deps bundle:
+	# comment out post-patch, run the command below, tar ${WRKSRC}/src/gx and re-upload .tar.xz
+	# cd ${WRKSRC}/${GH_SUBDIR} && ${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} gx install
+	@cd ${WRKSRC}/${GH_SUBDIR} && \
+		${SETENV} ${MAKE_ENV} GOPATH=${WRKSRC} go build ./cmd/ipfs
+
 do-install:
+	@${MKDIR} ${STAGEDIR}${IPFS_HOME}
+	@${MKDIR} ${STAGEDIR}${IPFS_LOGDIR}
 	${INSTALL_PROGRAM} ${WRKSRC}/ipfs ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX}
 
 .include <bsd.port.mk>

Modified: head/sysutils/ipfs-go/distinfo
==============================================================================
--- head/sysutils/ipfs-go/distinfo	Thu Aug 30 18:53:09 2018	(r478486)
+++ head/sysutils/ipfs-go/distinfo	Thu Aug 30 19:37:36 2018	(r478487)
@@ -1,3 +1,5 @@
-TIMESTAMP = 1528920460
-SHA256 (go-ipfs_v0.4.15_freebsd-amd64.tar.gz) = 13e2514a62b17a81e2e1ce2dbcb38d7924a932c62f6a775f090a7458ef9fcccd
-SIZE (go-ipfs_v0.4.15_freebsd-amd64.tar.gz) = 9888465
+TIMESTAMP = 1534183965
+SHA256 (ipfs-go-gx-0.4.17.tar.xz) = 7f9f233048b61416789ff8573ec4adddbccdc21557f135d998167f2c2b04144f
+SIZE (ipfs-go-gx-0.4.17.tar.xz) = 11255440
+SHA256 (ipfs-go-ipfs-v0.4.17_GH0.tar.gz) = 2562401bee0609d321bbf5e9c383de4124f634dcfd9394f1d23146a49f281718
+SIZE (ipfs-go-ipfs-v0.4.17_GH0.tar.gz) = 728972

Modified: head/sysutils/ipfs-go/files/ipfs-go.in
==============================================================================
--- head/sysutils/ipfs-go/files/ipfs-go.in	Thu Aug 30 18:53:09 2018	(r478486)
+++ head/sysutils/ipfs-go/files/ipfs-go.in	Thu Aug 30 19:37:36 2018	(r478487)
@@ -4,35 +4,46 @@
 #
 
 # PROVIDE: ipfs_go
-# REQUIRE: NETWORKING
+# REQUIRE: DAEMON NETWORKING
 # BEFORE: LOGIN
 # KEYWORD: shutdown
 
-# Define these ipfs_go_* variables in /etc/rc.conf[.local]:
-#
+# Add the following lines to /etc/rc.conf to enable ipfs_go:
 # ipfs_go_enable="YES"
-# ipfs_go_path="/tank/ipfs"
+#
+# ipfs_go_enable (bool):    Set to YES to enable ipfs_go
+#                           Default: NO
+# ipfs_go_user (str):       ipfs_go daemon user
+#                           Default: %%IPFS_USER%%
+# ipfs_go_group (str):      ipfs_go daemon group
+#                           Default: %%IPFS_GROUP%%
 
 . /etc/rc.subr
 
-: ${ipfs_go_enable:="NO"}
-: ${ipfs_go_path:="/root/.ipfs"}
-
 name=ipfs_go
 rcvar=ipfs_go_enable
-command="%%PREFIX%%/bin/ipfs-go"
+load_rc_config $name
 
+: ${ipfs_go_enable:="NO"}
+: ${ipfs_go_user:="%%IPFS_USER%%"}
+: ${ipfs_go_group:="%%IPFS_GROUP%%"}
+
+logfile="%%IPFS_LOGDIR%%/${name}.log"
+pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/bin/ipfs-go"
 start_precmd="ipfs_go_prestart"
 start_cmd="ipfs_go_start"
 
 ipfs_go_prestart() {
-        [ -d ${ipfs_go_path}/datastore ] || env IPFS_PATH=${ipfs_go_path} ${command} init
+  install -d -o ${ipfs_go_user} -g ${ipfs_go_group} -m750 %%IPFS_LOGDIR%%
+  [ -d ~%%IPFS_USER%%/.ipfs ] || /usr/bin/su - ${ipfs_go_user} -c "${command} init"
 }
 
 ipfs_go_start() {
-	echo running ${command} daemon
-	env IPFS_PATH=${ipfs_go_path} daemon -f ${command} daemon
+  echo running ${command} daemon
+  export USER=${ipfs_go_user}
+  export HOME=$(echo ~%%IPFS_USER%%)
+  /usr/sbin/daemon -p ${pidfile} -u ${ipfs_go_user} ${command} daemon >> ${logfile} 2>&1
 }
 
-load_rc_config $name
 run_rc_command "$1"

Added: head/sysutils/ipfs-go/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/ipfs-go/pkg-plist	Thu Aug 30 19:37:36 2018	(r478487)
@@ -0,0 +1,5 @@
+bin/ipfs-go
+@owner %%IPFS_USER%%
+@group %%IPFS_GROUP%%
+@dir %%IPFS_HOME%%
+@dir %%IPFS_LOGDIR%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808301937.w7UJbae7041579>