aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-07-19 22:40:33 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-07-19 22:40:33 +0000
commit6b4480e041335acb92e1c76c4bdc9186f5bfb0f2 (patch)
tree8f0dba438bbfb9ae8b443e2e97d876b5c4051c2a
parent490252b369661e1862919f425cdaf44accbeb1ae (diff)
downloadmandoc-6b4480e041335acb92e1c76c4bdc9186f5bfb0f2.tar.gz
mandoc-6b4480e041335acb92e1c76c4bdc9186f5bfb0f2.tar.zst
mandoc-6b4480e041335acb92e1c76c4bdc9186f5bfb0f2.zip
Now that our man.conf(5) format is mature and extremely simple,
delete manpath(1) support. With the mandoc-based man(1), manpath(1) is utterly useless. Just set MANPATH_DEFAULT in configure.local for sane operating system defaults, use man.conf(5) for machine- specific modifications, and use ${MANPATH}, -m, and -M for user preferences.
-rw-r--r--INSTALL23
-rwxr-xr-xconfigure20
-rw-r--r--configure.local.example21
-rw-r--r--makewhatis.86
-rw-r--r--mandocdb.c5
-rw-r--r--manpath.c53
6 files changed, 20 insertions, 108 deletions
diff --git a/INSTALL b/INSTALL
index 765bc568..115d1600 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-$Id: INSTALL,v 1.16 2016/07/19 21:31:55 schwarze Exp $
+$Id: INSTALL,v 1.17 2016/07/19 22:40:33 schwarze Exp $
About mdocml, the portable mandoc distribution
----------------------------------------------
@@ -35,7 +35,11 @@ To install mandoc manually, the following steps are needed:
command "echo BUILD_CGI=1 > configure.local". Then run "cp
cgi.h.examples cgi.h" and edit cgi.h as desired.
-2. Run "./configure".
+2. Define MANPATH_DEFAULT in configure.local
+if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate
+for your operating system.
+
+3. Run "./configure".
This script attempts autoconfiguration of mandoc for your system.
Read both its standard output and the file "Makefile.local" it
generates. If anything looks wrong or different from what you
@@ -45,27 +49,20 @@ result seems right to you.
On Solaris 10 and earlier, you may have to run "ksh ./configure"
because the native /bin/sh lacks some POSIX features.
-3. Run "make".
+4. Run "make".
Any POSIX-compatible make, in particular both BSD make and GNU make,
should work. If the build fails, look at "configure.local.example"
and go back to step 2.
-4. Run "make -n install" and check whether everything will be
+5. Run "make -n install" and check whether everything will be
installed to the intended places. Otherwise, put some *DIR or *NM*
-variables into "configure.local" and go back to step 2.
+variables into "configure.local" and go back to step 3.
-5. Run "sudo make install". If you intend to build a binary
+6. Run "sudo make install". If you intend to build a binary
package using some kind of fake root mechanism, you may need a
command like "make DESTDIR=... install". Read the *-install targets
in the "Makefile" to understand how DESTDIR is used.
-6. If you want to use the integrated man(1) and your system uses
-manpath(1), make sure it is configured correctly, in particular,
-it returns all directory trees where manual pages are installed.
-Otherwise, if your system uses man.conf(5), make sure it contains
-a "manpath" line for each directory tree, and the order of these
-lines meets your wishes.
-
7. Run the command "sudo
makewhatis" to build mandoc.db(5) databases in all the directory
trees configured in step 6. Whenever installing new manual pages,
diff --git a/configure b/configure
index 77993f7d..7d61ea81 100755
--- a/configure
+++ b/configure
@@ -51,6 +51,7 @@ HAVE_GETLINE=
HAVE_GETSUBOPT=
HAVE_ISBLANK=
HAVE_MKDTEMP=
+HAVE_OHASH=
HAVE_PLEDGE=
HAVE_PROGNAME=
HAVE_REALLOCARRAY=
@@ -67,9 +68,6 @@ HAVE_STRTONUM=
HAVE_VASPRINTF=
HAVE_WCHAR=
-HAVE_OHASH=
-HAVE_MANPATH=
-
PREFIX="/usr/local"
BINDIR=
SBINDIR=
@@ -217,21 +215,6 @@ echo "LDADD=\"${LDADD}\"" 1>&2
echo "LDADD=\"${LDADD}\"" 1>&3
echo 1>&3
-# --- manpath ---
-if ismanual manpath "${HAVE_MANPATH}"; then
- :
-elif manpath 1>&3 2>&3; then
- echo "manpath: yes" 1>&2
- echo "manpath: yes" 1>&3
- echo 1>&3
- HAVE_MANPATH=1
-else
- echo "manpath: no" 1>&2
- echo "manpath: no" 1>&3
- echo 1>&3
- HAVE_MANPATH=0
-fi
-
# --- write config.h ---
exec > config.h
@@ -287,7 +270,6 @@ cat << __HEREDOC__
#define HAVE_VASPRINTF ${HAVE_VASPRINTF}
#define HAVE_WCHAR ${HAVE_WCHAR}
#define HAVE_OHASH ${HAVE_OHASH}
-#define HAVE_MANPATH ${HAVE_MANPATH}
#define BINM_APROPOS "${BINM_APROPOS}"
#define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
diff --git a/configure.local.example b/configure.local.example
index 6103f99e..9035c565 100644
--- a/configure.local.example
+++ b/configure.local.example
@@ -1,4 +1,4 @@
-# $Id: configure.local.example,v 1.15 2016/07/19 21:31:55 schwarze Exp $
+# $Id: configure.local.example,v 1.16 2016/07/19 22:40:33 schwarze Exp $
#
# Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
#
@@ -49,9 +49,9 @@ HAVE_WCHAR=1
HAVE_WCHAR=0
# When man(1) or apropos(1) is called without -m and -M options,
-# MANPATH is not set in the environment, man.conf(5) is not available
-# and manpath(1) not used, manuals are searched for in the following
-# directory trees by default.
+# MANPATH is not set in the environment, and man.conf(5) is not
+# available, manuals are searched for in the following directory
+# trees by default.
MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"
@@ -80,19 +80,6 @@ INCLUDEDIR="${PREFIX}/include/mandoc"
LIBDIR="${PREFIX}/lib/mandoc"
MANDIR="${PREFIX}/man"
-# The man(1) utility needs to know where the manuals reside.
-# We know of two ways to tell it: via manpath(1) or man.conf(5).
-# The latter is used by OpenBSD and NetBSD, the former by most
-# other systems.
-
-# Force usage of manpath(1).
-# If it is not installed or not operational,
-# man(1), makewhatis(8), and apropos(1) will not work properly.
-HAVE_MANPATH=1
-
-# Force usage of man.conf(5).
-HAVE_MANPATH=0
-
# Some distributions may want to avoid naming conflicts
# with the configuration files of other man(1) implementations.
# This changes the name of the installed section 5 manual page as well.
diff --git a/makewhatis.8 b/makewhatis.8
index 8a5de938..945c0536 100644
--- a/makewhatis.8
+++ b/makewhatis.8
@@ -1,4 +1,4 @@
-.\" $Id: makewhatis.8,v 1.3 2014/08/17 21:03:06 schwarze Exp $
+.\" $Id: makewhatis.8,v 1.4 2016/07/19 22:40:33 schwarze Exp $
.\"
.\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 17 2014 $
+.Dd $Mdocdate: July 19 2016 $
.Dt MAKEWHATIS 8
.Os
.Sh NAME
@@ -79,8 +79,6 @@ If
is not provided,
.Nm
uses the default paths stipulated by
-.Xr manpath 1 ,
-or
.Xr man.conf 5 .
.Pp
The arguments are as follows:
diff --git a/mandocdb.c b/mandocdb.c
index 9bea830c..c9eda485 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.221 2016/07/19 21:31:55 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.222 2016/07/19 22:40:33 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -464,8 +464,7 @@ mandocdb(int argc, char *argv[])
} else {
/*
* If we have arguments, use them as our manpaths.
- * If we don't, grok from manpath(1) or however else
- * manconf_parse() wants to do it.
+ * If we don't, use man.conf(5).
*/
if (argc > 0) {
conf.manpath.paths = mandoc_reallocarray(NULL,
diff --git a/manpath.c b/manpath.c
index 83c329ec..008c5939 100644
--- a/manpath.c
+++ b/manpath.c
@@ -1,4 +1,4 @@
-/* $Id: manpath.c,v 1.30 2016/05/28 13:44:13 schwarze Exp $ */
+/* $Id: manpath.c,v 1.31 2016/07/19 22:40:33 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -32,9 +32,7 @@
#include "mandoc_aux.h"
#include "manconf.h"
-#if !HAVE_MANPATH
static void manconf_file(struct manconf *, const char *);
-#endif
static void manpath_add(struct manpaths *, const char *, int);
static void manpath_parseline(struct manpaths *, char *, int);
@@ -43,52 +41,6 @@ void
manconf_parse(struct manconf *conf, const char *file,
char *defp, char *auxp)
{
-#if HAVE_MANPATH
- char cmd[(PATH_MAX * 3) + 20];
- FILE *stream;
- char *buf;
- size_t sz, bsz;
-
- strlcpy(cmd, "manpath", sizeof(cmd));
- if (file) {
- strlcat(cmd, " -C ", sizeof(cmd));
- strlcat(cmd, file, sizeof(cmd));
- }
- if (auxp) {
- strlcat(cmd, " -m ", sizeof(cmd));
- strlcat(cmd, auxp, sizeof(cmd));
- }
- if (defp) {
- strlcat(cmd, " -M ", sizeof(cmd));
- strlcat(cmd, defp, sizeof(cmd));
- }
-
- /* Open manpath(1). Ignore errors. */
-
- stream = popen(cmd, "r");
- if (NULL == stream)
- return;
-
- buf = NULL;
- bsz = 0;
-
- /* Read in as much output as we can. */
-
- do {
- buf = mandoc_realloc(buf, bsz + 1024);
- sz = fread(buf + bsz, 1, 1024, stream);
- bsz += sz;
- } while (sz > 0);
-
- if ( ! ferror(stream) && feof(stream) &&
- bsz && '\n' == buf[bsz - 1]) {
- buf[bsz - 1] = '\0';
- manpath_parseline(&conf->manpath, buf, 1);
- }
-
- free(buf);
- pclose(stream);
-#else
char *insert;
/* Always prepend -m. */
@@ -137,7 +89,6 @@ manconf_parse(struct manconf *conf, const char *file,
/* MANPATH overrides man.conf(5) completely. */
manpath_parseline(&conf->manpath, defp, 0);
-#endif
}
/*
@@ -204,7 +155,6 @@ manconf_free(struct manconf *conf)
free(conf->output.style);
}
-#if !HAVE_MANPATH
static void
manconf_file(struct manconf *conf, const char *file)
{
@@ -270,7 +220,6 @@ out:
if (*manpath_default != '\0')
manpath_parseline(&conf->manpath, manpath_default, 0);
}
-#endif
void
manconf_output(struct manoutput *conf, const char *cp)