[comp.os.coherent] MINST - a short shell script for manpage installing

joachim@jrix.radig.de (Joachim Riedel) (06/15/91)

Hi, 

I post the following file for a friend who has no access to comp.os.coherent.
Description: Installing manpages made easy  (for such silly guys like me)

a) this file is 8 K, News are sent compressed, that is 4 k, not that much
b) Several articles against source posting are about 6 k and of no use
c) So don't waste space with such articles so that there is more room for src's

Joachim

ALSO: ...uunet!convex!connie!jr
+---------------------------------------+-------+-------------------+-------+
|    Joachim Riedel                     | @   @ |    Don't worry,   | @   @ |
|    Geschwister-Scholl-Strasse 48      |  \_/  |    keep smiling   |  \_/  |
|    D-6050 Offenbach am Main           +-------+-------------------+-------+
|    Tel. +49 69 85 62 25               |       joachim@jrix.radig.de       |  
+---------------------------------------+-----------------------------------+

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  Makefile README.US minst minst.man
# Wrapped by root@jrix on Sat Jun 15 10:33:26 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(986 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X#
X# Copyright (c) 1991 by Dipl.-Ing. Thomas Weidenfeller
X#
XMINST=minst
XFILES=$(MINST) $(MINST).man Makefile README
XBIN=/usr/bin
XTARFILE=minst.tar
XZFILE=$(TARFILE).Z
XUUEFILE=$(ZFILE).uue
X
X# Was so alles geht...
Xall:
X	@echo "type:"
X	@echo "    'make install'     to install the program"
X	@echo "    'make install.man' to install the man page"
X	@echo "    'make tar'         to create a tar file"
X	@echo "    'make tar.Z'       to create a compressed tar file"
X	@echo "    'make uue'         to uuencode a compressed tar file"
X
X# Installation des Programms
Xinstall:
X	cp $(MINST) $(BIN)
X
X# Installation der Man-Page (mit sich selbst!)
Xinstall.man:
X	$(MINST) $(MINST).man
X
X# Alles in eine tar-Datei packen
Xtar $(TARFILE): $(FILES)
X	tar cvf $(TARFILE) $(FILES)
X
X# Tar-Datei auch noch komprimieren
Xtar.Z $(ZFILE): $(TARFILE)
X	rm -f $(ZFILE)
X	compress $(TARFILE)     
X
X# Komprimierte tar-Datei zur Uebertragung 'uuencode'n
Xuue $(UUEFILE): $(ZFILE)
X	uuencode $(ZFILE)  < $(ZFILE) > $(UUEFILE)  
END_OF_FILE
if test 986 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'README.US' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README.US'\"
else
echo shar: Extracting \"'README.US'\" \(2005 characters\)
sed "s/^X//" >'README.US' <<'END_OF_FILE'
X
X
X
X
X
X                                    ``mmiinnsstt'' vv11.11
X
X                 Copyright (c) 1991 by Dipl.-Ing. Thomas Weidenfeller
X
X                                   weidi@tnevo.uucp
X                     weidi%tnevo@unido.informatik.uni-dortmund.de
X                            Thomas_Weidenfeller@f.maus.de
X
X
X
X          11.  CCOOPPYYRRIIGGHHTT
X
X               The use of ``minst'' is allowed under the following terms:
X
X               1.   The copyright notices may not be altered
X
X               2.   The program  mustn't be distributed  commercially. Even
X                    not for a "nominal fee".
X
X
X          22.  IInnttrroodduuccttiioonn
X
X               ``minst'' is a shell script that solves a problem concerning
X          the  installation of  own manual  pages under  COHERENT. COHERENT
X          stores the man pages not as  standard UN*X does. That's why it is
X          not possible to simply add new page for the ``man'' command.
X
X               Using ``minst''  makes this  now possible. The  shell script
X          formats a man  page in the nroff/troff format and  adds it to the
X          system.
X
X
X          33.  IInnssttaallllaattiioonn
X
X               The installation is very simple. There is a Makefile with an
X          ``install:'' target.  Simply  type ``make  install'' as superuser
X          in the directory where the Makefile and ``minst'' reside.
X
X               To  install  the  man page  for  ``minst''  type ``make  in-
X          stall.man''.
X
X          NOTE: The man page is currently only available in german.
X
X
X          44.  WWhhaatt iiss mmiissssiinngg?
X
X               1.   A program to de-install a man page
X
X               2.   A program to add a man page under different names
X
X               3.   An english man page for ``minst''.
X
X
X
X
X
X
X
X                                        - 1 -
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X                                      - 2 -
X
X
END_OF_FILE
echo shar: 58 control characters may be missing from \"'README.US'\"
if test 2005 -ne `wc -c <'README.US'`; then
    echo shar: \"'README.US'\" unpacked with wrong size!
fi
# end of 'README.US'
fi
if test -f 'minst' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'minst'\"
else
echo shar: Extracting \"'minst'\" \(2089 characters\)
sed "s/^X//" >'minst' <<'END_OF_FILE'
X: Bourne-Shell
X# --- minst --- Copyright (c) 1991 by Dipl.-Ing. Thomas Weidenfeller
X# 
X# Aufgabe:	Eine Manual-Page in nroff/troff-Format in das Coherent
X#		man-System einbauen
X# Usage:	minst <man_page> [<page name> [<page_typ]]
X#		man_page  - Die Datei, die die Man-Page im nroff/troff-Format
X#                           enthaelt
X#               page_name - Name, unter der das man Kommando die Page ausgeben
X#                           soll (default: <man_page> ohne die Endung '.man')
X#		page_typ  - Art & Verzeichnis, unter der die Page eingetragen
X#			    werden soll. (default: LOCAL)
X# Revision:
X#	910501,00	Anlegen des Man-Verzeichnisses eingebracht
X#	910306,00	1. Version
X#
Xecho "--- minst ---  Copyright (c) 1991 by Dipl.-Ing. Thomas Weidenfeller"
X: ${1?minst: no man page}
X
XROFF=/bin/troff			# Coherents scat kann troff-Output darstellen
XPAGEBASEDIR=/usr/man		# Basisverzeichnis fuer man-Pages
XINDEX=$PAGEBASEDIR/man.index	# Index aller vorhandenen Manual-Pages
XTMP=/tmp			# Temporaeres Verzeichnis
XTMPPAGE=$TMP/mpage$$		# Temporaere formatierte Seite
XTMPINDEX=$TMP/mndx$$		# Temporaerer Index
Xif [ x$2 = x ]; then
X	PAGENAME=`basename $1 .man`	# Name der Page
Xelse
X	PAGENAME=$2
Xfi
XPAGETYP=${3-LOCAL}		# Typ der man-Page (default: LOCAL)
XPAGEDIR=$PAGEBASEDIR/$PAGETYP	# Verzeichnis fuer die man-Page
X
Xecho "1. Formating '$1' for man page '$PAGENAME'"
X$ROFF -man $1 >$TMPPAGE
Xif [ ! $? ]; then
X	exit 1
Xfi
X
Xecho "2. Generating new index"
X{	cat $INDEX  				# Temporaeren Index anlegen
X	echo $PAGETYP/$PAGENAME $PAGENAME	# Neuen Eintrag anhaengen
X} | sort -u > $TMPINDEX				# Sortiere & Dups entfernen
Xif [ ! $? ]; then
X	exit 1
Xfi
X
Xif [ -d $PAGEDIR ]; then
X	echo "3. Skipping ['$PAGEDIR' already exists]"
Xelse
X	echo "3. Creating manual directory '$PAGEDIR'"
X	mkdir -r $PAGEDIR				# Verzeichnis anlegen
Xfi
X
Xecho "4. Installing man page '$PAGENAME' in '$PAGEDIR'"
Xmv $TMPPAGE $PAGEDIR/$PAGENAME			# Page ins Zielverzeichnis
Xif [ ! $? ]; then
X	exit 1
Xfi
X
Xecho "5. Installing new index '$INDEX'"
Xmv $TMPINDEX $INDEX				# Index ersetzen
Xif [ ! $? ]; then
X	exit 1
Xfi
X
Xecho "6. done"
Xexit 0
END_OF_FILE
if test 2089 -ne `wc -c <'minst'`; then
    echo shar: \"'minst'\" unpacked with wrong size!
fi
chmod +x 'minst'
# end of 'minst'
fi
if test -f 'minst.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'minst.man'\"
else
echo shar: Extracting \"'minst.man'\" \(1241 characters\)
sed "s/^X//" >'minst.man' <<'END_OF_FILE'
X.\" Copyright (c) 1991 by Dipl.-Ing. Thomas Weidenfeller
X.\" Beschreibung des minst-Programms
X.\"
X.TH "minst" "\n(dy.\n(mo.19\n(yr" Priv. "local command"
X
X.SH NAME
X.B "minst"
X\- Eine man-Page unter
X.CO
Xinstallieren
X
X.SH SYNOPSIS
X.B minst
X.I man_page
X.RI [ " page_name"
X.RI [ " page_typ"
X.R ]]
X
X.SH DESCRIPTION
XDieses Programm installiert Manual-Seiten unter
X.CO .
X\. Ebenso koennen alte Seiten ausgetauscht werden. Der Benutzer braucht 
XSuperuser-Status.
X.RS
X.TP
Xman_page
XDie Datei, die die Man-Page im nroff/troff-Format enthaelt
X.TP
Xpage_name
XName, unter der das man Kommando die Page ausgeben soll (default:
Xman_page ohne eine eventuelle Endung '.man')
X.TP
Xpage_typ
XArt und Verzeichnis, unter der die Page eingetragen werden soll
X(default: LOCAL)
X.RE
X.PP
XUm eine Manual-Seite einzutragen geht diese Programm in sechs Schritten vor:
X.RS
X.TP
X1.
XFormatieren der Seite mit troff
X.TP
X2.
XNeuen Index erzeugen
X.TP
X3.
XWenn noch nicht vorhanden, Verzeichnis fuer die formatierte Seite anlegen
X.TP
X4.
XFormatierte Seite in das Verzeichnis kopieren
X.TP
X5.
XAlten Index mit dem neuen Index ueberschreiben
X.TP
X6.
XSchluss
X.RE
X.SH FILES
X.IP /usr/man/man.index
X.IP /usr/man/*/*
X
X.SH "AUTOR & COPYRIGHT"
XCopyright (c) 1991 by Dipl.-Ing. Thomas Weidenfeller
END_OF_FILE
if test 1241 -ne `wc -c <'minst.man'`; then
    echo shar: \"'minst.man'\" unpacked with wrong size!
fi
# end of 'minst.man'
fi
echo shar: End of shell archive.
exit 0