From owner-svn-ports-all@freebsd.org Thu Aug 30 19:37:37 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B60CBEF71FD; Thu, 30 Aug 2018 19:37:37 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70F6D8FE0A; Thu, 30 Aug 2018 19:37:37 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4550510E09; Thu, 30 Aug 2018 19:37:37 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7UJbaRW041583; Thu, 30 Aug 2018 19:37:36 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7UJbae7041579; Thu, 30 Aug 2018 19:37:36 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <201808301937.w7UJbae7041579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Thu, 30 Aug 2018 19:37:36 +0000 (UTC) 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 X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/sysutils/ipfs-go: . files X-SVN-Commit-Revision: 478487 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2018 19:37:37 -0000 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 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 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%%