diff mbox series

multipath-tools: set usr_prefix to /usr in default configuration

Message ID 20231113140826.15399-1-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: set usr_prefix to /usr in default configuration | expand

Commit Message

Martin Wilck Nov. 13, 2023, 2:08 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

In the default configuration (both prefix and usr_prefix unset),
we'd install man pages and headers under /share/man and /include,
respectively, which is very unusual. Have usr_prefix default to
/usr in (the default) case where prefix is empty, and set it equal
to /prefix otherwise.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---

This is submitted as an alternative approach to Ben Marzinski's
late patch set "Makefile cleanups."

---
 Makefile.inc | 2 +-
 README.md    | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

Comments

Benjamin Marzinski Nov. 16, 2023, 5:14 p.m. UTC | #1
On Mon, Nov 13, 2023 at 03:08:26PM +0100, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> In the default configuration (both prefix and usr_prefix unset),
> we'd install man pages and headers under /share/man and /include,
> respectively, which is very unusual. Have usr_prefix default to
> /usr in (the default) case where prefix is empty, and set it equal
> to /prefix otherwise.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
> 
> This is submitted as an alternative approach to Ben Marzinski's
> late patch set "Makefile cleanups."
> 
> ---
>  Makefile.inc | 2 +-
>  README.md    | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile.inc b/Makefile.inc
> index a20e2ce..6b45430 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -36,7 +36,7 @@ prefix		:=
>  # Prefix for binaries
>  exec_prefix	:= $(prefix)
>  # Prefix for non-essential libraries (libdmmp)
> -usr_prefix	:= $(prefix)
> +usr_prefix	:= $(if $(prefix),$(prefix),/usr)
>  # Prefix for configfuration files (multipath.conf)
>  etc_prefix	:= $(prefix)
>  # Where to install systemd-related files. systemd is usually installed under /usr
> diff --git a/README.md b/README.md
> index db03a33..d4f35f5 100644
> --- a/README.md
> +++ b/README.md
> @@ -131,8 +131,7 @@ The following variables can be passed to the `make` command line:
>     "Usr-merged" distributions[^systemd] may want to set this to `/usr`. The
>     default is empty (`""`).
>   * `usr_prefix`: where to install those parts of the code that aren't necessary
> -   for booting. Non-usr-merged distributions[^systemd] may want to set this to
> -   `/usr`. The default is `$(prefix)`.
> +   for booting. The default is `/usr` if `$(prefix)` is empty, and `$(prefix)` otherwise.
>   * `systemd_prefix`: Prefix for systemd-related files[^systemd]. The default is `/usr`.
>   * `etc_prefix`: The prefix for configuration files. "usr-merged"
>     distributions with immutable `/usr`[^systemd] may want to set this to
> -- 
> 2.42.1
diff mbox series

Patch

diff --git a/Makefile.inc b/Makefile.inc
index a20e2ce..6b45430 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -36,7 +36,7 @@  prefix		:=
 # Prefix for binaries
 exec_prefix	:= $(prefix)
 # Prefix for non-essential libraries (libdmmp)
-usr_prefix	:= $(prefix)
+usr_prefix	:= $(if $(prefix),$(prefix),/usr)
 # Prefix for configfuration files (multipath.conf)
 etc_prefix	:= $(prefix)
 # Where to install systemd-related files. systemd is usually installed under /usr
diff --git a/README.md b/README.md
index db03a33..d4f35f5 100644
--- a/README.md
+++ b/README.md
@@ -131,8 +131,7 @@  The following variables can be passed to the `make` command line:
    "Usr-merged" distributions[^systemd] may want to set this to `/usr`. The
    default is empty (`""`).
  * `usr_prefix`: where to install those parts of the code that aren't necessary
-   for booting. Non-usr-merged distributions[^systemd] may want to set this to
-   `/usr`. The default is `$(prefix)`.
+   for booting. The default is `/usr` if `$(prefix)` is empty, and `$(prefix)` otherwise.
  * `systemd_prefix`: Prefix for systemd-related files[^systemd]. The default is `/usr`.
  * `etc_prefix`: The prefix for configuration files. "usr-merged"
    distributions with immutable `/usr`[^systemd] may want to set this to