Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2025 12:40:44 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        makc@freebsd.org, dev-commits-ports-main@freebsd.org
Subject:   Re: Literal text WWW in ports Makefile
Message-ID:  <86C62FD4-6A42-4C0A-BBD3-AD74A604C332@yahoo.com>

index | next in thread | raw e-mail

Max Brazhnikov <makc_at_freebsd.org> wrote on
Date: Sat, 15 Nov 2025 18:16:30 UTC :

> On Sat, 15 Nov 2025 12:55:03 -0400 DtxdF@disroot.org wrote:
> > > Can we avoid variables in WWW for easier reading when taking a look at 
> > > Makefiles? I remember that this subject was discussed some time ago...
> > 
> > From rene@, when we talked about this a while ago:
> > 
> > > Well, WWW is variable parsed by make, not by humans, so referencing
> 
> The whole Makefile is parsed by the make, however we do have style rules to
> ease reading Makefiles by contributes and committers.
> 
> > > PORTNAME is legal here. It *was* a literal text back when it was
> > > part of pkg-descr.
> 
> WWW also was a literal text when it just migrated to Makefile. Why it should
> be obfuscated now? No difference for the make, but less convenient for humans:
> plain text url can be opened from the editor without running the make.
> 
> I propose to supplement Porter's Handbook with a recommendation to avoid
> variables in WWW when it is explicitly set in the Makefile.
> 
> Shall we put it to the vote? :)

I'm aware of one port parameterized to support multiple sites in
both MASTER_SITES and in WWW (not just a variable holding a
constant value always being involved):

PORTNAME= wordpress
DISTVERSION= 6.8.3
PORTREVISION?= 0
.ifndef WORDPRESS_LANG
PORTEPOCH= 1
MASTER_SITES= https://wordpress.org/
.else
DISTVERSIONSUFFIX= -${WORDPRESS_LANG}
MASTER_SITES?= https://${WORDPRESS_LANG}.wordpress.org/
.endif
CATEGORIES+= www

MAINTAINER= joneum@FreeBSD.org
COMMENT= State-of-the-art semantic personal publishing platform
WWW= ${MASTER_SITES}
. . .

It may be that such unusual cases need to be allowed for.

(I'm not involved with wordpress. It was just a random
fact accidentally known.)


I'm also aware of the port's infrastruture providing WWW
automatically (only some are parameterized and some
below pattern match for other reasons):

# grep -r "WWW\>.*=" /usr/ports/Mk/
/usr/ports/Mk/bsd.sites.mk:WWW?=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/
/usr/ports/Mk/bsd.sites.mk:WWW?=	https://gitlab.com/${GL_ACCOUNT}/${GL_PROJECT}/
/usr/ports/Mk/Uses/kde.mk:WWW?=			https://kde.org/plasma-desktop/
/usr/ports/Mk/Uses/kde.mk:WWW?=			https://api.kde.org/frameworks/${PORTNAME}/html/index.html
/usr/ports/Mk/Uses/qt-dist.mk:WWW?=		https://www.qt.io/
/usr/ports/Mk/Uses/pear.mk:WWW?=		https://pear.php.net/package/${PORTNAME}/
/usr/ports/Mk/bsd.port.mk:_WWW=	${WWW:[1]}
/usr/ports/Mk/bsd.port.mk:			dp_WWW='${WWW}'

So it appears that sometimes WWW could be missing from the
Makefile instead of just having ${. . .} notation.

(Just another random fact accidentally known.)


===
Mark Millard
marklmi at yahoo.com



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86C62FD4-6A42-4C0A-BBD3-AD74A604C332>