diff options
author | rillig <rillig@pkgsrc.org> | 2007-10-31 21:09:03 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-10-31 21:09:03 +0000 |
commit | 1d9b92e28de6b6a7280a07794538d0f7a3e50e05 (patch) | |
tree | 3f4ca4b8cf718e92d2bb2239d4732a8ba40ca3a2 /mk/plist | |
parent | fdc2a124c28f42fb6047c5af4baf993c85e89be6 (diff) | |
download | pkgsrc-1d9b92e28de6b6a7280a07794538d0f7a3e50e05.tar.gz |
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 (limited to 'mk/plist')
-rw-r--r-- | mk/plist/plist-functions.awk | 8 | ||||
-rw-r--r-- | mk/plist/plist-macros.awk | 27 | ||||
-rw-r--r-- | mk/plist/plist.mk | 18 |
3 files changed, 44 insertions, 9 deletions
diff --git a/mk/plist/plist-functions.awk b/mk/plist/plist-functions.awk index 9c422b08561..1ea324481a6 100644 --- a/mk/plist/plist-functions.awk +++ b/mk/plist/plist-functions.awk @@ -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 @@ function print_entry(entry) { print entry } } + +function getenv_or_die(varname) { + if (varname in ENVIRON) + return ENVIRON[varname] + print "ERROR: "varname" must be defined." | "cat 1>&2" +} diff --git a/mk/plist/plist-macros.awk b/mk/plist/plist-macros.awk new file mode 100644 index 00000000000..16c428a6971 --- /dev/null +++ b/mk/plist/plist-macros.awk @@ -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 --git a/mk/plist/plist.mk b/mk/plist/plist.mk index 533733145fe..c64e609a85c 100644 --- a/mk/plist/plist.mk +++ b/mk/plist/plist.mk @@ -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_SUBST+= OPSYS=${OPSYS:Q} \ _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} ${_PLIST_NOKEYWORDS} ${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} |