pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Added a variable LICENSE_FILE that may be set to po...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fed675dbec78
branches:  trunk
changeset: 499844:fed675dbec78
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Sep 28 08:24:52 2005 +0000

description:
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:

 mk/bsd.pkg.mk |  25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diffs (41 lines):

diff -r 8f21eb53f27d -r fed675dbec78 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Wed Sep 28 07:49:22 2005 +0000
+++ b/mk/bsd.pkg.mk     Wed Sep 28 08:24:52 2005 +0000
@@ -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 @@
        @${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
 



Home | Main Index | Thread Index | Old Index