Hi,

some time ago, Pascal Stumpf reported that manuals are broken in the
textproc/groff port.  The worst case probably is this:

 $ man 7 groff
 groff.7:3955:4: FATAL: line scope broken, syntax violated

But the other manuals don't look very good, either;
no wonder that groff uses lots of its own low-level macros
in its own manuals, which mandoc(1) doesn't like at all.

Thus, i suggest to format the manuals at build time, using the
freshly-built groff itself - of course, USE_GROFF is not the way
to go in this special case.

The only exception is the groff_mdoc(7) manual - that one actually
looks better with mandoc(1).

With this patch, groff still builds, installs, and uninstalls
cleanly, the manuals look reasonable, and the diff of the
build logs also looks sane.

OK?
  Ingo


Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/groff/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    7 Jul 2011 05:27:15 -0000       1.13
+++ Makefile    11 Oct 2011 01:10:46 -0000
@@ -2,7 +2,7 @@
 
 COMMENT =              GNU troff typesetter
 DISTNAME =             groff-1.21
-REVISION =             4
+REVISION =             5
 
 CATEGORIES =           textproc
 HOMEPAGE =             http://www.gnu.org/software/groff/
Index: patches/patch-Makefile_comm
===================================================================
RCS file: patches/patch-Makefile_comm
diff -N patches/patch-Makefile_comm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile_comm 11 Oct 2011 01:10:46 -0000
@@ -0,0 +1,60 @@
+$OpenBSD$
+# Install preformatted manuals
+# since mandoc(1) does not format the groff manuals well.
+# But install groff_mdoc(7) as source
+# because mandoc(1) handles that one better than groff.
+--- Makefile.comm.orig Fri Dec 31 08:33:08 2010
++++ Makefile.comm      Tue Oct 11 02:57:44 2011
+@@ -176,27 +176,44 @@ install_man:
+       -test -d $(DESTDIR)$(man1dir) || $(mkinstalldirs) $(DESTDIR)$(man1dir)
+       @-pages="$(MAN1)"; \
+       for p in $$pages; do \
+-       prog=`basename $$p .n`; \
+-       target=$(DESTDIR)$(man1dir)/$(NAMEPREFIX)$$prog.$(man1ext); \
++       p0="$${p%.n}.0"; \
++       echo "groff -mandoc -Tascii -P -c $$p > $$p0"; \
++       $(top_srcdir)/test-groff -mandoc -Tascii -P -c $$p > $$p0; \
++       target=$(DESTDIR)$(man1dir)/$(NAMEPREFIX)$$p0; \
+        rm -f $$target; \
+-       echo $(INSTALL_DATA) $$p $$target; \
+-       $(INSTALL_DATA) $$p $$target; \
++       echo $(INSTALL_DATA) $$p0 $$target; \
++       $(INSTALL_DATA) $$p0 $$target; \
+       done
+       -test -d $(DESTDIR)$(man5dir) || $(mkinstalldirs) $(DESTDIR)$(man5dir)
+       @-pages="$(MAN5)"; \
+       for p in $$pages; do \
+-       target=$(DESTDIR)$(man5dir)/`basename $$p .n`.$(man5ext); \
++       p0="$${p%.n}.0"; \
++       echo "groff -mandoc -Tascii -P -c $$p > $$p0"; \
++       $(top_srcdir)/test-groff -mandoc -Tascii -P -c $$p > $$p0; \
++       target=$(DESTDIR)$(man5dir)/$$p0; \
+        rm -f $$target; \
+-       echo $(INSTALL_DATA) $$p $$target; \
+-       $(INSTALL_DATA) $$p $$target; \
++       echo $(INSTALL_DATA) $$p0 $$target; \
++       $(INSTALL_DATA) $$p0 $$target; \
+       done
+       -test -d $(DESTDIR)$(man7dir) || $(mkinstalldirs) $(DESTDIR)$(man7dir)
+       @-pages="$(MAN7)"; \
+       for p in $$pages; do \
+-       target=$(DESTDIR)$(man7dir)/`basename $$p .n`.$(man7ext); \
++      if [ "X$$p" = "Xgroff_mdoc.n" ]; then \
++       mdocdir=$(DESTDIR)$(manroot)/man$(man7ext); \
++       test -d $$mdocdir || $(mkinstalldirs) $$mdocdir; \
++       target=$$mdocdir/groff_mdoc.7; \
+        rm -f $$target; \
+        echo $(INSTALL_DATA) $$p $$target; \
+        $(INSTALL_DATA) $$p $$target; \
++      else \
++       p0="$${p%.n}.0"; \
++       echo "groff -mandoc -Tascii -P -c $$p > $$p0"; \
++       $(top_srcdir)/test-groff -mandoc -Tascii -P -c $$p > $$p0; \
++       target=$(DESTDIR)$(man7dir)/$$p0; \
++       rm -f $$target; \
++       echo $(INSTALL_DATA) $$p0 $$target; \
++       $(INSTALL_DATA) $$p0 $$target; \
++      fi; \
+       done
+ 
+ .PHONY: uninstall_man
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/textproc/groff/patches/patch-Makefile_in,v
retrieving revision 1.1
diff -u -p -r1.1 patch-Makefile_in
--- patches/patch-Makefile_in   19 Mar 2011 16:48:53 -0000      1.1
+++ patches/patch-Makefile_in   11 Oct 2011 01:10:46 -0000
@@ -1,11 +1,31 @@
 $OpenBSD: patch-Makefile_in,v 1.1 2011/03/19 16:48:53 schwarze Exp $
-# Do not depend on MAKEOVERRIDES, a GNU make extension that prevents the
-# recursive passing of command line assignments to sub-makes.
+# Chunk 1: Install preformatted manuals, not source pages.
+# Chunk 2: Do not depend on MAKEOVERRIDES, a GNU make extension that
+# prevents the recursive passing of command line assignments to sub-makes.
 # Specifically, we must not pass overrides like top_srcdir=...
 # to the sub-makes called in src/libs/gnulib where those variables
 # have different values created by the sub-configure there.
---- Makefile.in.orig   Tue Mar 15 14:42:23 2011
-+++ Makefile.in        Tue Mar 15 14:43:16 2011
+--- Makefile.in.orig   Fri Dec 31 08:33:08 2010
++++ Makefile.in        Tue Oct 11 01:25:20 2011
+@@ -247,15 +247,15 @@ manroot=$(mandir)
+ 
+ # `man1ext' is the man section for user commands.
+ man1ext=1
+-man1dir=$(manroot)/man$(man1ext)
++man1dir=$(manroot)/cat$(man1ext)
+ 
+ # `man5ext' is the man section for file formats.
+ man5ext=5
+-man5dir=$(manroot)/man$(man5ext)
++man5dir=$(manroot)/cat$(man5ext)
+ 
+ # `man7ext' is the man section for macros.
+ man7ext=7
+-man7dir=$(manroot)/man$(man7ext)
++man7dir=$(manroot)/cat$(man7ext)
+ 
+ # The configure script checks whether all necessary utility programs for
+ # grohtml are available -- only then we can build the HTML documentation.
 @@ -686,7 +686,7 @@ subdir=src/roff/troff
  
  
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/groff/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- pkg/PLIST   20 Mar 2011 17:30:24 -0000      1.3
+++ pkg/PLIST   11 Oct 2011 01:10:46 -0000
@@ -52,65 +52,65 @@ lib/groff/groffer/perl_test.pl
 lib/groff/groffer/split_env.sh
 lib/groff/groffer/version.sh
 lib/groff/site-tmac/
-@man man/man1/addftinfo.1
-@man man/man1/afmtodit.1
-@man man/man1/chem.1
-@man man/man1/eqn.1
-@man man/man1/eqn2graph.1
-@man man/man1/gdiffmk.1
-@man man/man1/grap2graph.1
-@man man/man1/grn.1
-@man man/man1/grodvi.1
-@man man/man1/groff.1
-@man man/man1/groffer.1
-@man man/man1/grog.1
-@man man/man1/grohtml.1
-@man man/man1/grolbp.1
-@man man/man1/grolj4.1
-@man man/man1/grops.1
-@man man/man1/grotty.1
-@man man/man1/hpftodit.1
-@man man/man1/indxbib.1
-@man man/man1/lkbib.1
-@man man/man1/lookbib.1
-@man man/man1/mmroff.1
-@man man/man1/neqn.1
-@man man/man1/nroff.1
-@man man/man1/pdfroff.1
-@man man/man1/pfbtops.1
-@man man/man1/pic.1
-@man man/man1/pic2graph.1
-@man man/man1/preconv.1
-@man man/man1/refer.1
-@man man/man1/roff2dvi.1
-@man man/man1/roff2html.1
-@man man/man1/roff2pdf.1
-@man man/man1/roff2ps.1
-@man man/man1/roff2text.1
-@man man/man1/roff2x.1
-@man man/man1/soelim.1
-@man man/man1/tbl.1
-@man man/man1/tfmtodit.1
-@man man/man1/troff.1
-@man man/man5/groff_font.5
-@man man/man5/groff_out.5
-@man man/man5/groff_tmac.5
-@man man/man5/lj4_font.5
-@man man/man7/ditroff.7
-@man man/man7/groff.7
-@man man/man7/groff_char.7
-@man man/man7/groff_diff.7
-@man man/man7/groff_hdtbl.7
-@man man/man7/groff_man.7
+@man man/cat1/addftinfo.0
+@man man/cat1/afmtodit.0
+@man man/cat1/chem.0
+@man man/cat1/eqn.0
+@man man/cat1/eqn2graph.0
+@man man/cat1/gdiffmk.0
+@man man/cat1/grap2graph.0
+@man man/cat1/grn.0
+@man man/cat1/grodvi.0
+@man man/cat1/groff.0
+@man man/cat1/groffer.0
+@man man/cat1/grog.0
+@man man/cat1/grohtml.0
+@man man/cat1/grolbp.0
+@man man/cat1/grolj4.0
+@man man/cat1/grops.0
+@man man/cat1/grotty.0
+@man man/cat1/hpftodit.0
+@man man/cat1/indxbib.0
+@man man/cat1/lkbib.0
+@man man/cat1/lookbib.0
+@man man/cat1/mmroff.0
+@man man/cat1/neqn.0
+@man man/cat1/nroff.0
+@man man/cat1/pdfroff.0
+@man man/cat1/pfbtops.0
+@man man/cat1/pic.0
+@man man/cat1/pic2graph.0
+@man man/cat1/preconv.0
+@man man/cat1/refer.0
+@man man/cat1/roff2dvi.0
+@man man/cat1/roff2html.0
+@man man/cat1/roff2pdf.0
+@man man/cat1/roff2ps.0
+@man man/cat1/roff2text.0
+@man man/cat1/roff2x.0
+@man man/cat1/soelim.0
+@man man/cat1/tbl.0
+@man man/cat1/tfmtodit.0
+@man man/cat1/troff.0
+@man man/cat5/groff_font.0
+@man man/cat5/groff_out.0
+@man man/cat5/groff_tmac.0
+@man man/cat5/lj4_font.0
+@man man/cat7/ditroff.0
+@man man/cat7/groff.0
+@man man/cat7/groff_char.0
+@man man/cat7/groff_diff.0
+@man man/cat7/groff_hdtbl.0
+@man man/cat7/groff_man.0
+@man man/cat7/groff_me.0
+@man man/cat7/groff_mm.0
+@man man/cat7/groff_mmse.0
+@man man/cat7/groff_mom.0
+@man man/cat7/groff_ms.0
+@man man/cat7/groff_trace.0
+@man man/cat7/groff_www.0
+@man man/cat7/roff.0
 @man man/man7/groff_mdoc.7
-@man man/man7/groff_me.7
-@man man/man7/groff_mm.7
-@man man/man7/groff_mmse.7
-@man man/man7/groff_mom.7
-@man man/man7/groff_ms.7
-@man man/man7/groff_trace.7
-@man man/man7/groff_www.7
-@man man/man7/roff.7
 share/doc/groff/
 share/doc/groff/html/
 share/doc/groff/html/mom/

Reply via email to