pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/plist Some implementations of X11 install both manp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e3af3853fa98
branches:  trunk
changeset: 534790:e3af3853fa98
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Oct 31 21:09:03 2007 +0000

description:
Some implementations of X11 install both manpages and catpages, which
has not been supported by pkgsrc up to now.

This changes adds a PLIST macro @imake-man that expands to zero, one or
two lines, depending on the value of IMAKE_MANINSTALL. Packages must
explicitly have the macro in the PLIST files to use this feature. Since
currently no package has that, this change doesn't affect anything at
all by now.

TODO: The platforms' definitions for IMAKE_MANINSTALL and the other
definitions like IMAKE_MAN_SUFFIX need to be adjusted.

diffstat:

 mk/plist/plist-functions.awk |   8 +++++++-
 mk/plist/plist-macros.awk    |  27 +++++++++++++++++++++++++++
 mk/plist/plist.mk            |  18 ++++++++++--------
 3 files changed, 44 insertions(+), 9 deletions(-)

diffs (90 lines):

diff -r 5db23df0c9a5 -r e3af3853fa98 mk/plist/plist-functions.awk
--- a/mk/plist/plist-functions.awk      Wed Oct 31 20:59:06 2007 +0000
+++ b/mk/plist/plist-functions.awk      Wed Oct 31 21:09:03 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: plist-functions.awk,v 1.1 2006/01/12 23:43:57 jlam Exp $
+# $NetBSD: plist-functions.awk,v 1.2 2007/10/31 21:09:03 rillig Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -57,3 +57,9 @@
                print entry
        }
 }
+
+function getenv_or_die(varname) {
+       if (varname in ENVIRON)
+               return ENVIRON[varname]
+       print "ERROR: "varname" must be defined." | "cat 1>&2"
+}
diff -r 5db23df0c9a5 -r e3af3853fa98 mk/plist/plist-macros.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/plist/plist-macros.awk Wed Oct 31 21:09:03 2007 +0000
@@ -0,0 +1,27 @@
+# $NetBSD: plist-macros.awk,v 1.1 2007/10/31 21:09:03 rillig Exp $
+
+BEGIN {
+       IMAKE_MANINSTALL = getenv_or_die("IMAKE_MANINSTALL")
+}
+
+# @imake-man dir basename extension
+#
+# Creates up to two PLIST entries for man pages of imake-style programs.
+#
+/^@imake-man/ {
+       if (IMAKE_MANINSTALL ~ /catinstall/) {
+               n = split($2, components, "/")
+               sub("man", "cat", components[n])
+               print join(components, 1, n, "/") "/" $3 ".0"
+       }
+       if (IMAKE_MANINSTALL ~ /maninstall/) {
+               n = split($2, components, "/")
+               sub("cat", "man", components[n])
+               print join(components, 1, n, "/") "/" $3 "." $4
+       }
+       next;
+}
+
+1 {
+       print;
+}
diff -r 5db23df0c9a5 -r e3af3853fa98 mk/plist/plist.mk
--- a/mk/plist/plist.mk Wed Oct 31 20:59:06 2007 +0000
+++ b/mk/plist/plist.mk Wed Oct 31 21:09:03 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.35 2007/10/25 22:02:18 jlam Exp $
+# $NetBSD: plist.mk,v 1.36 2007/10/31 21:09:03 rillig Exp $
 #
 # This Makefile fragment handles the creation of PLISTs for use by
 # pkg_create(8).
@@ -159,8 +159,11 @@
 _PLIST_AWK_ENV+=       ${PLIST_SUBST:S/^/PLIST_/}
 _PLIST_AWK_ENV+=       PLIST_SUBST_VARS=${PLIST_SUBST:S/^/PLIST_/:C/=.*//:M*:Q}
 
+_PLIST_1_AWK+=         -f ${PKGSRCDIR}/mk/plist/plist-functions.awk
+_PLIST_1_AWK+=         -f ${PKGSRCDIR}/mk/plist/plist-subst.awk
+_PLIST_1_AWK+=         -f ${PKGSRCDIR}/mk/plist/plist-macros.awk
+
 _PLIST_AWK+=           -f ${.CURDIR}/../../mk/plist/plist-functions.awk
-_PLIST_AWK+=           -f ${.CURDIR}/../../mk/plist/plist-subst.awk
 _PLIST_AWK+=           -f ${.CURDIR}/../../mk/plist/plist-locale.awk
 _PLIST_AWK+=           -f ${.CURDIR}/../../mk/plist/plist-info.awk
 _PLIST_AWK+=           -f ${.CURDIR}/../../mk/plist/plist-man.awk
@@ -240,12 +243,11 @@
 ${PLIST}: ${PLIST_SRC}
 .endif
 ${PLIST}:
-       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       { ${_GENERATE_PLIST} } |                                        \
-       ${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_AWK} |              \
-       ${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK}          \
-               > ${.TARGET}
+       ${RUN} ${MKDIR} ${.TARGET:H}
+       ${RUN} { ${_GENERATE_PLIST} } > ${.TARGET}-1src
+       ${RUN} ${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_1_AWK} < ${.TARGET}-1src > ${.TARGET}-2mac
+       ${RUN} ${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_AWK} < ${.TARGET}-2mac > ${.TARGET}-3mag
+       ${RUN} ${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK} < ${.TARGET}-3mag > ${.TARGET}
 
 # for list of keywords see pkg_create(1)
 ${_PLIST_NOKEYWORDS}: ${PLIST}



Home | Main Index | Thread Index | Old Index