From nobody Wed Sep 07 19:41:12 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MNCL054Cwz4byNs; Wed, 7 Sep 2022 19:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MNCL04df2z3KqN; Wed, 7 Sep 2022 19:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662579672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3mmqo8gZzTFZ8nL4B6QWbf4QkAqz1FyXaNTJPGmcqXw=; b=Akj82IID3wqfSa9wS0cVCkBYjSN3XlZbLW2OSaWPzX7dyUcqhc0DB9pfTkGPtW6CJkCTSh 7cWfx68e8/LnvSAQgcktqcpEWktXpa0BK7ri/G/B2DG7ful4amFz0Ovg00hZnCKriEDb6c WONB+i+TilFLRLfpkkb0+ucfAsTz+KqLis+Pz+tG2+CoaWJB1xFEnjGXR8UuNnSxt0U2vr MYQOMIxPeXYDAP3Clg559kxgHjIb5Wg2WebSYPioo5cCZNdAUDUGmqJFFq+g+0JQYEI40U 1H2k9SYd9PIfE1Y4A7Ld8HgizK5FRgFXIkPc37c+FqrnLuuEl2W9cAJVLlzVLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MNCL03gmTzdfZ; Wed, 7 Sep 2022 19:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 287JfCGC062080; Wed, 7 Sep 2022 19:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 287JfCRU062079; Wed, 7 Sep 2022 19:41:12 GMT (envelope-from git) Date: Wed, 7 Sep 2022 19:41:12 GMT Message-Id: <202209071941.287JfCRU062079@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: ddd0e820c8eb - main - Mk/bsd.ports.mk: Add suppport for WWW in Makefiles List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddd0e820c8eb73acef94c72434c382982d0fa329 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662579672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3mmqo8gZzTFZ8nL4B6QWbf4QkAqz1FyXaNTJPGmcqXw=; b=d51fqQ/hhPirI37CRCj58wNBKs6J2/b7JLN8t9W1bpS++08wnTpa0MPIElypAC5k1A2lJE recqFh8AKany67m3gwnBI8i7eZ+pZEtrSAaHB6UP46MuQbS5xGVmPMdWSK4ORoAijqywXH 2EIZZLGbH3tb8vNH47vuSBeO9/s776N00k9xq1IVURdsGm6Rm71G5CIJ+H3Gz2Lw2WzaVK /0hF8g5/rZBv2whfFYMXwrWCZDHtwXeJ/YR/zcqQiW0TV34z98wcpw+6lBKdp5ExoFI8tS EjdAc4aunpCSNV2HJ1Iy/72RassUv/fGp3+paqtyHImTjkL/Fwnhu0dhydXHlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662579672; a=rsa-sha256; cv=none; b=teytwOAreq2qRdZueq/4JQDTmIwDmGapmmzGITdpOULRyfz+nRkuYrAAtqXrnsDNwCp4Q7 w5OT7b+mOTEdph0dfw0sd3KnNqaiD/Lgq8Pm+3/GonG0xiNgXmN/QgAsXvY2V4hrnEc7sY sDR0LyDT/dgmHfVzSHr0gPBisNFhm+jK/CaZapcXuoYTN2oG8q5En+4ngSj78Ws7R4Ubg0 VTY/Qbj5HzcRs94zIrmhBy6QqJK08VT/ZXKJ/eZ/he/+slr8yoSffpV68eSfsotkXqcQEE 0q5kfQkewqFUN9yngMr3jazIGcHuzqzd7lczxsqDBTK6XBBRdtQKEVSIPRMGnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/ports/commit/?id=ddd0e820c8eb73acef94c72434c382982d0fa329 commit ddd0e820c8eb73acef94c72434c382982d0fa329 Author: Stefan Eßer AuthorDate: 2022-09-07 19:32:54 +0000 Commit: Stefan Eßer CommitDate: 2022-09-07 19:32:54 +0000 Mk/bsd.ports.mk: Add suppport for WWW in Makefiles Expect the project website or other relevant URL of a port to be specified in a WWW macro in its Makefile. This information used to be available in WWW: lines at the end of each port's pkg-descr file. By moving it into the Makefile, this value is easier to access, verify, and maintain. A WWW: line is added to the "desc" element of package manifests based on the WWW macro value by the create-manifest.sh script. This restores the previous contents of this line in the manifest (as e.g. expected by the Freshports website). The ports-mgmt/portlint port has been updated in commit 9800743f0 (version 2.19.13) to support the planned introduction of WWW in port Makefiles. Approved by: portmgr (tcberner) Differential Revision: https://reviews.freebsd.org/D36434 --- Mk/Scripts/create-manifest.sh | 4 ++++ Mk/bsd.port.mk | 43 +++++++++++++++---------------------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/Mk/Scripts/create-manifest.sh b/Mk/Scripts/create-manifest.sh index 8619a6959cbe..252fcead9103 100644 --- a/Mk/Scripts/create-manifest.sh +++ b/Mk/Scripts/create-manifest.sh @@ -87,6 +87,10 @@ fi # Copy the pkg-descr file cp ${dp_DESCR} ${dp_METADIR}/+DESC +if [ -n "${dp_WWW}" ] && ! grep -q '^WWW: ' ${dp_DESCR}; then + echo >> ${dp_METADIR}/+DESC + echo "WWW: ${dp_WWW}" >> ${dp_METADIR}/+DESC +fi # Concatenate all the scripts output_files= diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index a68ace6f5fdb..e080b81a64d8 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -123,9 +123,13 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org # # (NOTE: by convention, the MAINTAINER entry (see above) should go here.) # -# These variables are typically set in /etc/make.conf to indicate -# the user's preferred location to fetch files from. You should -# rarely need to set these. +# COMMENT - A short description of the package (less than 70 characters) +# WWW - URL users can get more information on the provided package +# was previously part of pkg-descr +# +# The following variables are typically set in /etc/make.conf to indicate +# the user's preferred location to fetch files from. You should rarely +# need to set these. # # MASTER_SITE_BACKUP # - Backup location(s) for distribution files and patch @@ -3595,12 +3599,11 @@ security-check: ${TMPPLIST} ! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${SCRIPTSDIR}/security-check.awk \ ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.readelf ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \ then \ - www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \ - if [ ! -z "$${www_site}" ]; then \ + if [ ! -z "${_WWW}" ]; then \ ${ECHO_MSG}; \ ${ECHO_MSG} " For more information, and contact details about the security"; \ ${ECHO_MSG} " status of this software, see the following webpage: "; \ - ${ECHO_MSG} "$${www_site}"; \ + ${ECHO_MSG} "${_WWW}"; \ fi; \ fi . endif @@ -3655,10 +3658,9 @@ ${stage}-${name}-script: . if !target(pretty-print-www-site) pretty-print-www-site: - @www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \ - if [ -n "$${www_site}" ]; then \ + @if [ -n "${_WWW}" ]; then \ ${ECHO_MSG} -n " and/or visit the "; \ - ${ECHO_MSG} -n "web site"; \ + ${ECHO_MSG} -n "web site"; \ ${ECHO_MSG} " for further information"; \ fi . endif @@ -4285,7 +4287,7 @@ create-manifest: dp_PORT_OPTIONS='${PORT_OPTIONS}' \ dp_PREFIX='${PREFIX}' \ dp_USERS='${USERS:u:S/$/,/}' \ - dp_WWW='${WWW}' \ + dp_WWW='${_WWW}' \ ${PKG_NOTES_ENV} \ ${SH} ${SCRIPTSDIR}/create-manifest.sh @@ -4349,6 +4351,7 @@ _FETCH_DEPENDS=${FETCH_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C _LIB_DEPENDS=${LIB_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} _BUILD_DEPENDS=${BUILD_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS} _RUN_DEPENDS=${RUN_DEPENDS:C/^[^ :]+:([^ :@]+)(@[^ :]+)?(:[^ :]+)?/\1/:O:u:C,(^[^/]),${PORTSDIR}/\1,} ${_LIB_DEPENDS} +_WWW=${WWW:U${MASTER_SITES:[1]}} . if exists(${DESCR}) _DESCR=${DESCR} . else @@ -4363,19 +4366,7 @@ INDEX_OUT=/dev/stdout . if empty(FLAVORS) || defined(_DESCRIBE_WITH_FLAVOR) describe: - @(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \ - ${ECHO_CMD} -n ${COMMENT:Q}; \ - ${ECHO_CMD} -n "|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|"; \ - while read one two discard; do \ - case "$$one" in \ - WWW:) case "$$two" in \ - https://*|http://*|ftp://*) ${ECHO_CMD} -n "$$two" ;; \ - *) ${ECHO_CMD} -n "http://$$two" ;; \ - esac; \ - break; \ - ;; \ - esac; \ - done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT} + @(${ECHO_CMD} "${PKGNAME}|${.CURDIR}|${PREFIX}|${COMMENT:Q}|${_DESCR}|${MAINTAINER}|${CATEGORIES}|${_EXTRACT_DEPENDS}|${_PATCH_DEPENDS}|${_FETCH_DEPENDS}|${_BUILD_DEPENDS:O:u}|${_RUN_DEPENDS:O:u}|${_WWW}" >> ${INDEX_OUT}) . else # empty(FLAVORS) describe: ${FLAVORS:S/^/describe-/} . for f in ${FLAVORS} @@ -4386,11 +4377,7 @@ describe-${f}: . endif www-site: -. if exists(${DESCR}) - @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1 -. else - @${ECHO_CMD} -. endif + @${ECHO_CMD} ${_WWW} . if !target(readmes) readmes: readme