From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 923424ad for ; Sat, 4 Mar 2017 11:55:49 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1ckCyA-00038T-Rd; Sat, 04 Mar 2017 17:55:48 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1ckCyA-0000ze-Fz; Sat, 04 Mar 2017 17:55:46 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1ckCyA-0002mf-AJ; Sat, 04 Mar 2017 17:55:46 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 9e8829fa; Sat, 4 Mar 2017 17:55:46 +0100 (CET) Date: Sat, 4 Mar 2017 17:55:46 +0100 From: Ingo Schwarze To: Michael Stapelberg Cc: tech@mdocml.bsd.lv, "Dr. Markus Waldeck" Subject: Re: mandoc-1.14.1 released Message-ID: <20170304165546.GC24622@athene.usta.de> References: <20170221023444.GB51369@athene.usta.de> <20170222000746.GC43745@athene.usta.de> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) 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 and by Markus . 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