git: dc20e3ca247c - main - www/opengist: Update to v1.14.0

Santhosh Raju <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by fox:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dc20e3ca247cf96ad09e3509c16ebc43a54d65e7

commit dc20e3ca247cf96ad09e3509c16ebc43a54d65e7
Author:     Dave Cottlehuber <[email protected]>
AuthorDate: 2026-08-19 09:03:15 +0000
Commit:     Santhosh Raju <[email protected]>
CommitDate: 2026-08-19 09:33:54 +0000

    www/opengist: Update to v1.14.0
    
    - Remove assets dir, they are already bundled in the binary
    - Fix the broken rc service that would not shut down correctly
    - Move the pidfiles to /var/run/ to avoid needing to create a dir
    - Use the prebuilt frontend assets published upstream, dropping the
      npm build dependency
    - Enable aarch64
    
    Reviewed by:    fox
    Differential Revision:  https://reviews.freebsd.org/D58255
---
 www/opengist/Makefile                 | 55 +++++++-----------------
 www/opengist/distinfo                 | 14 +++----
 www/opengist/files/opengist.in        | 42 ++++++++++++-------
 www/opengist/files/patch-package.json | 13 ------
 www/opengist/pkg-plist                | 79 -----------------------------------
 5 files changed, 50 insertions(+), 153 deletions(-)

diff --git a/www/opengist/Makefile b/www/opengist/Makefile
index a6741aa319f9..547feea1e84b 100644
--- a/www/opengist/Makefile
+++ b/www/opengist/Makefile
@@ -1,29 +1,24 @@
 PORTNAME=	opengist
-PORTVERSION=	1.13.1
-PORTREVISION=	2
+PORTVERSION=	1.14.0
 DISTVERSIONPREFIX=	v
 CATEGORIES=	www textproc
-MASTER_SITES=	LOCAL/fox/:js
-DISTFILES=	opengist-${DISTVERSION}-node_modules.tgz:js
+
+# prebuilt frontend assets published upstream (see upstream PR #768)
+MASTER_SITES+=	https://github.com/thomiceli/${PORTNAME}/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/:webdist
+DISTFILES+=	${PORTNAME}${DISTVERSION}-webdist.tar.gz:webdist
 
 MAINTAINER=	[email protected]
-COMMENT=	Self-hosted pastebin powered by Git, open-source alternative to Github Gist.
+COMMENT=	Self-hosted pastebin powered by Git, open-source alternative to Github Gist
 WWW=		https://opengist.io/
 
 LICENSE=	AGPLv3
 
 BROKEN_i386=	fails to build
-ONLY_FOR_ARCHS=	amd64
+ONLY_FOR_ARCHS=	aarch64 amd64
 
-BUILD_DEPENDS=	npm${NODEJS_SUFFIX}>0:www/npm${NODEJS_SUFFIX}
 RUN_DEPENDS=	git:devel/git
 
-USES=		go:1.26+,modules nodejs:24,build
-
-USE_GITHUB=	nodefault
-GH_ACCOUNT=	thomiceli
-GH_PROJECT=	opengist
-USE_RC_SUBR=	opengist
+USES=		go:1.26+,modules
 
 GO_MODULE=	github.com/thomiceli/opengist
 GO_ENV+=	GOTOOLCHAIN=local+path
@@ -31,47 +26,27 @@ GO_TARGET=	.
 GO_BUILDFLAGS=	-tags fs_embed \
 		-ldflags="-X github.com/thomiceli/opengist/internal/config.OpengistVersion=v${DISTVERSION}"
 
+USE_RC_SUBR=	opengist
+
 GROUPS=		opengist
 USERS=		opengist
 
+# The go:modules source zip extracts to WRKSRC; unpack prebuilt web assets
+# there.  The tarball wraps everything in a top-level opengist-webdist/
+# directory, so strip it to land .vite/ and assets/ directly under public/.
 post-extract:
-	@${RLN} ${WRKDIR}/node_modules ${WRKSRC}/node_modules
+	@${TAR} -xzf ${_DISTDIR}/${PORTNAME}${DISTVERSION}-webdist.tar.gz \
+		--strip-components=1 -C ${WRKSRC}/public
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|opengist.db|file:/var/db/${PORTNAME}/opengist.db|g' \
 		${WRKSRC}/config.yml
 
-pre-build:
-	cd ${WRKSRC} && \
-		${SETENV} ${MAKE_ENV} npx --offline vite -c public/vite.config.js \
-		build
-
 post-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/etc/${PORTNAME}
 	${INSTALL_DATA} ${WRKSRC}/config.yml \
 		${STAGEDIR}${PREFIX}/etc/${PORTNAME}/config.yml.sample
 	${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}
 	${MKDIR} ${STAGEDIR}/var/run/${PORTNAME}
-	${MKDIR} ${STAGEDIR}${WWWDIR}/assets
-	cd ${WRKSRC} && \
-		${INSTALL_DATA} public/assets/* \
-		${STAGEDIR}${WWWDIR}/assets
-
-#
-# To update the opengist-${DISTVERSION}-node_modules.tgz archive:
-# 1. Comment out the DISTFILES and post-extract lines
-# 2. Run 'make makesum regenerate-node_modules-distfile clean'
-# 3. Upload the archive
-# 4. Uncomment the lines from step #1
-# 5. Run 'make makesum'
-#
-
-regenerate-node_modules-distfile: patch
-	cd ${WRKSRC} && \
-		${RM} -r node_modules && \
-		${MAKE_ENV} npm install --prefix ${WRKSRC} && \
-		${TAR} czf ${DISTDIR}/opengist-${DISTVERSION}-node_modules.tgz \
-		node_modules && \
-		${ECHO} "Please upload the file ${DISTDIR}/opengist-${DISTVERSION}-node_modules.tgz"
 
 .include <bsd.port.mk>
diff --git a/www/opengist/distinfo b/www/opengist/distinfo
index e2f7632bd927..40053108de87 100644
--- a/www/opengist/distinfo
+++ b/www/opengist/distinfo
@@ -1,7 +1,7 @@
-TIMESTAMP = 1782567541
-SHA256 (go/www_opengist/opengist-v1.13.1/opengist-1.13.1-node_modules.tgz) = a30121da60dc4b8e6cc3d0d713784a80320e5a3156b796762f5c00c0a2b0101e
-SIZE (go/www_opengist/opengist-v1.13.1/opengist-1.13.1-node_modules.tgz) = 20316776
-SHA256 (go/www_opengist/opengist-v1.13.1/v1.13.1.mod) = 690e1e2f078792c942a684910aacb548807ff93884583dd94537c5ef2d1493a4
-SIZE (go/www_opengist/opengist-v1.13.1/v1.13.1.mod) = 5567
-SHA256 (go/www_opengist/opengist-v1.13.1/v1.13.1.zip) = 8c335d8a0789ace8a83b5fae9ba73aa46b563adc1d56b867cfbb7d70e0b50b46
-SIZE (go/www_opengist/opengist-v1.13.1/v1.13.1.zip) = 1757741
+TIMESTAMP = 1784995426
+SHA256 (go/www_opengist/opengist-v1.14.0/opengist1.14.0-webdist.tar.gz) = 10595dfcd0b55a89c8c7d1c7a39cb38caebca627093f78512ae5b3f7cef86e2b
+SIZE (go/www_opengist/opengist-v1.14.0/opengist1.14.0-webdist.tar.gz) = 1919094
+SHA256 (go/www_opengist/opengist-v1.14.0/v1.14.0.mod) = 8058902ecfea909764b339f2ba859e61854298dacd210fb39ea7390aba956679
+SIZE (go/www_opengist/opengist-v1.14.0/v1.14.0.mod) = 5782
+SHA256 (go/www_opengist/opengist-v1.14.0/v1.14.0.zip) = 2c0e8d0f005b5ee4e994e34b99969f5690010811a6fa224bad7aaab530ce44d3
+SIZE (go/www_opengist/opengist-v1.14.0/v1.14.0.zip) = 1830674
diff --git a/www/opengist/files/opengist.in b/www/opengist/files/opengist.in
index 3045dc3fa511..439abb3104da 100644
--- a/www/opengist/files/opengist.in
+++ b/www/opengist/files/opengist.in
@@ -8,8 +8,6 @@
 #
 # opengist_enable (bool):			Set it to "YES" to enable opengist server.
 # 						Default is "NO".
-# opengist_home (str):				Set the home directory for opengist server.
-#						Default is "%%WWWDIR%%".
 # opengist_user (str):				Set the user for running opengist server.
 #						Default is "opengist".
 # opengist_group (str):				Set the group for running opengist server.
@@ -22,6 +20,8 @@
 #						Default is "info"
 # opengist_syslog_output_facility (str):	Set logging facility
 #						Default is "daemon"
+# opengist_args (str):				Extra arguments passed to opengist.
+#						Default is "".
 
 . /etc/rc.subr
 
@@ -33,13 +33,13 @@ load_rc_config ${name}
 : ${opengist_enable:="NO"}
 : ${opengist_user:="opengist"}
 : ${opengist_group:="opengist"}
-: ${opengist_files:="/var/db/opengist/"}
-: ${opengist_home:="%%WWWDIR%%"}
 : ${opengist_config_file:="%%PREFIX%%/etc/${name}/config.yml"}
 : ${opengist_syslog_output_enable:="NO"}
 : ${opengist_syslog_output_priority:="info"}
 : ${opengist_syslog_output_facility:="daemon"}
+: ${opengist_args:=""}
 
+opengist_syslog_output_flags=""
 if checkyesno opengist_syslog_output_enable; then
 	opengist_syslog_output_flags="-t ${name} -T ${name}"
 
@@ -52,24 +52,38 @@ if checkyesno opengist_syslog_output_enable; then
 	fi
 fi
 
-pidfile=/var/run/opengist/${name}.pid
+pidfile="/var/run/${name}.pid"
+daemon_pidfile="/var/run/${name}-daemon.pid"
 procname="%%PREFIX%%/bin/${name}"
+command="/usr/sbin/daemon"
+command_args="-f -c ${opengist_syslog_output_flags} -p ${pidfile} -P ${daemon_pidfile} \
+    /usr/bin/env -i PATH=%%PREFIX%%/bin:${PATH} \
+    ${procname} -c ${opengist_config_file} ${opengist_args}"
 
-start_precmd="${name}_precmd"
+start_precmd=opengist_startprecmd
+stop_postcmd=opengist_stoppostcmd
 
-opengist_precmd()
+opengist_startprecmd()
 {
 	if [ ! -f ${opengist_config_file} ]; then
-		echo ${opengist_config_file} missing.
+		echo "${opengist_config_file} missing."
 		return 1
 	fi
+	if [ ! -e ${daemon_pidfile} ]; then
+		install -o ${opengist_user} -g ${opengist_group} /dev/null ${daemon_pidfile}
+	fi
+	if [ ! -e ${pidfile} ]; then
+		install -o ${opengist_user} -g ${opengist_group} /dev/null ${pidfile}
+	fi
 }
 
-command="/usr/sbin/daemon"
-command_args="-f ${opengist_syslog_output_flags} -p ${pidfile} \
-    /usr/bin/env -i \"PATH=%%PREFIX%%/bin:${PATH}\" \
-    ${procname} -c ${opengist_config_file}"
-
-cd ${opengist_home}
+opengist_stoppostcmd()
+{
+	if [ -f "${daemon_pidfile}" ]; then
+		pids=$( pgrep -F ${daemon_pidfile} 2>&1 )
+		_err=$?
+		[ ${_err} -eq 0 ] && kill -9 ${pids}
+	fi
+}
 
 run_rc_command "$1"
diff --git a/www/opengist/files/patch-package.json b/www/opengist/files/patch-package.json
deleted file mode 100644
index 5732bd3f6db5..000000000000
--- a/www/opengist/files/patch-package.json
+++ /dev/null
@@ -1,13 +0,0 @@
---- package.json.orig	1979-11-30 00:00:00 UTC
-+++ package.json
-@@ -28,5 +28,9 @@
-     "pdfobject": "^2.3.1",
-     "tailwindcss": "^4.3.0",
-     "vite": "^8.0.16"
--  }
-+  },
-+  "overrides": {
-+    "rollup": "npm:@rollup/wasm-node",
-+    "lightningcss": "npm:lightningcss-wasm"
-+   }    
- }
diff --git a/www/opengist/pkg-plist b/www/opengist/pkg-plist
index 065f3704ecaf..bd0817b7d9b3 100644
--- a/www/opengist/pkg-plist
+++ b/www/opengist/pkg-plist
@@ -1,83 +1,4 @@
 bin/opengist
 %%ETCDIR%%/config.yml.sample
-etc/rc.d/opengist
-%%WWWDIR%%/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2
-%%WWWDIR%%/assets/KaTeX_AMS-Regular-DMm9YOAa.woff
-%%WWWDIR%%/assets/KaTeX_AMS-Regular-DRggAlZN.ttf
-%%WWWDIR%%/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf
-%%WWWDIR%%/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff
-%%WWWDIR%%/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2
-%%WWWDIR%%/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff
-%%WWWDIR%%/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2
-%%WWWDIR%%/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf
-%%WWWDIR%%/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf
-%%WWWDIR%%/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff
-%%WWWDIR%%/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2
-%%WWWDIR%%/assets/KaTeX_Fraktur-Regular-CB_wures.ttf
-%%WWWDIR%%/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2
-%%WWWDIR%%/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff
-%%WWWDIR%%/assets/KaTeX_Main-Bold-Cx986IdX.woff2
-%%WWWDIR%%/assets/KaTeX_Main-Bold-Jm3AIy58.woff
-%%WWWDIR%%/assets/KaTeX_Main-Bold-waoOVXN0.ttf
-%%WWWDIR%%/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2
-%%WWWDIR%%/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf
-%%WWWDIR%%/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff
-%%WWWDIR%%/assets/KaTeX_Main-Italic-3WenGoN9.ttf
-%%WWWDIR%%/assets/KaTeX_Main-Italic-BMLOBm91.woff
-%%WWWDIR%%/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2
-%%WWWDIR%%/assets/KaTeX_Main-Regular-B22Nviop.woff2
-%%WWWDIR%%/assets/KaTeX_Main-Regular-Dr94JaBh.woff
-%%WWWDIR%%/assets/KaTeX_Main-Regular-ypZvNtVU.ttf
-%%WWWDIR%%/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf
-%%WWWDIR%%/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2
-%%WWWDIR%%/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff
-%%WWWDIR%%/assets/KaTeX_Math-Italic-DA0__PXp.woff
-%%WWWDIR%%/assets/KaTeX_Math-Italic-flOr_0UB.ttf
-%%WWWDIR%%/assets/KaTeX_Math-Italic-t53AETM-.woff2
-%%WWWDIR%%/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf
-%%WWWDIR%%/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2
-%%WWWDIR%%/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff
-%%WWWDIR%%/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2
-%%WWWDIR%%/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff
-%%WWWDIR%%/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf
-%%WWWDIR%%/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf
-%%WWWDIR%%/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff
-%%WWWDIR%%/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2
-%%WWWDIR%%/assets/KaTeX_Script-Regular-C5JkGWo-.ttf
-%%WWWDIR%%/assets/KaTeX_Script-Regular-D3wIWfF6.woff2
-%%WWWDIR%%/assets/KaTeX_Script-Regular-D5yQViql.woff
-%%WWWDIR%%/assets/KaTeX_Size1-Regular-C195tn64.woff
-%%WWWDIR%%/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf
-%%WWWDIR%%/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2
-%%WWWDIR%%/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf
-%%WWWDIR%%/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2
-%%WWWDIR%%/assets/KaTeX_Size2-Regular-oD1tc_U0.woff
-%%WWWDIR%%/assets/KaTeX_Size3-Regular-CTq5MqoE.woff
-%%WWWDIR%%/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf
-%%WWWDIR%%/assets/KaTeX_Size3-Regular-gV2CO0n9.woff2
-%%WWWDIR%%/assets/KaTeX_Size4-Regular-BF-4gkZK.woff
-%%WWWDIR%%/assets/KaTeX_Size4-Regular-DWFBv043.ttf
-%%WWWDIR%%/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2
-%%WWWDIR%%/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff
-%%WWWDIR%%/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2
-%%WWWDIR%%/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf
-%%WWWDIR%%/assets/admin-tJmhv7Qm.js
-%%WWWDIR%%/assets/auto-BAVJk2MF.css
-%%WWWDIR%%/assets/auto-DZFdjWn-.js
-%%WWWDIR%%/assets/chunk-Bh1tDfsg.js
-%%WWWDIR%%/assets/dark-BrgCWhxc.css
-%%WWWDIR%%/assets/dark-DVx5-msO.js
-%%WWWDIR%%/assets/editor-bMF3Jr84.js
-%%WWWDIR%%/assets/embed-BVydxoUT.css
-%%WWWDIR%%/assets/embed-DSIJTABY.js
-%%WWWDIR%%/assets/favicon-32-BHd4osPo.png
-%%WWWDIR%%/assets/gist-UBSG2TwP.js
-%%WWWDIR%%/assets/light-DgpT-POT.css
-%%WWWDIR%%/assets/light-XhZw2HnZ.js
-%%WWWDIR%%/assets/main-0mJA_5st.css
-%%WWWDIR%%/assets/main-Du4ZoMhO.js
-%%WWWDIR%%/assets/opengist-DI_FK2dF.svg
-%%WWWDIR%%/assets/style_preferences-B0RS7gZs.js
-%%WWWDIR%%/assets/webauthn-DHNm3GwH.js
 @dir(opengist,opengist,750) /var/db/opengist
 @dir(opengist,opengist,750) /var/run/opengist
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.