From: Alejandro Colomar <alx.manpages@gmail.com>
To: linux-man@vger.kernel.org,
"G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Alejandro Colomar <alx@kernel.org>, Marcos Fouces <marcos@debian.org>
Subject: Re: [PATCH] cmd.mk, install-man.mk: Allow installing link pages as symlinks
Date: Wed, 8 Mar 2023 02:08:22 +0100 [thread overview]
Message-ID: <55f938eb-8f96-213a-2b24-e505d97e629f@gmail.com> (raw)
In-Reply-To: <20230308010418.174517-1-alx@kernel.org>
[-- Attachment #1.1: Type: text/plain, Size: 2322 bytes --]
On 3/8/23 02:04, Alejandro Colomar wrote:
> We keep them as .so "includes" in our source code, but if some
> distribution wants to have them as symlinks in their filesystem, make it
> easy for them to install as such, by specifying 'LINK_PAGES=symlink'.
>
> Signed-off-by: Alejandro Colomar <alx@kernel.org>
> ---
>
> Hi!
>
> I'm going to add support for installing link pages as symlinks. Debian
> installs them this way, so I think it makes sense to help distributors
> use our upstream build system to install in their preferred way, since
> otherwise, to be more useful.
to be more useful, since otherwise, our build system is something that only
we find useful, but nobody really uses. :)
>
> Here's the implementation I came up with, but I'd like to hear comments
> about the interface (the LINK_PAGES variable). Would you make it
> different?
>
> Thanks!
>
> Alex
>
>
> lib/cmd.mk | 1 +
> lib/install-man.mk | 9 +++++++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/lib/cmd.mk b/lib/cmd.mk
> index 17f3a8ee5..9cd09fe89 100644
> --- a/lib/cmd.mk
> +++ b/lib/cmd.mk
> @@ -16,6 +16,7 @@ GREP := grep
> GZIP := gzip
> HEAD := head
> INSTALL := install
> +LN := ln
> LOCALE := locale
> PKG-CONFIG := pkg-config
> SED := sed
> diff --git a/lib/install-man.mk b/lib/install-man.mk
> index 174f503ca..aaa545290 100644
> --- a/lib/install-man.mk
> +++ b/lib/install-man.mk
> @@ -12,6 +12,9 @@ include $(srcdir)/lib/install.mk
> include $(srcdir)/lib/src.mk
>
>
> +LINK_PAGES := so # Alternatives: "so", "symlink"
> +
> +
> mandir := $(datarootdir)/man
> man1dir := $(mandir)/man1
> man2dir := $(mandir)/man2
> @@ -147,6 +150,12 @@ $(_manpages):
> -e '/^\.so /s, man7/\(.*\)\.7$$, $(notdir $(man7dir))/\1$(man7ext),' \
> -e '/^\.so /s, man8/\(.*\)\.8$$, $(notdir $(man8dir))/\1$(man8ext),' \
> $@
> +ifeq ($(LINK_PAGES),symlink)
> + if $(GREP) '^\.so ' <$@ >/dev/null; then \
> + $(SED) 's,^\.so \(.*\),../\1,' <$@ \
> + | $(XARGS) -I tgt $(LN) -fsT tgt $@; \
> + fi
> +endif
>
> $(_mandirs): %/.: | $$(dir %). $(_mandir)/.
>
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2023-03-08 1:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 1:04 [PATCH] cmd.mk, install-man.mk: Allow installing link pages as symlinks Alejandro Colomar
2023-03-08 1:08 ` Alejandro Colomar [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=55f938eb-8f96-213a-2b24-e505d97e629f@gmail.com \
--to=alx.manpages@gmail.com \
--cc=alx@kernel.org \
--cc=g.branden.robinson@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=marcos@debian.org \
/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