aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/man
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/man')
-rw-r--r--gnu/usr.bin/man/Makefile.inc2
-rw-r--r--gnu/usr.bin/man/apropos/Makefile24
-rw-r--r--gnu/usr.bin/man/catman/Makefile17
-rw-r--r--gnu/usr.bin/man/catman/catman.sh (renamed from gnu/usr.bin/man/catman/catman)15
-rw-r--r--gnu/usr.bin/man/lib/Makefile5
-rw-r--r--gnu/usr.bin/man/lib/config.h_dist16
-rw-r--r--gnu/usr.bin/man/makewhatis/Makefile4
-rw-r--r--gnu/usr.bin/man/makewhatis/makewhatis.sh9
-rw-r--r--gnu/usr.bin/man/man/Makefile3
-rw-r--r--gnu/usr.bin/man/man/man.c75
-rw-r--r--gnu/usr.bin/man/man/man.man4
-rw-r--r--gnu/usr.bin/man/manpath/Makefile2
-rw-r--r--gnu/usr.bin/man/manpath/manpath.config4
-rw-r--r--gnu/usr.bin/man/whatis/Makefile23
14 files changed, 114 insertions, 89 deletions
diff --git a/gnu/usr.bin/man/Makefile.inc b/gnu/usr.bin/man/Makefile.inc
index c0df250c0a23..b993e790e96f 100644
--- a/gnu/usr.bin/man/Makefile.inc
+++ b/gnu/usr.bin/man/Makefile.inc
@@ -19,6 +19,8 @@ refer= /usr/bin/refer
grap= # no grap
pic= /usr/bin/pic
zcat= /usr/bin/zcat
+compress= gzip -c
+compext= .gz
# For scripts.
.if !target(obj)
diff --git a/gnu/usr.bin/man/apropos/Makefile b/gnu/usr.bin/man/apropos/Makefile
index 6208d5e6ba5e..b2f855a0f12e 100644
--- a/gnu/usr.bin/man/apropos/Makefile
+++ b/gnu/usr.bin/man/apropos/Makefile
@@ -1,12 +1,16 @@
+# $Id: Makefile,v 1.7 1994/06/05 21:57:03 csgr Exp $
+
.if exists(${.CURDIR}/obj)
-MANP= ${.CURDIR}/obj/apropos.1
+MAN1= ${.CURDIR}/obj/apropos.1
TARG= ${.CURDIR}/obj/apropos
.else
-MANP= ${.CURDIR}/apropos.1
+MAN1= ${.CURDIR}/apropos.1
TARG= ${.CURDIR}/apropos
.endif
-all: ${TARG} ${MANP}
+MANDEPEND= ${MAN1}
+
+all: ${TARG} ${MAN1}
depend rcsfreeze tags all:
@echo -n
@@ -15,14 +19,14 @@ cleandir: clean
cd ${.CURDIR}; rm -rf obj;
clean:
- @rm -f ${TARG} ${MANP}
+ @rm -f ${TARG} ${MAN1}
${TARG}: ${.CURDIR}/apropos.sh
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
-e 's,%pager%,${pager},' \
${.CURDIR}/apropos.sh > $@
-${MANP}: ${.CURDIR}/apropos.man
+${MAN1}: ${.CURDIR}/apropos.man
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
-e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
-e 's,%manpath_config_file%,${manpath_config_file},' \
@@ -31,7 +35,13 @@ ${MANP}: ${.CURDIR}/apropos.man
install: ${TARG} maninstall
install -c -o bin -g bin -m 555 ${TARG} ${DESTDIR}/usr/bin
-maninstall: ${MANP}
- install -c -o bin -g bin -m 444 ${MANP} ${DESTDIR}/usr/share/man/man1
.include "../Makefile.inc"
+
+.if make(maninstall) || make(install)
+.if !defined(NOMAN)
+.include <bsd.man.mk>
+.elif !target(maninstall)
+maninstall:
+.endif
+.endif
diff --git a/gnu/usr.bin/man/catman/Makefile b/gnu/usr.bin/man/catman/Makefile
index de870e395a6b..f4bd03f7baec 100644
--- a/gnu/usr.bin/man/catman/Makefile
+++ b/gnu/usr.bin/man/catman/Makefile
@@ -1,8 +1,15 @@
-obj cleandir clean depend rcsfreeze tags all:
- @echo -n
+NOMAN= noman
+CLEANFILES= catman
-install:
- install -c -o bin -g bin -m 555 catman ${DESTDIR}/usr/bin
+beforeinstall: catman
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ catman ${DESTDIR}${BINDIR}
-.include "../Makefile.inc"
.include <bsd.prog.mk>
+
+catman: catman.sh
+ sed -e 's,%compress%,${compress},' \
+ -e 's,%compext%,${compext},' \
+ -e 's,%zcat%,${zcat},' \
+ ${.CURDIR}/catman.sh > catman
+
diff --git a/gnu/usr.bin/man/catman/catman b/gnu/usr.bin/man/catman/catman.sh
index a2d16a11704c..456cb576953d 100644
--- a/gnu/usr.bin/man/catman/catman
+++ b/gnu/usr.bin/man/catman/catman.sh
@@ -6,13 +6,20 @@ MANDIR=/usr/share/man
formatman()
{
- echo " "$1 "->" $*
+ suffix=`echo $1 | sed -e 's/.*\\.//'`
(cd cat$section; rm -f $*)
- nroff -man < man$section/$1 > cat$section/$1
- catfile=$1; shift
+ if [ ".$suffix" = "%compext%" ]; then
+ adds=
+ %zcat% man$section/$1 | nroff -man | %compress% > cat$section/$1$adds
+ else
+ adds=%compext%
+ nroff -man < man$section/$1 | %compress% > cat$section/$1$adds
+ fi
+ echo " "$* "->" $1$adds
+ catfile=$1$adds; shift
while [ $# -gt 0 ]
do
- ln cat$section/$catfile cat$section/$1
+ ln cat$section/$catfile cat$section/$1$adds
shift
done
}
diff --git a/gnu/usr.bin/man/lib/Makefile b/gnu/usr.bin/man/lib/Makefile
index d364b32f4b7a..7134c86aa3a5 100644
--- a/gnu/usr.bin/man/lib/Makefile
+++ b/gnu/usr.bin/man/lib/Makefile
@@ -6,8 +6,9 @@ CONFH= ${.CURDIR}/obj/config.h
CONFH= ${.CURDIR}/config.h
.endif
+NOPROFILE= YES
-CFLAGS+= -I${.CURDIR} -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_UNCOMPRESS -DALT_SYSTEMS
+CFLAGS+= -I${.CURDIR} -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_COMPRESS -DALT_SYSTEMS
CLEANFILES+= ${CONFH}
SRCS = util.c gripes.c
@@ -25,6 +26,8 @@ depend ${CONFH}: ${.CURDIR}/config.h_dist ../Makefile.inc
-e 's,%vgrind%,${vgrind},' -e 's,%refer%,${refer},' \
-e 's,%grap%,${grap},' -e 's,%zcat%,${zcat},' \
-e 's,%manpath_config_file%,${manpath_config_file},' \
+ -e 's,%compress%,${compress},' \
+ -e 's,%compext%,${compext},' \
${.CURDIR}/config.h_dist > ${CONFH}
.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/man/lib/config.h_dist b/gnu/usr.bin/man/lib/config.h_dist
index 74122df0370b..3438e6f0082a 100644
--- a/gnu/usr.bin/man/lib/config.h_dist
+++ b/gnu/usr.bin/man/lib/config.h_dist
@@ -22,11 +22,6 @@
* Austin, Texas 78712
*/
-#ifdef COMPRESS
-#define DO_COMPRESS
-#define DO_UNCOMPRESS
-#endif
-
/*
* This is the size of a number of internal buffers. It should
* probably not be less than 512.
@@ -132,27 +127,26 @@
/*
* Define the uncompression program(s) to use for those preformatted
* pages that end in the given character. If you add extras here, you
- * may need to change man.c.
+ * may need to change man.c. [I have no idea what FCAT and YCAT files
+ * are! - I will leave them in for now.. -jkh]
*/
-#ifdef DO_UNCOMPRESS
/* .F files */
#define FCAT ""
/* .Y files */
#define YCAT ""
/* .Z files */
#define ZCAT "%zcat%"
-#endif
/*
* This is the standard program to use on this system for compressing
* pages once they have been formatted, and the character to tack on
* to the end of those files. The program listed is expected to read
* from the standard input and write compressed output to the standard
- * output.
+ * output. These won't actually be used unless compression is enabled.
*/
#ifdef DO_COMPRESS
-#define COMPRESSOR ""
-#define COMPRESS_EXT ""
+#define COMPRESSOR "%compress%"
+#define COMPRESS_EXT "%compext%"
#endif
/*
diff --git a/gnu/usr.bin/man/makewhatis/Makefile b/gnu/usr.bin/man/makewhatis/Makefile
index f146c9d4da2d..bd14975c490a 100644
--- a/gnu/usr.bin/man/makewhatis/Makefile
+++ b/gnu/usr.bin/man/makewhatis/Makefile
@@ -5,11 +5,13 @@ CLEANFILES= makewhatis
beforeinstall: makewhatis
install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${.CURDIR}/makewhatis.sh ${DESTDIR}${BINDIR}/makewhatis
+ makewhatis ${DESTDIR}${BINDIR}
.include <bsd.prog.mk>
makewhatis: makewhatis.sh
sed -e 's/%sections%/ "1", "n", "l", "6", "8", "2", "3", "4", "5", "7", "p", "o", NULL/' \
+ -e 's,%zcat%,${zcat},' \
+ -e 's,%compext%,${compext},' \
${.CURDIR}/makewhatis.sh > makewhatis
diff --git a/gnu/usr.bin/man/makewhatis/makewhatis.sh b/gnu/usr.bin/man/makewhatis/makewhatis.sh
index 1d86d1993946..28b871d22da8 100644
--- a/gnu/usr.bin/man/makewhatis/makewhatis.sh
+++ b/gnu/usr.bin/man/makewhatis/makewhatis.sh
@@ -30,9 +30,16 @@ do
then
for f in `find $subdir -type f -print`
do
+ suffix=`echo $f | sed -e 's/.*\\.//'`
+ if [ ".$suffix" = "%compext%" ]; then
+ output=%zcat%
+ else
+ output=cat
+ fi
+ $output $f | \
sed -n '/^\.TH.*$/p
/^\.Dt.*$/p
- /^\.S[hH][ ]*NAME/,/^\.S[hH]/p' $f |\
+ /^\.S[hH][ ]*NAME/,/^\.S[hH]/p'|\
sed -e 's/\\[ ]*\-/-/
s/^.P[Pp].*$//
s/\\(em//
diff --git a/gnu/usr.bin/man/man/Makefile b/gnu/usr.bin/man/man/Makefile
index 52903bfbd634..aaeb0868d8b2 100644
--- a/gnu/usr.bin/man/man/Makefile
+++ b/gnu/usr.bin/man/man/Makefile
@@ -18,13 +18,14 @@ MAN1= ${.CURDIR}/man.1
DPADD+= ${MAN1}
CFLAGS+= -I${.CURDIR}/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF
-CFLAGS+= -DDO_UNCOMPRESS -DALT_SYSTEMS -DSETREUID -DCATMODE=0664
+CFLAGS+= -DDO_COMPRESS -DALT_SYSTEMS -DSETREUID -DCATMODE=0664
CLEANFILES+= ${MAN1}
${MAN1}: ${.CURDIR}/man.man
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
-e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
-e 's,%manpath_config_file%,${manpath_config_file},' \
+ -e 's,%compress%,${compress},' \
${.CURDIR}/man.man > ${MAN1}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c
index c5b4ee0af0a4..262e3337f214 100644
--- a/gnu/usr.bin/man/man/man.c
+++ b/gnu/usr.bin/man/man/man.c
@@ -524,11 +524,15 @@ convert_name (name, to_cat)
if (to_cat)
{
int len = strlen (name) + 3;
+ int cextlen = strlen(COMPRESS_EXT);
+
to_name = (char *) malloc (len);
if (to_name == NULL)
gripe_alloc (len, "to_name");
strcpy (to_name, name);
- strcat (to_name, ".Z");
+ /* Avoid tacking it on twice */
+ if (strcmp(name + (len - (3 + cextlen)), COMPRESS_EXT))
+ strcat (to_name, COMPRESS_EXT);
}
else
to_name = strdup (name);
@@ -660,43 +664,30 @@ make_name (path, section, name, cat)
return &names[0];
}
-#ifdef DO_UNCOMPRESS
char *
get_expander (file)
char *file;
{
- char *expander = NULL;
- int len = strlen (file);
+ char *end = file + (strlen (file) - 1);
- if (file[len - 2] == '.')
- {
- switch (file[len - 1])
- {
+ while (end > file && end[-1] != '.')
+ --end;
+ if (end == file)
+ return NULL;
#ifdef FCAT
- case 'F':
- if (strcmp (FCAT, "") != 0)
- expander = strdup (FCAT);
- break;
-#endif
+ if (*end == 'F')
+ return FCAT;
+#endif /* FCAT */
#ifdef YCAT
- case 'Y':
- if (strcmp (YCAT, "") != 0)
- expander = strdup (YCAT);
- break;
-#endif
+ if (*end == 'Y')
+ return YCAT;
+#endif /* YCAT */
#ifdef ZCAT
- case 'Z':
- if (strcmp (ZCAT, "") != 0)
- expander = strdup (ZCAT);
- break;
-#endif
- default:
- break;
- }
- }
- return expander;
+ if (*end == 'Z' || !strcmp(end, "gz"))
+ return ZCAT;
+#endif /* ZCAT */
+ return NULL;
}
-#endif
/*
* Simply display the preformatted page.
@@ -712,16 +703,12 @@ display_cat_file (file)
if (access (file, R_OK) == 0)
{
-#ifdef DO_UNCOMPRESS
char *expander = get_expander (file);
if (expander != NULL)
sprintf (command, "%s %s | %s", expander, file, pager);
else
sprintf (command, "%s %s", pager, file);
-#else
- sprintf (command, "%s %s", pager, file);
-#endif
found = do_system_command (command);
}
@@ -911,7 +898,6 @@ parse_roff_directive (cp, file, buf)
strcat (buf, " | ");
strcat (buf, NROFF);
}
-
if (tbl_found && !troff && strcmp (COL, "") != 0)
{
strcat (buf, " | ");
@@ -992,22 +978,21 @@ make_roff_command (file)
if (debug)
fprintf (stderr, "using default preprocessor sequence\n");
+ if ((cp = get_expander(file)) == NULL)
+ cp = "cat";
+ sprintf(buf, "%s %s | ", cp, file);
#ifdef HAS_TROFF
if (troff)
{
if (strcmp (TBL, "") != 0)
{
- strcpy (buf, TBL);
- strcat (buf, " ");
- strcat (buf, file);
+ strcat (buf, TBL);
strcat (buf, " | ");
strcat (buf, TROFF);
}
else
{
- strcpy (buf, TROFF);
- strcat (buf, " ");
- strcat (buf, file);
+ strcat (buf, TROFF);
}
}
else
@@ -1015,17 +1000,13 @@ make_roff_command (file)
{
if (strcmp (TBL, "") != 0)
{
- strcpy (buf, TBL);
- strcat (buf, " ");
- strcat (buf, file);
+ strcat (buf, TBL);
strcat (buf, " | ");
strcat (buf, NROFF);
}
else
{
strcpy (buf, NROFF);
- strcat (buf, " ");
- strcat (buf, file);
}
if (strcmp (COL, "") != 0)
@@ -1073,7 +1054,7 @@ make_cat_file (path, man_file, cat_file)
#endif
/*
* Don't let the user interrupt the system () call and screw up
- * the formmatted man page if we're not done yet.
+ * the formatted man page if we're not done yet.
*/
fprintf (stderr, "Formatting page, please wait...");
fflush(stderr);
@@ -1383,7 +1364,7 @@ man (name)
if (debug)
fprintf (stderr, "\nsearching in %s\n", *mp);
- glob = 0;
+ glob = 1;
found += try_section (*mp, section, name, glob);
diff --git a/gnu/usr.bin/man/man/man.man b/gnu/usr.bin/man/man/man.man
index 2c034feee0a7..bddfc028b7f7 100644
--- a/gnu/usr.bin/man/man/man.man
+++ b/gnu/usr.bin/man/man/man.man
@@ -27,7 +27,9 @@ like to display the formatted pages. If section is specified, man
only looks in that section of the manual. You may also specify the
order to search the sections for entries and which preprocessors to
run on the source files via command line options or environment
-variables.
+variables. If enabled by the system administrator, formatted man
+pages will also be compressed with the `%compress%' command to save
+space.
.SH OPTIONS
.TP
.B \-\^M " path"
diff --git a/gnu/usr.bin/man/manpath/Makefile b/gnu/usr.bin/man/manpath/Makefile
index c86bf1be8463..6b6bfbbd85ed 100644
--- a/gnu/usr.bin/man/manpath/Makefile
+++ b/gnu/usr.bin/man/manpath/Makefile
@@ -25,6 +25,6 @@ ${MAN1}: ${.CURDIR}/manpath.man
${.CURDIR}/manpath.man > ${MAN1}
afterinstall:
- install -c -o bin -g bin -m 555 ${.CURDIR}/manpath.config ${DESTDIR}${manpath_config_file}
+ install -c -o bin -g bin -m 555 ${.CURDIR}/manpath.config ${DESTDIR}${manpath_config_file}.sample
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/man/manpath/manpath.config b/gnu/usr.bin/man/manpath/manpath.config
index b9c1171ae37e..677b1adec5e4 100644
--- a/gnu/usr.bin/man/manpath/manpath.config
+++ b/gnu/usr.bin/man/manpath/manpath.config
@@ -17,6 +17,7 @@
MANDATORY_MANPATH /usr/share/man
MANDATORY_MANPATH /usr/local/man
MANDATORY_MANPATH /usr/X386/man
+MANDATORY_MANPATH /usr/X11R6/man
MANDATORY_MANPATH /usr/gnu/man
#
# set up PATH to MANPATH mapping
@@ -27,4 +28,5 @@ MANPATH_MAP /usr/ucb /usr/share/man
MANPATH_MAP /usr/local/mh /usr/local/mh/man
MANPATH_MAP /usr/local/bin /usr/local/man
MANPATH_MAP /usr/gnu /usr/gnu/man
-MANPATH_MAP /usr/X386 /usr/X386/man
+MANPATH_MAP /usr/X386/bin /usr/X386/man
+MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
diff --git a/gnu/usr.bin/man/whatis/Makefile b/gnu/usr.bin/man/whatis/Makefile
index 94347e11eb31..b3cd6a8b34a1 100644
--- a/gnu/usr.bin/man/whatis/Makefile
+++ b/gnu/usr.bin/man/whatis/Makefile
@@ -1,12 +1,14 @@
.if exists(${.CURDIR}/obj)
-MANP= ${.CURDIR}/obj/whatis.1
+MAN1= ${.CURDIR}/obj/whatis.1
TARG= ${.CURDIR}/obj/whatis
.else
-MANP= ${.CURDIR}/whatis.1
+MAN1= ${.CURDIR}/whatis.1
TARG= ${.CURDIR}/whatis
.endif
-all: ${TARG} ${MANP}
+MANDEPEND= ${MAN1}
+
+all: ${TARG} ${MAN1}
depend rcsfreeze tags all:
@echo -n
@@ -15,23 +17,28 @@ cleandir: clean
cd ${.CURDIR}; rm -rf obj;
clean:
- @rm -f ${TARG} ${MANP}
+ @rm -f ${TARG} ${MAN1}
${TARG}: ${.CURDIR}/whatis.sh
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
-e 's,%pager%,${pager},' \
${.CURDIR}/whatis.sh > ${TARG}
-${MANP}: ${.CURDIR}/whatis.man
+${MAN1}: ${.CURDIR}/whatis.man
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
-e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
-e 's,%manpath_config_file%,${manpath_config_file},' \
- ${.CURDIR}/whatis.man > ${MANP}
+ ${.CURDIR}/whatis.man > ${MAN1}
install: ${TARG} maninstall
install -c -o bin -g bin -m 555 ${TARG} ${DESTDIR}/usr/bin
-maninstall: ${MANP}
- install -c -o bin -g bin -m 444 ${MANP} ${DESTDIR}/usr/share/man/man1
.include "../Makefile.inc"
+.if make(maninstall) || make(install)
+.if !defined(NOMAN)
+.include <bsd.man.mk>
+.else
+maninstall:
+.endif
+.endif