git: 8b5689d656e7 - main - sysutils/dtrace-toolkit: Fix manual pages installation

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Fri, 08 Jul 2022 19:25:33 UTC
The branch main has been updated by 0mp:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8b5689d656e72527b8c2da002b165959fd52b5b6

commit 8b5689d656e72527b8c2da002b165959fd52b5b6
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2022-07-08 19:19:40 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2022-07-08 19:24:56 +0000

    sysutils/dtrace-toolkit: Fix manual pages installation
    
    - Install a man.conf for the toolkit's manual pages.
    - Explain in pkg-message
    - Some additional cosmetic changes
    
    PR:             262679
    Reported by:    grahamperrin@
---
 sysutils/dtrace-toolkit/Makefile             |  8 ++++++--
 sysutils/dtrace-toolkit/files/pkg-message.in | 23 +++++++++++++++++++++++
 sysutils/dtrace-toolkit/pkg-message          |  8 --------
 sysutils/dtrace-toolkit/pkg-plist            |  1 +
 4 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/sysutils/dtrace-toolkit/Makefile b/sysutils/dtrace-toolkit/Makefile
index 690ec4d67180..c5cb89d22448 100644
--- a/sysutils/dtrace-toolkit/Makefile
+++ b/sysutils/dtrace-toolkit/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	dtrace-toolkit
 PORTVERSION=	1.0
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	sysutils
 
 MAINTAINER=	0mp@FreeBSD.org
@@ -74,8 +74,11 @@ sh_CMD=		${SH}
 perl_OLD_CMD=	\\./perl
 ruby_OLD_CMD=	\\./ruby
 
+NO_ARCH=	yes
 NO_BUILD=	yes
 
+SUB_FILES=	pkg-message
+
 .include <bsd.port.options.mk>
 
 .if ${OPSYS} == FreeBSD
@@ -94,8 +97,9 @@ do-install:
 	${RLN} ${STAGEDIR}${DATADIR}/Apps/shellsnoop ${STAGEDIR}${PREFIX}/bin/shellsnoop
 
 .for MANPAGE in dtruss hotkernel procsystime opensnoop shellsnoop
-	${INSTALL_MAN} ${WRKSRC}/Man/man1m/${MANPAGE}.1m \
+	${RLN} ${STAGEDIR}${DATADIR}/Man/man1m/${MANPAGE}.1m \
 		${STAGEDIR}${MAN1PREFIX}/man/man1/${MANPAGE}.1
 .endfor
+	${ECHO_CMD} 'MANPATH ${DATADIR}/Man' > ${STAGEDIR}${PREFIX}/etc/man.d/${PORTNAME}.conf
 
 .include <bsd.port.mk>
diff --git a/sysutils/dtrace-toolkit/files/pkg-message.in b/sysutils/dtrace-toolkit/files/pkg-message.in
new file mode 100644
index 000000000000..20b2a2fe316a
--- /dev/null
+++ b/sysutils/dtrace-toolkit/files/pkg-message.in
@@ -0,0 +1,23 @@
+[
+{ type: install
+  message: <<EOM
+Many of the DTraceToolkit scripts do not work on FreeBSD at the moment,
+usually because:
+- They are using Solaris-specific features
+- They use probes which are not supported yet on FreeBSD
+
+Some popular scripts are installed at:
+
+    %%PREFIX%%/bin
+
+The rest of the scripts and other toolkit files can be found in:
+
+    %%DATADIR%%
+
+To view the manual pages in the "1m" manual section,
+the section has to be specified explicitly, e.g.:
+
+    man -s 1m fddist
+EOM
+}
+]
diff --git a/sysutils/dtrace-toolkit/pkg-message b/sysutils/dtrace-toolkit/pkg-message
deleted file mode 100644
index eadafc698d54..000000000000
--- a/sysutils/dtrace-toolkit/pkg-message
+++ /dev/null
@@ -1,8 +0,0 @@
-[
-{ type: install
-  message: <<EOM
-Many of the DTraceToolkit scripts will not work as they are either too
-Solaris-specific or use probes which are unsupported at this time on FreeBSD.
-EOM
-}
-]
diff --git a/sysutils/dtrace-toolkit/pkg-plist b/sysutils/dtrace-toolkit/pkg-plist
index 1728d60a0165..ecbb9490d066 100644
--- a/sysutils/dtrace-toolkit/pkg-plist
+++ b/sysutils/dtrace-toolkit/pkg-plist
@@ -1024,3 +1024,4 @@ man/man1/shellsnoop.1.gz
 %%DATADIR%%/statsnoop
 %%DATADIR%%/CDDL
 %%DATADIR%%/README.md
+etc/man.d/dtrace-toolkit.conf