Enclosed is a patch to the cvsweb port to add a new flavour, "chroot". This configures the script (and its default configuration) to run in the /var/www chroot.
By default, the flavour is "unsafe", which uses the existing way of referring to /var/www/whatever. Best, Kristaps
Index: Makefile =================================================================== RCS file: /cvs/ports/devel/cvsweb/Makefile,v retrieving revision 1.60 diff -u -p -r1.60 Makefile --- Makefile 4 Sep 2018 12:46:10 -0000 1.60 +++ Makefile 10 Dec 2018 09:45:14 -0000 @@ -2,8 +2,11 @@ COMMENT= CGI script to browse CVS repository trees +FLAVORS= chroot unsafe +FLAVOR ?= unsafe + DISTNAME= cvsweb-2.0.6 -REVISION= 26 +REVISION= 27 CATEGORIES= devel www HOMEPAGE= http://www.freebsd.org/projects/cvsweb.html @@ -20,13 +23,20 @@ PKG_ARCH= * PREFIX= ${VARBASE}/www CONFDIR= ${PREFIX}/conf +.if ${FLAVOR:Munsafe} +RCONFDIR= ${CONFDIR} +.else +RCONFDIR= /conf +.endif + ICONS= back.gif dir.gif text.gif \ miniback.gif minidir.gif minitext.gif -SUBST_VARS= CONFDIR +SUBST_VARS= RCONFDIR do-configure: - @perl -i -pe 's@%%CONFDIR%%@${CONFDIR}@g' ${WRKSRC}/cvsweb.cgi + @perl -i -pe 's@%%CONFDIR%%@${RCONFDIR}@g' ${WRKSRC}/cvsweb.cgi + @perl -i -pe 's@%%CONFDIR%%@${RCONFDIR}@g' ${WRKSRC}/cvsweb.conf do-install: ${INSTALL_SCRIPT_DIR} ${PREFIX}/cgi-bin Index: patches/patch-cvsweb_cgi =================================================================== RCS file: /cvs/ports/devel/cvsweb/patches/patch-cvsweb_cgi,v retrieving revision 1.13 diff -u -p -r1.13 patch-cvsweb_cgi --- patches/patch-cvsweb_cgi 7 Apr 2013 20:07:24 -0000 1.13 +++ patches/patch-cvsweb_cgi 10 Dec 2018 09:45:14 -0000 @@ -1,6 +1,7 @@ $OpenBSD: patch-cvsweb_cgi,v 1.13 2013/04/07 20:07:24 naddy Exp $ ---- cvsweb.cgi.orig Thu Sep 26 22:56:05 2002 -+++ cvsweb.cgi Sun Apr 7 14:15:55 2013 +Index: cvsweb.cgi +--- cvsweb.cgi.orig ++++ cvsweb.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -w Index: patches/patch-cvsweb_conf =================================================================== RCS file: /cvs/ports/devel/cvsweb/patches/patch-cvsweb_conf,v retrieving revision 1.13 diff -u -p -r1.13 patch-cvsweb_conf --- patches/patch-cvsweb_conf 26 Jul 2014 19:38:03 -0000 1.13 +++ patches/patch-cvsweb_conf 10 Dec 2018 09:45:14 -0000 @@ -7,7 +7,7 @@ $OpenBSD: patch-cvsweb_conf,v 1.13 2014/ ############## -$mancgi = - "http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.0-current&format=html"; -+$mancgi = "http://www.openbsd.org/cgi-bin/man.cgi?&sec=%s&query=%s"; ++$mancgi = "http://man.openbsd.org/cgi-bin/man.cgi?&sec=%s&query=%s"; ############## # Defaults for UserSettings @@ -53,7 +53,7 @@ $OpenBSD: patch-cvsweb_conf,v 1.13 2014/ # checkout; you can use the mime.types from # apache here: -$mime_types = '/usr/local/etc/apache/mime.types'; -+$mime_types = '/var/www/conf/mime.types'; ++$mime_types = '%%CONFDIR%%/mime.types'; # quick mime-type lookup; maps file-suffices to # mime-types for displaying checkouts in the browser.