pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/57768: www/gitweb generates a broken CGI file for gitweb



>Number:         57768
>Category:       pkg
>Synopsis:       www/gitweb generates a broken CGI file for gitweb
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 13 03:15:00 +0000 2023
>Originator:     Pierre Pronchery
>Release:        pkgsrc-2023Q3
>Organization:
>Environment:
NetBSD reapr.station.defora 9.3_STABLE NetBSD 9.3_STABLE (GENERIC) #0: Sun Aug 27 17:57:58 UTC 2023  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
The Makefile for www/gitweb sets the right PERL_PATH=${PERL5:Q} for the build to pick up the path to Perl, but somehow the gitweb.cgi file is generated with the broken shebang "#!".

The real cause for the problem however is that the build infrastructure for gitweb has changed upstream, and the Makefile in the "gitweb" sub-folder should no longer be used directly.

The patch included here:

* Builds and installs gitweb with the top-level Makefile
* Sticks to the path used upstream for the static files (moving them to htdocs/static for us)
* Reflects this change in the PLIST
* Therefore also bumps the PKGREVISION

The reason behind the move to htdocs/static has to do with the broken Makefile upstream in gitweb/Makefile, which also follows the PLA and will be easier to maintain.
>How-To-Repeat:
$ cd www/gitweb
$ make stage-install
$ head -n 1 work/.destdir/usr/pkg/libexec/cgi-bin/gitweb.cgi
#!

(It should be #!/usr/pkg/bin/perl instead for instance)
>Fix:
From cf698cba17f921556fee42afc84f04644ed460f9 Mon Sep 17 00:00:00 2001
From: Pierre Pronchery <khorben%EdgeBSD.org@localhost>
Date: Wed, 13 Dec 2023 03:43:53 +0100
Subject: [PATCH] gitweb: fix the path to perl

This also moves the static files into a "static" folder, as per
upstream.
---
 www/gitweb/Makefile | 25 ++++++++++---------------
 www/gitweb/PLIST    |  8 ++++----
 2 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/www/gitweb/Makefile b/www/gitweb/Makefile
index ec02051bbe88..371db72ed3dc 100644
--- a/www/gitweb/Makefile
+++ b/www/gitweb/Makefile
@@ -3,6 +3,7 @@
 .include "../../devel/git/Makefile.common"
 
 PKGNAME=	${DISTNAME:S/git/gitweb/}
+PKGREVISION=	1
 CATEGORIES=	www
 
 COMMENT=	Web interface for GIT repositories
@@ -12,17 +13,14 @@ DEPENDS+=	p5-CGI-[0-9]*:../../www/p5-CGI
 
 USE_TOOLS+=	perl:run
 
-BUILD_DIRS=	gitweb
-BUILD_TARGET=	gitweb.cgi static/gitweb.js
-MAKE_FLAGS=	prefix=${PREFIX}
-MAKE_FLAGS+=	GITWEB_FAVICON=/gitweb/git-favicon.png
+BUILD_TARGET=	gitweb
+MAKE_FLAGS=	gitwebdir=${GITWEB_CGIBIN}
+MAKE_FLAGS+=	gitwebstaticdir=${GITWEB_HTDOCS}/static
+MAKE_FLAGS+=	prefix=${PREFIX}
 MAKE_FLAGS+=	GITWEB_CONFIG=${GITWEB_CONFIG}
-MAKE_FLAGS+=	GITWEB_CSS=/gitweb/gitweb.css
 MAKE_FLAGS+=	GITWEB_HOMETEXT=${GITWEB_HTDOCS}/indextext.html
-MAKE_FLAGS+=	GITWEB_LOGO=/gitweb/git-logo.png
-MAKE_FLAGS+=	GITWEB_JS=/gitweb/gitweb.js
+MAKE_FLAGS+=	INSTALL=${INSTALL:Q}
 MAKE_FLAGS+=	PERL_PATH=${PERL5:Q}
-MAKE_FLAGS+=	MAK_DIR_GITWEB=./
 
 GITWEB_CONFIG=	${PKG_SYSCONFDIR}/gitweb.conf
 GITWEB_CGIBIN=	${PREFIX}/libexec/cgi-bin
@@ -33,14 +31,11 @@ GITWEB_EGDIR=	${PREFIX}/share/examples/gitweb
 CONF_FILES=	${GITWEB_EGDIR}/gitweb.conf ${PKG_SYSCONFDIR}/gitweb.conf
 MESSAGE_SUBST+=	CONFFILE=${PKG_SYSCONFDIR}/gitweb.conf
 
-INSTALLATION_DIRS=	libexec/cgi-bin share/doc/gitweb \
-			${GITWEB_EGDIR} ${GITWEB_HTDOCS}
+INSTALLATION_DIRS=	share/doc/gitweb ${GITWEB_EGDIR}
 
-do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/gitweb/gitweb.cgi ${DESTDIR}${GITWEB_CGIBIN}
-.for f in git-favicon.png git-logo.png gitweb.css gitweb.js
-	${INSTALL_DATA} ${WRKSRC}/gitweb/static/${f} ${DESTDIR}${GITWEB_HTDOCS}
-.endfor
+INSTALL_TARGET=	install-gitweb
+
+post-install:
 	${INSTALL_DATA} ${WRKSRC}/gitweb/README \
 		${DESTDIR}${PREFIX}/share/doc/gitweb
 	${INSTALL_DATA} ${FILESDIR}/gitweb.conf ${DESTDIR}${GITWEB_EGDIR}
diff --git a/www/gitweb/PLIST b/www/gitweb/PLIST
index 5a9c8a9a3622..40fdb13a35e6 100644
--- a/www/gitweb/PLIST
+++ b/www/gitweb/PLIST
@@ -2,7 +2,7 @@
 libexec/cgi-bin/gitweb.cgi
 share/doc/gitweb/README
 share/examples/gitweb/gitweb.conf
-share/examples/gitweb/htdocs/git-favicon.png
-share/examples/gitweb/htdocs/git-logo.png
-share/examples/gitweb/htdocs/gitweb.css
-share/examples/gitweb/htdocs/gitweb.js
+share/examples/gitweb/htdocs/static/git-favicon.png
+share/examples/gitweb/htdocs/static/git-logo.png
+share/examples/gitweb/htdocs/static/gitweb.css
+share/examples/gitweb/htdocs/static/gitweb.js
-- 
2.42.0



Home | Main Index | Thread Index | Old Index