From owner-svn-ports-head@freebsd.org Wed Jan 30 19:22:59 2019 Return-Path: Delivered-To: svn-ports-head@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 06DEC14CAB07; Wed, 30 Jan 2019 19:22:59 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EB8B82488; Wed, 30 Jan 2019 19:22:58 +0000 (UTC) (envelope-from swills@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 6EBBE23ADC; Wed, 30 Jan 2019 19:22:54 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0UJMsBU021503; Wed, 30 Jan 2019 19:22:54 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0UJMr0l021499; Wed, 30 Jan 2019 19:22:53 GMT (envelope-from swills@FreeBSD.org) Message-Id: <201901301922.x0UJMr0l021499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Wed, 30 Jan 2019 19:22:53 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r491652 - in head/sysutils/ipfs-go: . files X-SVN-Group: ports-head X-SVN-Commit-Author: swills X-SVN-Commit-Paths: in head/sysutils/ipfs-go: . files X-SVN-Commit-Revision: 491652 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EB8B82488 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 19:22:59 -0000 Author: swills Date: Wed Jan 30 19:22:53 2019 New Revision: 491652 URL: https://svnweb.freebsd.org/changeset/ports/491652 Log: sysutils/ipfs-go: fix rc script * Fix the rc script when default ipfs_go_path is used * Fix the logging by switching to uses the syslog logging in daemon * Switch the init to using the --init flag to the ipfs daemon command * Fixes the version string since the tarball provided by upstream doesn't match the tag for this release (has version string wrong) * Allow overriding IPFS_USER/GROUP/HOME at build time * Remove unnecessary BEFORE: LOGIN from rc script PR: 235222 Approved by: jhixson (maintainer) Added: head/sysutils/ipfs-go/files/patch-version.go (contents, props changed) Modified: head/sysutils/ipfs-go/Makefile (contents, props changed) head/sysutils/ipfs-go/files/ipfs-go.in head/sysutils/ipfs-go/pkg-plist (contents, props changed) Modified: head/sysutils/ipfs-go/Makefile ============================================================================== --- head/sysutils/ipfs-go/Makefile Wed Jan 30 19:22:34 2019 (r491651) +++ head/sysutils/ipfs-go/Makefile Wed Jan 30 19:22:53 2019 (r491652) @@ -3,7 +3,7 @@ PORTNAME= ipfs DISTVERSIONPREFIX= v DISTVERSION= 0.4.18 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= https://github.com/ipfs/go-ipfs/releases/download/v${DISTVERSION}/ PKGNAMESUFFIX= -go @@ -29,16 +29,14 @@ USE_RC_SUBR= ${PORTNAME}${PKGNAMESUFFIX} SUB_FILES= ${FULLNAME} SUB_LIST= IPFS_USER=${IPFS_USER} \ IPFS_GROUP=${IPFS_GROUP} \ - IPFS_LOGDIR=${IPFS_LOGDIR} + IPFS_HOME=${IPFS_HOME} PLIST_SUB= IPFS_USER=${IPFS_USER} \ IPFS_GROUP=${IPFS_GROUP} \ - IPFS_HOME=${IPFS_HOME} \ - IPFS_LOGDIR=${IPFS_LOGDIR} + IPFS_HOME=${IPFS_HOME} -IPFS_USER= ${FULLNAME} -IPFS_GROUP= ${FULLNAME} -IPFS_HOME= /var/db/${PORTNAME}${PKGNAMESUFFIX} -IPFS_LOGDIR= /var/log/${PORTNAME}${PKGNAMESUFFIX} +IPFS_USER?= ${FULLNAME} +IPFS_GROUP?= ${FULLNAME} +IPFS_HOME?= /var/db/${FULLNAME} USERS= ${IPFS_USER} GROUPS= ${IPFS_GROUP} @@ -47,7 +45,6 @@ FULLNAME= ${PORTNAME}${PKGNAMESUFFIX} do-install: @${MKDIR} ${STAGEDIR}${IPFS_HOME} - @${MKDIR} ${STAGEDIR}${IPFS_LOGDIR} ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/ipfs ${STAGEDIR}${PREFIX}/bin/${PORTNAME}${PKGNAMESUFFIX} .include Modified: head/sysutils/ipfs-go/files/ipfs-go.in ============================================================================== --- head/sysutils/ipfs-go/files/ipfs-go.in Wed Jan 30 19:22:34 2019 (r491651) +++ head/sysutils/ipfs-go/files/ipfs-go.in Wed Jan 30 19:22:53 2019 (r491652) @@ -5,22 +5,23 @@ # PROVIDE: ipfs_go # REQUIRE: DAEMON NETWORKING -# BEFORE: LOGIN # KEYWORD: shutdown -# Add the following lines to /etc/rc.conf to enable ipfs_go: -# ipfs_go_enable="YES" -# -# 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%% -# ipfs_go_path (str): ipfs_go ipfs repo path -# Default: %%IPFS_HOME%% +# ipfs_go_enable (bool): Set to NO by default +# Set to YES to enable ipfs_go +# ipfs_go_user (str): Set to %%IPFS_USER%% by default +# Set it to ipfs_go daemon user +# ipfs_go_group (str): Set to %%IPFS_GROUP%% by default +# Set it to ipfs_go daemon group +# ipfs_go_path (str): Set to %%IPFS_HOME%%/.ipfs by default +# Set it to ipfs repo path +# ipfs_go_syslog_priority (str): Set to "info" by default. +# Set it to priority to be used by syslog +# ipfs_go_syslog_facility (str): Set to "daemon" by default. +# Set it to facility to be used by syslog +# ipfs_go_syslog_tag (str): Set to "ipfs-go" by default. +# Set it to tag to be used by syslog - . /etc/rc.subr name=ipfs_go @@ -30,25 +31,23 @@ load_rc_config $name : ${ipfs_go_enable:="NO"} : ${ipfs_go_user:="%%IPFS_USER%%"} : ${ipfs_go_group:="%%IPFS_GROUP%%"} -: ${ipfs_go_path:="%%IPFS_HOME%%"} +: ${ipfs_go_path:="%%IPFS_HOME%%/.ipfs"} +: ${ipfs_go_syslog_priority:="info"} +: ${ipfs_go_syslog_facility:="daemon"} +: ${ipfs_go_syslog_tag:="ipfs-go"} -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() { - install -d -o ${ipfs_go_user} -g ${ipfs_go_group} -m750 %%IPFS_LOGDIR%% - [ -d ${ipfs_go_path} ] || /usr/bin/su - ${ipfs_go_user} -c "env IPFS_PATH=${ipfs_go_path} ${command} init" -} +command="/usr/sbin/daemon" +command_args="-S -m 3 -s ${ipfs_go_syslog_priority} -l ${ipfs_go_syslog_facility} -T ${ipfs_go_syslog_tag} -p ${pidfile} /usr/bin/env IPFS_PATH=${ipfs_go_path} ${ipfs_go_env} %%PREFIX%%/bin/ipfs-go daemon --init --init-profile=server --migrate=true ${ipfs_go_args}" +procname="%%PREFIX%%/bin/ipfs-go" -ipfs_go_start() { - echo running ${command} daemon - export USER=${ipfs_go_user} - export HOME=$(echo ~%%IPFS_USER%%) - export IPFS_PATH=${ipfs_go_path} - /usr/sbin/daemon -p ${pidfile} -u ${ipfs_go_user} ${command} daemon >> ${logfile} 2>&1 +start_precmd="ipfs_go_startprecmd" + +ipfs_go_startprecmd() { + if [ ! -e "${pidfile}" ]; then + install -g ${ipfs_go_group} -o ${ipfs_go_user} -- /dev/null "${pidfile}" + fi } run_rc_command "$1" Added: head/sysutils/ipfs-go/files/patch-version.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/ipfs-go/files/patch-version.go Wed Jan 30 19:22:53 2019 (r491652) @@ -0,0 +1,10 @@ +--- version.go.orig 2019-01-26 18:22:10 UTC ++++ version.go +@@ -4,6 +4,6 @@ package ipfs + var CurrentCommit string + + // CurrentVersionNumber is the current application's version literal +-const CurrentVersionNumber = "0.4.19-dev" ++const CurrentVersionNumber = "0.4.18" + + const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/" Modified: head/sysutils/ipfs-go/pkg-plist ============================================================================== --- head/sysutils/ipfs-go/pkg-plist Wed Jan 30 19:22:34 2019 (r491651) +++ head/sysutils/ipfs-go/pkg-plist Wed Jan 30 19:22:53 2019 (r491652) @@ -2,4 +2,3 @@ bin/ipfs-go @owner %%IPFS_USER%% @group %%IPFS_GROUP%% @dir %%IPFS_HOME%% -@dir %%IPFS_LOGDIR%%