summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2013-09-12 11:01:47 +0000
committerjperkin <jperkin@pkgsrc.org>2013-09-12 11:01:47 +0000
commit5df51943c8b1a53a3532936a55f55345588bf41c (patch)
tree519783eea9ea6e85df58092590bc3f32167d64ca /mk
parent9c29badf43811d898256b8c0dda4ec422c28a950 (diff)
downloadpkgsrc-5df51943c8b1a53a3532936a55f55345588bf41c.tar.gz
Introduce CATMAN_SECTION_SUFFIX which if set to 'yes' will ensure that
catman pages are installed with a suffix which matches their section instead of the default '.0'. Enable it by default on SunOS, which requires that particular layout.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.prefs.mk4
-rw-r--r--mk/platform/SunOS.mk3
-rw-r--r--mk/plist/plist-man.awk22
-rw-r--r--mk/plist/plist.mk3
4 files changed, 27 insertions, 5 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk
index 8885d7d964e..018f0f72889 100644
--- a/mk/bsd.prefs.mk
+++ b/mk/bsd.prefs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.337 2013/07/19 14:29:16 ryoon Exp $
+# $NetBSD: bsd.prefs.mk,v 1.338 2013/09/12 11:01:47 jperkin Exp $
#
# This file includes the mk.conf file, which contains the user settings.
#
@@ -606,6 +606,8 @@ X11_ENCODINGSDIR?= ${X11BASE}/share/fonts/X11/encodings
X11_ENCODINGSDIR?= ${X11BASE}/lib/X11/fonts/encodings
.endif
+CATMAN_SECTION_SUFFIX?= no
+
IMAKE_MAN_SOURCE_PATH= man/man
IMAKE_MAN_SUFFIX= 1
IMAKE_LIBMAN_SUFFIX= 3
diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk
index ee7e403e8de..7f2f67eda83 100644
--- a/mk/platform/SunOS.mk
+++ b/mk/platform/SunOS.mk
@@ -1,4 +1,4 @@
-# $NetBSD: SunOS.mk,v 1.56 2013/09/04 15:14:45 jperkin Exp $
+# $NetBSD: SunOS.mk,v 1.57 2013/09/12 11:01:47 jperkin Exp $
#
# Variable definitions for the SunOS/Solaris operating system.
@@ -11,6 +11,7 @@ PS?= /bin/ps
SU?= /usr/bin/su
TYPE?= /usr/bin/type
+CATMAN_SECTION_SUFFIX?= yes
CPP_PRECOMP_FLAGS?= # unset
DEF_UMASK?= 022
DEFAULT_SERIAL_DEVICE?= /dev/null
diff --git a/mk/plist/plist-man.awk b/mk/plist/plist-man.awk
index b30fc97f796..46d338cd7b7 100644
--- a/mk/plist/plist-man.awk
+++ b/mk/plist/plist-man.awk
@@ -1,4 +1,4 @@
-# $NetBSD: plist-man.awk,v 1.8 2010/02/20 07:05:52 rillig Exp $
+# $NetBSD: plist-man.awk,v 1.9 2013/09/12 11:01:47 jperkin Exp $
#
# Copyright (c) 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -41,6 +41,9 @@
###
### Certain environment variables must be set prior to running this script:
###
+### CATMAN_SECTION_SUFFIX is a yes/no variable that determines whether to use
+### the catman page section as the suffix or .0 if not.
+###
### IMAKE_MANINSTALL specifies how imake-using packages install man pages.
### Valid values are:
###
@@ -72,6 +75,7 @@ BEGIN {
MANINSTALL = getenv("MANINSTALL", "maninstall catinstall")
MANZ = getenv("MANZ", "no")
PKGMANDIR = getenv("PKGMANDIR", "man")
+ CATMAN_SECTION_SUFFIX = getenv("CATMAN_SECTION_SUFFIX", "no")
}
###
@@ -103,7 +107,11 @@ BEGIN {
/^([^\/]*\/)+man[1-9ln]\/[^\/]*\.[0-9ln]$/ {
n = split($0, components, "/")
sub("man", "cat", components[n-1])
- section = "0"
+ if (CATMAN_SECTION_SUFFIX ~ /[yY][eE][sS]/) {
+ section = substr(components[n-1], 4, 1)
+ } else {
+ section = "0"
+ }
sub("[0-9ln]$", section, components[n])
$0 = join(components, 1, n, "/")
}
@@ -138,3 +146,13 @@ BEGIN {
/^man\/([^\/]*\/)?(man[1-9ln]\/[^\/]*\.[1-9ln]|cat[1-9ln]\/[^\/]*\.[0-9])/ {
sub("^man/", PKGMANDIR "/")
}
+
+###
+### Fixup catman entries to use section suffixes if required.
+###
+(CATMAN_SECTION_SUFFIX ~ /[yY][eE][sS]/)&& /^[^@]/ && \
+/^man\/([^\/]*\/)?(cat[1-9ln]\/[^\/]*\.[0-9])/ {
+ n = split($0, components, "/")
+ sub("^cat", "", components[n-1])
+ sub("0$", components[n-1], $0)
+}
diff --git a/mk/plist/plist.mk b/mk/plist/plist.mk
index 632d3163a4c..f8a7a5f383c 100644
--- a/mk/plist/plist.mk
+++ b/mk/plist/plist.mk
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.45 2013/02/10 12:03:00 obache Exp $
+# $NetBSD: plist.mk,v 1.46 2013/09/12 11:01:47 jperkin Exp $
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
@@ -130,6 +130,7 @@ MAKEVARS+= _IGNORE_INFO_PATH
#
_PLIST_AWK_ENV+= PKGLOCALEDIR=${PKGLOCALEDIR:Q}
_PLIST_AWK_ENV+= USE_PKGLOCALEDIR=${USE_PKGLOCALEDIR:Dyes:Uno}
+_PLIST_AWK_ENV+= CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q}
_PLIST_AWK_ENV+= IMAKE_MANINSTALL=${_IMAKE_MANINSTALL:Q}
_PLIST_AWK_ENV+= IGNORE_INFO_PATH=${_IGNORE_INFO_PATH:Q}
_PLIST_AWK_ENV+= PKGINFODIR=${PKGINFODIR:Q}