[stgt] [PATCH] Make PREFIX, sbindir, sysconfdir, mandir and docdir configurable.

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Mon Oct 5 15:07:20 CEST 2009


On Mon,  5 Oct 2009 13:35:33 +0200
Florian Haas <florian.haas at linbit.com> wrote:

> Suggested by Chris Webb. May be helpful for users installing in
> non-default locations.
> 
> PREFIX defaults to /usr. sbindir, mandir and docdir are relative to
> $(PREFIX), whereas sysconfdir is not.
> ---
>  Makefile         |    7 +++++--
>  conf/Makefile    |    6 ++++--
>  doc/Makefile     |    4 ++--
>  scripts/Makefile |    6 ++++--
>  usr/Makefile     |    6 ++++--
>  5 files changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 56d4b10..dbdda22 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,10 +1,13 @@
>  VERSION ?= 0.9.9
>  
> +# Define a common prefix where binaries and docs install
> +PREFIX ?= /usr
> +
>  # This tarball is generated by "make tarball", see below
>  TARBALL = tgt-$(VERSION).tar.bz2
>  
> -# Export VERSION so sub-make knows about it
> -export VERSION
> +# Export VERSION and PREFIX so sub-make knows about them
> +export VERSION PREFIX
>  
>  # Export the feature switches so sub-make knows about them
>  export ISCSI ISCSI_RDMA IBMVIO FCOE FCP
> diff --git a/conf/Makefile b/conf/Makefile
> index dcfbcb3..4f5ae77 100644
> --- a/conf/Makefile
> +++ b/conf/Makefile
> @@ -1,10 +1,12 @@
> +sysconfdir ?= /etc
> +
>  .PHONY: all
>  all:
>  
>  .PHONY: install
>  install:
> -	install -d -m 755 $(DESTDIR)/etc/tgt
> -	install -m 644 targets.conf $(DESTDIR)/etc/tgt
> +	install -d -m 755 $(DESTDIR)$(sysconfdir)/tgt
> +	install -m 644 targets.conf $(DESTDIR)$(sysconfdir)/tgt
>  
>  .PHONY: clean
>  clean:
> diff --git a/doc/Makefile b/doc/Makefile
> index 6a08015..11652d9 100644
> --- a/doc/Makefile
> +++ b/doc/Makefile
> @@ -1,5 +1,5 @@
> -mandir = /usr/share/man
> -docdir = /usr/share/doc/tgt-$(VERSION)
> +mandir ?= $(PREFIX)/share/man
> +docdir ?= $(PREFIX)/share/doc/tgt-$(VERSION)

This can't be applied cleanly.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list