git: 5dccc48cd792 - main - Mk/bsd.sites.mk: fall back to default WWW URLs for specific ports

From: Stefan Eßer <se_at_FreeBSD.org>
Date: Wed, 21 Sep 2022 11:24:14 UTC
The branch main has been updated by se:

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

commit 5dccc48cd79223d380ec932ba861296dbab114cf
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2022-09-21 08:21:40 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2022-09-21 11:23:44 +0000

    Mk/bsd.sites.mk: fall back to default WWW URLs for specific ports
    
    This change has been accepted as part of review D36558. A follow-up
    commit will apply the reminder of the patches in that review.
    
    A separate commit is used since providing default values for certain
    ports is logically different than support for multiple URLs in WWW.
    
    This commit adds default WWW values if the following conditions are
    met:
    
    1) no value assigned to the WWW macro by the port
    
    2) at least one of USE_GITHUB, USE_GITLAB, or USES=pear is used in
       the port
    
    Further defaults for USES cases could be added at a later time.
    
    The following values are used as default URLs:
    
    USES=pear:      https://pear.php.net/package/${PORTNAME}/
    USE_GITHUB:     https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/
    USE_GITLAB:     https://gitlab.com/${GL_ACCOUNT}/${GL_PROJECT}/
    
    If both a USES case and USE_GITHUB or USE_GITLAB apply, the default
    URL of the USES case takes precedence.
    
    Approved by:    portmgr (tcberner)
---
 Mk/Uses/pear.mk | 2 ++
 Mk/bsd.sites.mk | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/Mk/Uses/pear.mk b/Mk/Uses/pear.mk
index e9188f309c50..d18d2b20e9ab 100644
--- a/Mk/Uses/pear.mk
+++ b/Mk/Uses/pear.mk
@@ -40,6 +40,8 @@ MASTER_SITES?=	http://pear.php.net/get/
 EXTRACT_SUFX?=	.tgz
 DIST_SUBDIR?=	PEAR
 
+WWW?=		https://pear.php.net/package/${PORTNAME}/
+
 .      if empty(php_ARGS:Mphpize)
 NO_BUILD=	yes
 .      endif
diff --git a/Mk/bsd.sites.mk b/Mk/bsd.sites.mk
index 48cba97dbbca..22e0f586135d 100644
--- a/Mk/bsd.sites.mk
+++ b/Mk/bsd.sites.mk
@@ -449,6 +449,7 @@ git-clone-${_group}: ${_GITHUB_CLONE_DIR}
 .    endif
 convert-to-gh-tuple:
 	@${ECHO_MSG} ${GH_ACCOUNT}:${GH_PROJECT}:${GH_TAGNAME} ${_GH_TUPLE_OUT:S/\/$//}
+WWW?=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/
 .  endif # defined(USE_GITHUB)
 .endif # !defined(IGNORE_MASTER_SITE_GITHUB)
 
@@ -579,6 +580,7 @@ git-clone-${_group}: ${_GITLAB_CLONE_DIR}
 	@${ECHO_MSG} "Cloned the ${_group} GitLab repository into ${_GITLAB_CLONE_DIR}/${GL_PROJECT_${_group}}" | ${FMT_80}
 .      endfor
 .    endif
+WWW?=	https://gitlab.com/${GL_ACCOUNT}/${GL_PROJECT}/
 .  endif # defined(USE_GITLAB)
 .endif # !defined(IGNORE_MASTER_SITE_GITLAB)