source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Support choosing alternative binary and manual names from
@ 2014-12-09  9:14 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-12-09  9:14 UTC (permalink / raw)
  To: source

Log Message:
-----------
Support choosing alternative binary and manual names from configure.local,
to help downstream distributions avoid naming conflicts.

Modified Files:
--------------
    mdocml:
        Makefile
        configure
        configure.local.example
        main.c

Revision Data
-------------
Index: main.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/main.c,v
retrieving revision 1.203
retrieving revision 1.204
diff -Lmain.c -Lmain.c -u -p -r1.203 -r1.204
--- main.c
+++ main.c
@@ -134,8 +134,7 @@ main(int argc, char *argv[])
 		++progname;
 
 #if HAVE_SQLITE3
-	if (0 == strncmp(progname, "mandocdb", 8) ||
-	    0 == strncmp(progname, "makewhatis", 10))
+	if (strcmp(progname, BINM_MAKEWHATIS) == 0)
 		return(mandocdb(argc, argv));
 #endif
 
@@ -147,11 +146,11 @@ main(int argc, char *argv[])
 	memset(&search, 0, sizeof(struct mansearch));
 	search.outkey = "Nd";
 
-	if (strcmp(progname, "man") == 0)
+	if (strcmp(progname, BINM_MAN) == 0)
 		search.argmode = ARG_NAME;
-	else if (strncmp(progname, "apropos", 7) == 0)
+	else if (strcmp(progname, BINM_APROPOS) == 0)
 		search.argmode = ARG_EXPR;
-	else if (strncmp(progname, "whatis", 6) == 0)
+	else if (strcmp(progname, BINM_WHATIS) == 0)
 		search.argmode = ARG_WORD;
 	else if (strncmp(progname, "help", 4) == 0)
 		search.argmode = ARG_NAME;
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.1 -r1.2
--- configure.local.example
+++ configure.local.example
@@ -58,7 +58,7 @@ HAVE_WCHAR=0
 # If you do not want uname(3) to be called but instead want a fixed
 # string to be used, use the following line:
 
-OSNAME="OpenBSD 5.5"
+OSNAME="OpenBSD 5.6"
 
 # The following installation directories are used.
 # It is possible to set only one or a few of these variables,
@@ -74,6 +74,19 @@ LIBDIR="${PREFIX}/lib/mandoc"
 MANDIR="${PREFIX}/man"
 EXAMPLEDIR="${PREFIX}/share/examples/mandoc"
 
+# Some distributions may want to avoid naming conflicts among manuals.
+# If you want to change the names of installed section 7 manual pages,
+# the following alternative names are suggested.
+# The suffix ".7" will automatically be appended.
+# It is possible to set only one or a few of these variables,
+# there is no need to copy the whole block.
+
+MANM_MAN="mandoc_man"		# default is "man"
+MANM_MDOC="mandoc_mdoc"		# default is "mdoc"
+MANM_ROFF="mandoc_roff"		# default is "roff"
+MANM_EQN="mandoc_eqn"		# default is "eqn"
+MANM_TBL="mandoc_tbl"		# default is "tbl"
+
 # It is possible to change the utility program used for installation
 # and the modes files are installed with.  The defaults are:
 
@@ -124,6 +137,21 @@ HAVE_MANPATH=1
 # makewhatis(8) and apropos(1) will not work properly.
 
 HAVE_MANPATH=0
+
+# Some distributions may want to avoid naming conflicts
+# with groff, man-db, or other tools.
+# If you want to change the names of binary programs,
+# the following alternative names are suggested.
+# Using other names is possible as well.
+# This changes the names of the installed section 1 and section 8
+# manual pages as well.
+# It is possible to set only one or a few of these variables,
+# there is no need to copy the whole block.
+
+BINM_APROPOS=mapropos		# default is "apropos"
+BINM_MAN=mman			# default is "man"
+BINM_WHATIS=mwhatis		# default is "whatis"
+BINM_MAKEWHATIS=mandocdb	# default is "makewhatis"
 
 # --- user settings related man.cgi ------------------------------------
 
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lconfigure -Lconfigure -u -p -r1.15 -r1.16
--- configure
+++ configure
@@ -75,6 +75,16 @@ WWWPREFIX="/var/www"
 HTDOCDIR=
 CGIBINDIR=
 
+BINM_APROPOS="apropos"
+BINM_MAN="man"
+BINM_WHATIS="whatis"
+BINM_MAKEWHATIS="makewhatis"
+MANM_MAN="man"
+MANM_MDOC="mdoc"
+MANM_ROFF="roff"
+MANM_EQN="eqn"
+MANM_TBL="tbl"
+
 INSTALL="install"
 INSTALL_PROGRAM=
 INSTALL_LIB=
@@ -285,6 +295,11 @@ cat << __HEREDOC__
 #define HAVE_OHASH ${HAVE_OHASH}
 #define HAVE_MANPATH ${HAVE_MANPATH}
 
+#define BINM_APROPOS "${BINM_APROPOS}"
+#define BINM_MAN "${BINM_MAN}"
+#define BINM_WHATIS "${BINM_WHATIS}"
+#define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
+
 #if !defined(__BEGIN_DECLS)
 #  ifdef __cplusplus
 #  define	__BEGIN_DECLS		extern "C" {
@@ -380,6 +395,15 @@ EXAMPLEDIR	= ${EXAMPLEDIR}
 WWWPREFIX	= ${WWWPREFIX}
 HTDOCDIR	= ${HTDOCDIR}
 CGIBINDIR	= ${CGIBINDIR}
+BINM_APROPOS	= ${BINM_APROPOS}
+BINM_MAN	= ${BINM_MAN}
+BINM_WHATIS	= ${BINM_WHATIS}
+BINM_MAKEWHATIS	= ${BINM_MAKEWHATIS}
+MANM_MAN	= ${MANM_MAN}
+MANM_MDOC	= ${MANM_MDOC}
+MANM_ROFF	= ${MANM_ROFF}
+MANM_EQN	= ${MANM_EQN}
+MANM_TBL	= ${MANM_TBL}
 INSTALL		= ${INSTALL}
 INSTALL_PROGRAM	= ${INSTALL_PROGRAM}
 INSTALL_LIB	= ${INSTALL_LIB}
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile,v
retrieving revision 1.452
retrieving revision 1.453
diff -LMakefile -LMakefile -u -p -r1.452 -r1.453
--- Makefile
+++ Makefile
@@ -314,8 +314,12 @@ base-install: base-build
 	$(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
 	$(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \
 		mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3
-	$(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 \
-		$(DESTDIR)$(MANDIR)/man7
+	$(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7
+	$(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MDOC}.7
+	$(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/${MANM_ROFF}.7
+	$(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/${MANM_EQN}.7
+	$(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/${MANM_TBL}.7
+	$(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
 	$(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR)
 
 db-install: base-build
@@ -325,16 +329,19 @@ db-install: base-build
 	mkdir -p $(DESTDIR)$(MANDIR)/man3
 	mkdir -p $(DESTDIR)$(MANDIR)/man5
 	mkdir -p $(DESTDIR)$(MANDIR)/man8
-	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/apropos
-	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/man
-	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/whatis
-	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(SBINDIR)/makewhatis
-	$(INSTALL_MAN) apropos.1 man.1 $(DESTDIR)$(MANDIR)/man1
-	ln -f $(DESTDIR)$(MANDIR)/man1/apropos.1 \
-		$(DESTDIR)$(MANDIR)/man1/whatis.1
+	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS)
+	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN)
+	ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS)
+	ln -f $(DESTDIR)$(BINDIR)/mandoc \
+		$(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS)
+	$(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1
+	$(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1
+	ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \
+		$(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1
 	$(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3
 	$(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5
-	$(INSTALL_MAN) makewhatis.8 $(DESTDIR)$(MANDIR)/man8
+	$(INSTALL_MAN) makewhatis.8 \
+		$(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
 
 cgi-install: cgi-build
 	mkdir -p $(DESTDIR)$(CGIBINDIR)
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-09  9:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-09  9:14 mdocml: Support choosing alternative binary and manual names from schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).