tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Michael Stapelberg <stapelberg@debian.org>
Cc: tech@mdocml.bsd.lv, "Dr. Markus Waldeck" <waldeck@gmx.de>
Subject: Re: mandoc-1.14.1 released
Date: Sat, 4 Mar 2017 17:55:46 +0100	[thread overview]
Message-ID: <20170304165546.GC24622@athene.usta.de> (raw)
In-Reply-To: <CANnVG6kGLbHdLo+V0AWhOBVLyJub__cM-LYc5n8Sctc1Lp_H9g@mail.gmail.com>

Hi Michael,

Michael Stapelberg wrote on Mon, Feb 27, 2017 at 09:55:58PM +0100:

> Only afterwards I realized that the relative
> symlink technique also needs to be applied to the remaining symlinks, i.e.
> not only for manpages but also for programs such as makewhatis:
> 
> https://anonscm.debian.org/git/collab-maint/mdocml.git/commit/?id=1f60c369afdf849168b7f11c0a5188f16be2817c

It's not as simple as that.  With you patch, makewhatis ends up in the
wrong directory, in /bin/ rather than in /sbin/ where it belongs.

To fix that, i considered writing sh(1) code in ./configure to parse
both paths and construct a relative one from one to the other, using
tools like dirname(1), basename(1), readlink(1), wc(1), cut(1), ...

But then i realized that's probably a bad idea.  It is complicated
and can cause portability issues, and it's just not worth it.  In
almost any sane configuration, the basename(1) of BINDIR will be
"bin", and BINDIR and SBINDIR will be located in the same parent
directory.  If that is not the case is some very unusual configuration,
i decided to tell people to specify BIN_FROM_SBIN together with
BINDIR and SBINDIR - it's rarely needed and easier to do for a human
than for a POSIX shell.

Thanks to both of you for reporting the issue!

Yours,
  Ingo


Log Message:
-----------
Debian needs relative symlinks not only for manual pages,
but also for program files.
Issue reported by Michael <Stapelberg at debian dot org>
and by Markus <Waldeck at gmx dot de>.

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

Revision Data
-------------
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.61
retrieving revision 1.62
diff -Lconfigure -Lconfigure -u -p -r1.61 -r1.62
--- configure
+++ configure
@@ -91,6 +91,7 @@ HAVE_WCHAR=
 PREFIX="/usr/local"
 BINDIR=
 SBINDIR=
+BIN_FROM_SBIN=
 INCLUDEDIR=
 LIBDIR=
 MANDIR=
@@ -458,14 +459,15 @@ echo "config.h: written" 1>&3
 
 exec > Makefile.local
 
-[ -z "${BINDIR}"     ] && BINDIR="${PREFIX}/bin"
-[ -z "${SBINDIR}"    ] && SBINDIR="${PREFIX}/sbin"
-[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${PREFIX}/include/mandoc"
-[ -z "${LIBDIR}"     ] && LIBDIR="${PREFIX}/lib/mandoc"
-[ -z "${MANDIR}"     ] && MANDIR="${PREFIX}/man"
+[ -z "${BINDIR}"          ] && BINDIR="${PREFIX}/bin"
+[ -z "${SBINDIR}"         ] && SBINDIR="${PREFIX}/sbin"
+[ -z "${BIN_FROM_SBIN}"   ] && BIN_FROM_SBIN="../bin"
+[ -z "${INCLUDEDIR}"      ] && INCLUDEDIR="${PREFIX}/include/mandoc"
+[ -z "${LIBDIR}"          ] && LIBDIR="${PREFIX}/lib/mandoc"
+[ -z "${MANDIR}"          ] && MANDIR="${PREFIX}/man"
 
-[ -z "${HTDOCDIR}"   ] && HTDOCDIR="${WWWPREFIX}/htdocs"
-[ -z "${CGIBINDIR}"  ] && CGIBINDIR="${WWWPREFIX}/cgi-bin"
+[ -z "${HTDOCDIR}"        ] && HTDOCDIR="${WWWPREFIX}/htdocs"
+[ -z "${CGIBINDIR}"       ] && CGIBINDIR="${WWWPREFIX}/cgi-bin"
 
 [ -z "${INSTALL_PROGRAM}" ] && INSTALL_PROGRAM="${INSTALL} -m 0555"
 [ -z "${INSTALL_LIB}"     ] && INSTALL_LIB="${INSTALL} -m 0444"
@@ -493,6 +495,7 @@ STATIC		= ${STATIC}
 PREFIX		= ${PREFIX}
 BINDIR		= ${BINDIR}
 SBINDIR		= ${SBINDIR}
+BIN_FROM_SBIN	= ${BIN_FROM_SBIN}
 INCLUDEDIR	= ${INCLUDEDIR}
 LIBDIR		= ${LIBDIR}
 MANDIR		= ${MANDIR}
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.29 -r1.30
--- configure.local.example
+++ configure.local.example
@@ -85,6 +85,13 @@ BINDIR="${PREFIX}/bin"
 SBINDIR="${PREFIX}/sbin"
 MANDIR="${PREFIX}/man"
 
+# If BINDIR and SBINDIR are not subdirectories of the same parent
+# directory or if the basename(1) of BINDIR differs from "bin",
+# the relative path from SBINDIR to BINDIR is also needed.
+# The default is:
+
+BIN_FROM_SBIN="../bin"
+
 # 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.
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile,v
retrieving revision 1.506
retrieving revision 1.507
diff -LMakefile -LMakefile -u -p -r1.506 -r1.507
--- Makefile
+++ Makefile
@@ -389,11 +389,11 @@ base-install: mandoc demandoc soelim
 	mkdir -p $(DESTDIR)$(MANDIR)/man8
 	$(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR)
 	$(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM)
-	$(LN) $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN)
-	$(LN) $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS)
-	$(LN) $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS)
-	$(LN) $(DESTDIR)$(BINDIR)/mandoc \
-		$(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS)
+	cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_MAN)
+	cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_APROPOS)
+	cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_WHATIS)
+	cd $(DESTDIR)$(SBINDIR) && \
+		$(LN) ${BIN_FROM_SBIN}/mandoc $(BINM_MAKEWHATIS)
 	$(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
 	$(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1
 	$(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1
@@ -475,7 +475,7 @@ uninstall:
 	rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc_aux.h
 	rm -f $(DESTDIR)$(INCLUDEDIR)/mdoc.h
 	rm -f $(DESTDIR)$(INCLUDEDIR)/roff.h
-	rmdir $(DESTDIR)$(INCLUDEDIR)
+	[ ! -e $(DESTDIR)$(INCLUDEDIR) ] || rmdir $(DESTDIR)$(INCLUDEDIR)
 
 regress: all
 	cd regress && ./regress.pl
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2017-03-04 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170221023444.GB51369@athene.usta.de>
2017-02-21 21:12 ` Michael Stapelberg
2017-02-22  0:07   ` Ingo Schwarze
2017-02-27 20:55     ` Michael Stapelberg
2017-03-04 16:55       ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170304165546.GC24622@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=stapelberg@debian.org \
    --cc=tech@mdocml.bsd.lv \
    --cc=waldeck@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).