NetBSD Problem Report #23100

Received: (qmail 12296 invoked by uid 605); 8 Oct 2003 18:40:14 -0000
Message-Id: <27381-1065638407@rainier.reedmedia.net>
Date: Wed, 08 Oct 2003 11:40:08 -0700
From: reed@reedmedia.net
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: reed@reedmedia.net
To: gnats-bugs@gnats.netbsd.org
Subject: custom groff/files/mdoc.local
X-Send-Pr-Version: 3.95

>Number:         23100
>Category:       pkg
>Synopsis:       custom groff/files/mdoc.local
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 08 18:41:00 +0000 2003
>Closed-Date:    Fri Apr 30 15:14:20 +0000 2004
>Last-Modified:  Fri Apr 30 15:14:20 +0000 2004
>Originator:     
>Release:        NetBSD 1.6.1_STABLE
>Organization:
http://bsd.reedmedia.net/
>Environment:
>Description:
The groff package installs a custom
${PREFIX}/share/groff/site-tmac/mdoc.local file.

It has:

.ds volume-operating-system NetBSD

and

.ds operating-system NetBSD\~1.6


If these are not set then it will default to "BSD".

>How-To-Repeat:
Install groff on Linux and wonder why man says "NetBSD".
>Fix:
I'd like to suggest that this be customized per the local operating system
that the package was built under.

For example, it doesn't make sense for a manpage unrelated to NetBSD to
say "NetBSD" in the header or footer on a system that is not NetBSD.

I'd like to suggest that the textproc/groff/files/mdoc.local file is
configured via a sed expression.

Have some OS_NAME that can be defined in mk.conf for the
operating-system definition.

If not set, then:

On any *BSD, define OS_NAME as "${OPSYS} ${OS_VERSION}".

On Linux, just use "${OPSYS}".

On other Unix maybe just use "${OPSYS}" too.

For the volume-operating-system definition, just use ${OPSYS}.

(Searching google, I see that a few people have complained about the
groff default of "BSD" on non-BSD systems.)

Any comments?

I can quickly provide a patch for this ...

(I send-pr'd this because I asked tech-pkg a month ago and didn't get
feedback. I consider it a problem. I don't provide a fix because
I want feedback first.)
>Release-Note:
>Audit-Trail:

From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pkg/23100
Date: Mon, 22 Mar 2004 18:09:47 -0800 (PST)

 I will probably commit the following:

 Index: textproc/groff/Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/textproc/groff/Makefile,v
 retrieving revision 1.15
 diff -b -u -r1.15 Makefile
 --- textproc/groff/Makefile	9 Aug 2003 11:27:47 -0000	1.15
 +++ textproc/groff/Makefile	22 Mar 2004 22:51:35 -0000
 @@ -20,15 +20,30 @@

  INFO_FILES=	groff

 -post-install:
 -	${INSTALL_DATA} ${FILESDIR}/mdoc.local \
 -		${PREFIX}/share/groff/site-tmac
 -
  .include "../../mk/bsd.prefs.mk"

  .ifdef PAPERSIZE
  CONFIGURE_ENV+=	PAGE=${PAPERSIZE}
  .endif

 +# This is for mdoc.local "operating-system" definition.
 +# Don't use version with "Linux" because kernel version is different
 +# from operating system version.
 +# XXX todo: customize this for other operating systems
 +.if !empty(OPSYS:M*BSD*)
 +OPSYS_WITH_VERSION=	${OPSYS}\~${OS_VERSION}
 +.else
 +OPSYS_WITH_VERSION=	${OPSYS}
 +.endif
 +
 +post-patch:
 +	${SED}	-e "s,@@OPSYS@@,${OPSYS},g"	\
 +		-e "s,@@OPSYS_WITH_VERSION@@,${OPSYS_WITH_VERSION},g"	\
 +		${FILESDIR}/mdoc.local > ${WRKDIR}/mdoc.local
 +
 +post-install:
 +	${INSTALL_DATA} ${WRKDIR}/mdoc.local \
 +		${PREFIX}/share/groff/site-tmac
 +
  .include "../../mk/ghostscript.mk"
  .include "../../mk/bsd.pkg.mk"
 Index: textproc/groff/files/mdoc.local
 ===================================================================
 RCS file: /cvsroot/pkgsrc/textproc/groff/files/mdoc.local,v
 retrieving revision 1.2
 diff -b -u -r1.2 mdoc.local
 --- textproc/groff/files/mdoc.local	20 Mar 2004 10:59:33 -0000	1.2
 +++ textproc/groff/files/mdoc.local	22 Mar 2004 22:51:35 -0000
 @@ -37,7 +37,7 @@
  .\"     %beginstrip%
  .
  .\" NetBSD
 -.ds volume-operating-system NetBSD
 +.ds volume-operating-system @@OPSYS@@
  .
  .\" NetBSD .Lb values
  .\".ds str-Lb-libarm32     ARM32 Architecture Library (libarm32, \-larm32)
 @@ -138,7 +138,7 @@
  .als str-St--isoC99 str-St--isoC-99
  .
  .\" Default .Os value
 -.ds operating-system NetBSD\~1.6
 +.ds operating-system @@OPSYS_WITH_VERSION@@
  .\" Other known versions, not yet in groff distribution
  .ds operating-system-NetBSD-1.4.2  1.4.2
  .ds operating-system-NetBSD-1.4.3  1.4.3

    Jeremy C. Reed
    http://www.reedmedia.net/


From: "Jeremy C. Reed" <reed@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/23100 CVS commit: pkgsrc
Date: Fri, 30 Apr 2004 15:11:28 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	reed
 Date:		Fri Apr 30 15:11:28 UTC 2004

 Modified Files:
 	pkgsrc/doc: CHANGES
 	pkgsrc/textproc/groff: Makefile
 	pkgsrc/textproc/groff/files: mdoc.local

 Log Message:
 This configures the to-be-installed mdoc.local file so the
 "volume-operating-system" macro is ${OPSYS}.  And sets the default
 .Os value to "pkgsrc" as suggested by wiz@.  (It was hard-coded
 "NetBSD\~1.6".)

 Usually the mdoc.local "volume-operating-system" definition is for
 the operating system name often displayed on top of man pages. And
 "operating-system" is for the default .Os value (operating system
 and version/release) and is usually displayed at bottom of man page.

 Bump PKGREVISION.

 This closes my PR #23100.


 To generate a diff of this commit:
 cvs rdiff -r1.5779 -r1.5780 pkgsrc/doc/CHANGES
 cvs rdiff -r1.16 -r1.17 pkgsrc/textproc/groff/Makefile
 cvs rdiff -r1.2 -r1.3 pkgsrc/textproc/groff/files/mdoc.local

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed 
State-Changed-By: reed 
State-Changed-When: Fri Apr 30 15:13:25 UTC 2004 
State-Changed-Why:  
I fixed the package to not hard-code "NetBSD" in mdoc.local as default values. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.