summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-09-28 08:24:52 +0000
committerrillig <rillig@pkgsrc.org>2005-09-28 08:24:52 +0000
commit5ebf566f7d4bd021979b965d3d2d0de8e4561abd (patch)
tree54be1ac8599dc9ff06c9a1e68b596b800034b5ff /mk
parentaae344c3a44a2c6f47c99db9633aa600fd6ff432 (diff)
downloadpkgsrc-5ebf566f7d4bd021979b965d3d2d0de8e4561abd.tar.gz
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.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk25
1 files 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