Subject: Re: please comment on NetBSD Problem Report #23100: custom
To: Thomas Klausner <wiz@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 03/22/2004 14:57:01
On Sat, 20 Mar 2004, Thomas Klausner wrote:

> On Fri, Mar 19, 2004 at 11:05:20PM -0800, Jeremy C. Reed wrote:
> > On any *BSD, define OS_NAME as "${OPSYS} ${OS_VERSION}"?

I am beginning to think that is wrong. If we install groff one time and
then later the OS_VERSION will be wrong. I think it should always be just
OPSYS.

> > On Linux, just use "${OPSYS}" and on other systems maybe just use
> > "${OPSYS}" too?
> >
> > For the volume-operating-system definition, just use ${OPSYS}?
>
> Sounds ok.
>
> We might want to mention "pkgsrc". Can you think of a place
> where it might fit?

I don't know for sure.

This is what I have:

===================================================================
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


But now I think that the OPSYS_WITH_VERSION is wrong.

Maybe that is where we could mention "(pkgsrc)" or "using pkgsrc"
or "pkgsrc" instead.

Anyone else have thoughts on this?

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