From nobody Sun Aug 11 16:39:41 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Whjzd2Sjvz5TB6R; Sun, 11 Aug 2024 16:39:41 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Whjzd203pz4D1v; Sun, 11 Aug 2024 16:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723394381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pFCfDoC9c3IMqQZ3tdATZdsmTlw+AEYq7djtlheAtDg=; b=hKEZPf29fZJV+5nvmIRY5NMzHpj/9PaFHi/1KU5jL+gcFJYtEbCron4wZtEMOdUD8URD1O VnrQz3CcS115CP0vCbUDKvL2X/TpVwHQv/N9gJ/OwL/nHdklkzMy2fwACRNk2+IMnVlzsm j0T1cr30qePwVeW2WGMXQ9NQFvdhFLV+6Ra50v907np4Pc9RyY+f0Ly8mOmNk88Byx+QU+ ffjDvh2d3Do4mhwuCGpVg++Azxw5hjwYbAqgXuZpJhBF3Qr+5Vfl2LkrmIyD/NeAmChXdJ F9xpVbBtDEASOM+r18tLPLsE2XlybtKwA0wiYwRC3WHpjm9XR/ivbT3Zl7iuNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723394381; a=rsa-sha256; cv=none; b=rYNxM5woYlu8aNCd2U1ndZOxXRu5MKW4Ac8j/QPP2B2pTX3EorpcamakhWcFSiCOxjZCe/ E8OkcZ9L59Rt4Okx2kBl+MCRs3g3KKLcYPTWr+9twE/iBvfBqMVwSz55nF1/N7bHv+FJ5R 3CgS44Fu2wrg02xgvaH66lRsUtcYJX4ZIl4kecN9HTnxBJaD6/1T82BCQj3asDC5zOyPKJ tjW1BG2A4IHN+1PuOuO3liWmWm8p4hg9KFBzvqRuzuJwJOJlIy80WN34453RU8Yfq1qLgQ R90A93jh1HwpDUlRRePTRufweabSmaMZgufStgjAB1kycUCJTSC4Hk/K139Clg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723394381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pFCfDoC9c3IMqQZ3tdATZdsmTlw+AEYq7djtlheAtDg=; b=D7whVGSl0PkgDYjbTDZKWRmOxTl/HoNgWSy2OS1CZ9oh0Gn/y1zUKkz5+t9FsQbtcGLp8J PX1aYmvr2RK/37H9uhAmzXfX9aJncDZwewCvkJKRq+5aB7fXbt9SQOq0Ld5XndsGTU5dzK Ix4eddpwn/GelPFeXIFShW0wfwDcdheWNA7xihBtGA0IeDTZpvH6JBw/9TaNe82CRrfKK7 JrK2o60hH8bP17B3pW/b5TVglDyknuP5m/hI1FHocvGACbqZRovwKwfjgvPu3CbuOmRUN7 YOdyTxE9UPjcM32LJ4YbbPqxLdJXUUWJQMUDj9UCRCzoSJC0EZEQDYSO37uNcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Whjzd1TyzzrgN; Sun, 11 Aug 2024 16:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47BGdffj074525; Sun, 11 Aug 2024 16:39:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47BGdfZT074522; Sun, 11 Aug 2024 16:39:41 GMT (envelope-from git) Date: Sun, 11 Aug 2024 16:39:41 GMT Message-Id: <202408111639.47BGdfZT074522@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Vladimir Druzenko Subject: git: a1c9f292ea98 - main - mail/hydroxide: Add rc.d script to run as daemon and minor changes to Makefile List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vvd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1c9f292ea984baa1ed473910c8f2d39998c956a Auto-Submitted: auto-generated The branch main has been updated by vvd: URL: https://cgit.FreeBSD.org/ports/commit/?id=a1c9f292ea984baa1ed473910c8f2d39998c956a commit a1c9f292ea984baa1ed473910c8f2d39998c956a Author: Yusuf Yaman AuthorDate: 2024-08-11 16:37:56 +0000 Commit: Vladimir Druzenko CommitDate: 2024-08-11 16:37:56 +0000 mail/hydroxide: Add rc.d script to run as daemon and minor changes to Makefile Changes: * Add rc.d script to run as daemon because users had to run the port somehow in the background on terminal. * Minor changes to Makefile. PR: 280754 --- GIDs | 2 +- UIDs | 2 +- mail/hydroxide/Makefile | 13 +++++++----- mail/hydroxide/files/hydroxide.in | 43 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/GIDs b/GIDs index bf70d7250078..80afa5565441 100644 --- a/GIDs +++ b/GIDs @@ -321,7 +321,7 @@ _wsdd:*:370: # free: 378 # free: 379 spoofdpi:*:380: -# free: 381 +hydroxide:*:381: # free: 382 # free: 383 # free: 384 diff --git a/UIDs b/UIDs index 8c8d7e5c1d15..91822b11dd63 100644 --- a/UIDs +++ b/UIDs @@ -326,7 +326,7 @@ _wsdd:*:370:370::0:0:Web Service Discovery Daemon:/nonexistent:/usr/sbin/nologin # free: 378 # free: 379 spoofdpi:*:380:380::0:0:SpoofDPI Daemon:/nonexistent:/usr/sbin/nologin -# free: 381 +hydroxide:*:381:381::0:0:Hydroxide Daemon:/nonexistent:/usr/sbin/nologin # free: 382 # free: 383 # free: 384 diff --git a/mail/hydroxide/Makefile b/mail/hydroxide/Makefile index c961879118cf..c71c5b725d6b 100644 --- a/mail/hydroxide/Makefile +++ b/mail/hydroxide/Makefile @@ -1,7 +1,7 @@ PORTNAME= hydroxide DISTVERSIONPREFIX= v DISTVERSION= 0.2.29 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail MAINTAINER= nxjoseph@protonmail.com @@ -12,7 +12,6 @@ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:modules - USE_GITHUB= yes GH_ACCOUNT= emersion GH_TUPLE= ProtonMail:go-crypto:v1.0.0:protonmail_go_crypto/vendor/github.com/ProtonMail/go-crypto \ @@ -31,9 +30,13 @@ GH_TUPLE= ProtonMail:go-crypto:v1.0.0:protonmail_go_crypto/vendor/github.com/Pro golang:term:v0.19.0:golang_term/vendor/golang.org/x/term \ golang:text:v0.14.0:golang_text/vendor/golang.org/x/text -GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} -GO_TARGET= ./cmd/hydroxide +USE_RC_SUBR= ${PORTNAME} +GO_TARGET= ./cmd/${PORTNAME} +GO_BUILDFLAGS= -ldflags="-s -w" +SUB_LIST= USER=${USERS} +USERS= ${PORTNAME} +GROUPS= ${PORTNAME} -PLIST_FILES= bin/hydroxide +PLIST_FILES= bin/${PORTNAME} .include diff --git a/mail/hydroxide/files/hydroxide.in b/mail/hydroxide/files/hydroxide.in new file mode 100644 index 000000000000..9bbc41c4853a --- /dev/null +++ b/mail/hydroxide/files/hydroxide.in @@ -0,0 +1,43 @@ +#!/bin/sh + +# PROVIDE: hydroxide +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to +# enable hydroxide: +# hydroxide_args (str): Custom additional arguments to be passed +# hydroxide (default empty). +# hydroxide_user (str): User to run hydroxide as. Default +# to "%%USER%%" created by the port. +# hydroxide_log (path): Console log file (default /dev/null). + +. /etc/rc.subr + +case $0 in +/etc/rc*) + # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), + # so get the name of the script from $_file + name=$_file + ;; +*) + name=$0 + ;; +esac + +name=${name##*/} +rcvar="${name}_enable" + +load_rc_config "${name}" + +eval "${rcvar}=\${${rcvar}:-'NO'}" +eval "_args=\${${name}_args:-''}" +eval "_user=\${${name}_user:-'%%USER%%'}" +eval "_log=\${${name}_log:-/dev/null}" + +pidfile="/var/run/${name}.pid" + +command="/usr/sbin/daemon" +command_args="-P ${pidfile} -u ${_user} -f -H -o ${_log} -m 3 %%PREFIX%%/bin/hydroxide ${_args} serve" + +run_rc_command "$1"