Subject: Linux-Activists - DOC Channel digest. 93-3-9-7:12
From: "Linux Activists" <[email-masked]>
To: "Linux-Activists" <[email-masked]>
Date: Fri, 9 Apr 1993 13:07:56 +0300

Topics:
	 Final (I hope) upload of perl based man system

----------------------------------------------------------------------

From: "James H. Cloos Jr." <[email-masked]>
Subject: Final (I hope) upload of perl based man system
Date: Fri, 9 Apr 1993 09:41:37 +0300

The file man-pl-3.tgz (a gziped tarchive) has now been uploaded to the
incoming directories on tsx-11, sunsite, and nic.

This file supersedes the uploads man-pl.tgz and the patch for that file.

Below is the patch from the original files (man-pl.tgz) to the current
version (man-pl-3.tgz).  Apply the diff in /usr/src, and then do the
following:

	cd usr/src/man-pl
	ln -f man catman makewhatis /usr/bin
	ln -f makewhatis /usr/lib

-JimC

=========man-pl to man-pl-3 diff file======================
diff -c man-pl.OLD/CHANGES man-pl/CHANGES
*** man-pl.OLD/CHANGES	Tue Mar 23 00:05:54 1993
--- man-pl/CHANGES	Thu Mar  4 02:51:30 1993
***************
*** 9,11 ****
--- 9,30 ----
  
      *   bug fixes
  
+     *   Following by James H. Cloos, Jr. <[email-masked]>
+     *   distributed for use with Linux.
+     *   With thanks to Todd C. Miller <[email-masked]>
+     *   for help with the support for BSD 4.4's .doc roff format.
+ 
+     *   Use gzip for compression--both src and cat pages can be compressed
+ 
+     *   Look in /usr/bin for perl(1), as per SLS
+ 
+     *   Use groff as the default formatter
+ 
+     *   Use latin1 character set for nroffing
+ 
+     *   Use -mandoc as the default format
+ 
+     *   Add $MACRO variable for easy editing of above--see man(1)
+ 
+     *   Allow makewhatis(8) to parse .doc format nroff src
+ 
diff -c man-pl.OLD/VERSION-LINUX man-pl/VERSION-LINUX
*** man-pl.OLD/VERSION-LINUX	Fri Apr  9 02:38:48 1993
--- man-pl/VERSION-LINUX	Thu Apr  8 05:34:25 1993
***************
*** 0 ****
--- 1 ----
+ This is version 3 of the Linux port of the perl based man suit.
diff -c man-pl.OLD/makewhatis man-pl/makewhatis
*** man-pl.OLD/makewhatis	Tue Mar 23 00:05:55 1993
--- man-pl/makewhatis	Thu Apr  8 05:04:24 1993
***************
*** 285,295 ****
  	return;
      } else {
  	/^\.TH\s+(\S*)\s+(\S+)/ && &doTH($1, $2);
      } 
  
  LINE: while (<FILE>) {
  	/^\.TH\s+(\S*)\s+(\S+)/ && &doTH($1, $2);
! 	next LINE unless /^\.SH\s+"?NAME"?/i || /^\.NA\s?/;
  	$foundname = 1;
  	@lines = ();
  	$nameline = '';
--- 285,297 ----
  	return;
      } else {
  	/^\.TH\s+(\S*)\s+(\S+)/ && &doTH($1, $2);
+ 	/^\.Dt\s+(\S*)\s+(\S+)/ && &doDt($1, $2);
      } 
  
  LINE: while (<FILE>) {
  	/^\.TH\s+(\S*)\s+(\S+)/ && &doTH($1, $2);
! 	/^\.Dt\s+(\S*)\s+(\S+)/ && &doDt($1, $2);
! 	next LINE unless /^\.S[Hh]\s+"?NAME"?/i || /^\.NA\s?/;
  	$foundname = 1;
  	@lines = ();
  	$nameline = '';
***************
*** 300,305 ****
--- 302,310 ----
  		$nameline = '';
  		next NAME;
  	    } 
+ 		else {
+ 		s/^\.Nm\s+// || s/^\.Nd\s+/- /;
+ 	    }
  	    s/^\.[IB]\b//;	# Kill Bold and Italics
  	    next if /^\./;
  	    $nameline .= ' ' if $nameline;
***************
*** 447,451 ****
--- 452,469 ----
  
      if ($int_name ne $ext_name && $debug) {
  	print STDERR "${FILE}'s .TH thinks it's in $int_name\n";
+     } 
+ } 
+  
+ # same as doTH but for 4.4 bsd style man pages (-mdoc)
+ sub doDt {
+     local($Dtname, $Dtext) = @_;
+     local($int_name, $ext_name);
+ 
+     ($int_name = "$Dtname.$Dtext") =~ tr/A-Z/a-z/;
+     ($ext_name = "$filenam.$filext") =~ tr/A-Z/a-z/;
+ 
+     if ($int_name ne $ext_name && $debug) {
+ 	print STDERR "${FILE}'s .Dt thinks it's in $int_name\n";
      } 
  } 
diff -c man-pl.OLD/man man-pl/man
*** man-pl.OLD/man	Tue Mar 23 00:05:56 1993
--- man-pl/man	Thu Apr  8 05:06:43 1993
***************
*** 37,42 ****
--- 37,45 ----
  # ${MANALT}/${machine}/man(.+)/*.\11*
  $MANALT = $ENV{'MANALT'} || '/usr/local/man';
  
+ # macro package to use for formatting man pages
+ $MACRO    = '-mandoc';
+ 
  # default program for -t command 
  $TROFF    = $ENV{'TROFF'} || 'groff';
  
***************
*** 69,80 ****
  $GZIP_PAGE = 1;
  
  # Command to format man pages to be viewed on a tty or printed on a line printer
! $CATSET	  = "$NROFF -mandoc -Tlatin1 -";
  
  $CATSET  .= " | $COL" if $COL;
  
  # Command to typeset a man page
! $TYPESET  = "$TROFF -mandoc -Tdvi";

  # flags: GNU likes -i, BSD doesn't; both like -h, but BSD doesn't document it
--- 72,83 ----
  $GZIP_PAGE = 1;
  
  # Command to format man pages to be viewed on a tty or printed on a line printer
! $CATSET	  = "$NROFF $MACRO -Tlatin1 -";
  
  $CATSET  .= " | $COL" if $COL;
  
  # Command to typeset a man page
! $TYPESET  = "$TROFF $MACRO -Tdvi";

  # flags: GNU likes -i, BSD doesn't; both like -h, but BSD doesn't document it
***************
*** 862,868 ****
  			: $CAT) 
  		. " < $file | $TYPESET");
  
!     $command =~ s,-man,$manroot/tmac.an, if -e "$manroot/tmac.an";
  
      &insert_filters($command,$file);
      &run($command);
--- 865,871 ----
  			: $CAT) 
  		. " < $file | $TYPESET");
  
!     $command =~ s,$MACRO,$manroot/tmac.an, if -e "$manroot/tmac.an";
  
      &insert_filters($command,$file);
      &run($command);
***************
*** 936,942 ****
  			. " < $manpage | $CATSET";
  
  	    $command = &insert_filters($command, $manpage);
! 	    $command =~ s,-man,$manroot/tmac.an, if -e "$manroot/tmac.an";
  
  	    ($catdir = $catpage) =~ s!^(.*/?cat[^/]+)/[^/]*!$1!;
  
--- 939,945 ----
  			. " < $manpage | $CATSET";
  
  	    $command = &insert_filters($command, $manpage);
! 	    $command =~ s,$MACRO,$manroot/tmac.an, if -e "$manroot/tmac.an";
  
  	    ($catdir = $catpage) =~ s!^(.*/?cat[^/]+)/[^/]*!$1!;
  
-----------End of diff file--------------------

-- 
James H. Cloos, Jr.	include <std/qotd>
[email-masked]	include <std/disclaimers.h>
[email-masked] 	Snail:  POBox 1111, Amherst, NY 14226-1111
[email-masked] 	Phone:  +1 716 673-1250 (voice only, for now)

------------------------------

End of DOC Digest
*****************
-------