-$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
----------------------------------------------
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
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,
HAVE_GETSUBOPT=
HAVE_ISBLANK=
HAVE_MKDTEMP=
+HAVE_OHASH=
HAVE_PLEDGE=
HAVE_PROGNAME=
HAVE_REALLOCARRAY=
HAVE_VASPRINTF=
HAVE_WCHAR=
-HAVE_OHASH=
-HAVE_MANPATH=
-
PREFIX="/usr/local"
BINDIR=
SBINDIR=
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
#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}"
-# $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>
#
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"
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.
-.\" $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>
.\" 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
is not provided,
.Nm
uses the default paths stipulated by
-.Xr manpath 1 ,
-or
.Xr man.conf 5 .
.Pp
The arguments are as follows:
-/* $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>
} 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,
-/* $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>
#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);
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. */
/* MANPATH overrides man.conf(5) completely. */
manpath_parseline(&conf->manpath, defp, 0);
-#endif
}
/*
free(conf->output.style);
}
-#if !HAVE_MANPATH
static void
manconf_file(struct manconf *conf, const char *file)
{
if (*manpath_default != '\0')
manpath_parseline(&conf->manpath, manpath_default, 0);
}
-#endif
void
manconf_output(struct manoutput *conf, const char *cp)