diff options
-rw-r--r-- | INSTALL | 21 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.local.example | 19 | ||||
-rw-r--r-- | makewhatis.8 | 2 | ||||
-rw-r--r-- | mandocdb.c | 3 | ||||
-rw-r--r-- | manpath.c | 51 |
6 files changed, 14 insertions, 102 deletions
@@ -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, @@ -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 146ca726..db86c2fb 100644 --- a/configure.local.example +++ b/configure.local.example @@ -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 d082a6c7..0a951b59 100644 --- a/makewhatis.8 +++ b/makewhatis.8 @@ -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: @@ -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, @@ -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) |