From 5ebf566f7d4bd021979b965d3d2d0de8e4561abd Mon Sep 17 00:00:00 2001 From: rillig Date: Wed, 28 Sep 2005 08:24:52 +0000 Subject: Added a variable LICENSE_FILE that may be set to point to the license file of the package. It does _not_ replace the LICENSE variable. The variable is currently only used in the show-license target. It is intended that LICENSE_FILE is used for licenses that only apply to a single package or a package group, so that the number of licenses in the licenses/ directory is kept small. --- mk/bsd.pkg.mk | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index ffe371aa9b2..38111db029d 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1719 2005/09/16 06:09:02 jlam Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1720 2005/09/28 08:24:52 rillig Exp $ # # This file is in the public domain. # @@ -3945,19 +3945,20 @@ print-summary-data: @${ECHO} "prefix ${PKGPATH} ${PREFIX}" .endif +LICENSE_FILE?= ${PKGSRCDIR}/licenses/${LICENSE} + .if !target(show-license) show-license show-licence: - @if [ "${LICENSE}" != "" ]; then \ - if ${TEST} -f ${PKGSRCDIR}/licenses/${LICENSE}; then \ - if [ "${PAGER}" != "" ]; then \ - ${PAGER} ${PKGSRCDIR}/licenses/${LICENSE};\ - else \ - ${CAT} ${PKGSRCDIR}/licenses/${LICENSE};\ - fi \ - else \ - ${ECHO} "Generic ${LICENSE} information not available"; \ - ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ - fi \ + @license=${LICENSE:Q}; \ + license_file=${LICENSE_FILE:Q}; \ + pager=${PAGER:Q}; \ + case "$$pager" in "") pager=${CAT:Q};; esac; \ + case "$$license" in "") exit 0;; esac; \ + if ${TEST} -f "$$license_file"; then \ + $$pager "$$license_file"; \ + else \ + ${ECHO} "Generic $$license information not available"; \ + ${ECHO} "See the package description (pkg_info -d ${PKGNAME}) for more information."; \ fi .endif -- cgit v1.2.3