All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Nicolas Iooss <nicolas.iooss@m4x.org>
Cc: selinux <selinux@tycho.nsa.gov>, Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH v4 01/15] libsepol: build: follow standard semantics for DESTDIR and PREFIX
Date: Wed, 31 Jan 2018 12:40:24 +0100	[thread overview]
Message-ID: <20180131114024.GA13531@gmail.com> (raw)
In-Reply-To: <CAJfZ7=nnXg_gNqzFR1Oh7Mkr2c7Ut2Wm4Ao-ap8s5zTdcyNwHg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4356 bytes --]

On Wed, Jan 24, 2018 at 10:29:07PM +0100, Nicolas Iooss wrote:
> On Wed, Jan 24, 2018 at 10:27 AM, Marcus Folkesson
> <marcus.folkesson@gmail.com> wrote:
> > This patch solves the following issues:
> > - The pkg-config files generates odd paths when using DESTDIR without PREFIX
> > - DESTDIR is needed during compile time to compute library and header paths which it should not.
> > - Installing with both DESTDIR and PREFIX set gives us odd paths
> > - Make usage of DESTDIR and PREFIX more standard
> >
> > Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> > ---
> >  README                      | 2 +-
> >  libsepol/include/Makefile   | 4 ++--
> >  libsepol/man/Makefile       | 5 +++--
> >  libsepol/src/Makefile       | 7 +++----
> >  libsepol/src/libsepol.pc.in | 2 +-
> >  libsepol/utils/Makefile     | 4 ++--
> >  6 files changed, 12 insertions(+), 12 deletions(-)
> >
> > diff --git a/README b/README
> > index 7fc7b17b..174551a1 100644
> > --- a/README
> > +++ b/README
> > @@ -19,6 +19,6 @@ lacks library functions or other dependencies relied upon by your
> >  distribution.  If it breaks, you get to keep both pieces.
> >
> >  To install libsepol on macOS (mainly for policy analysis):
> > -cd libsepol; make DESTDIR=/usr/local PREFIX=/usr/local install
> > +cd libsepol; make PREFIX=/usr/local install
> >
> >  This requires GNU coreutils (brew install coreutils).
> > diff --git a/libsepol/include/Makefile b/libsepol/include/Makefile
> > index 56b7a114..ad5c34a4 100644
> > --- a/libsepol/include/Makefile
> > +++ b/libsepol/include/Makefile
> > @@ -1,6 +1,6 @@
> >  # Installation directories.
> > -PREFIX ?= $(DESTDIR)/usr
> > -INCDIR ?= $(PREFIX)/include/sepol
> > +PREFIX ?= /usr
> > +INCDIR = $(DESTDIR)$(PREFIX)/include/sepol
> >  CILDIR ?= ../cil
> >
> >  all:
> > diff --git a/libsepol/man/Makefile b/libsepol/man/Makefile
> > index 11924334..4f3d9fa2 100644
> > --- a/libsepol/man/Makefile
> > +++ b/libsepol/man/Makefile
> > @@ -1,6 +1,7 @@
> >  # Installation directories.
> > -MAN8DIR ?= $(DESTDIR)/usr/share/man/man8
> > -MAN3DIR ?= $(DESTDIR)/usr/share/man/man3
> > +PREFIX ?= /usr
> > +MAN8DIR ?= $(DESTDIR)$(PREFIX)/share/man/man8
> > +MAN3DIR ?= $(DESTDIR)$(PREFIX)/share/man/man3
> >
> >  all:
> >
> > diff --git a/libsepol/src/Makefile b/libsepol/src/Makefile
> > index 819d261b..d158398f 100644
> > --- a/libsepol/src/Makefile
> > +++ b/libsepol/src/Makefile
> > @@ -1,10 +1,9 @@
> >  # Installation directories.
> > -PREFIX ?= $(DESTDIR)/usr
> > +PREFIX ?= /usr
> >  INCLUDEDIR ?= $(PREFIX)/include
> > -LIBDIR ?= $(PREFIX)/lib
> > +LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
> >  SHLIBDIR ?= $(DESTDIR)/lib
> >  RANLIB ?= ranlib
> > -LIBBASE ?= $(shell basename $(LIBDIR))
> >  CILDIR ?= ../cil
> >
> >  VERSION = $(shell cat ../VERSION)
> > @@ -52,7 +51,7 @@ $(LIBSO): $(LOBJS) $(LIBMAP)
> >         ln -sf $@ $(TARGET)
> >
> >  $(LIBPC): $(LIBPC).in ../VERSION
> > -       sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
> > +       sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
> >
> >  $(LIBMAP): $(LIBMAP).in
> >  ifneq ($(DISABLE_CIL),y)
> > diff --git a/libsepol/src/libsepol.pc.in b/libsepol/src/libsepol.pc.in
> > index e52f5892..f807fec6 100644
> > --- a/libsepol/src/libsepol.pc.in
> > +++ b/libsepol/src/libsepol.pc.in
> > @@ -1,6 +1,6 @@
> >  prefix=@prefix@
> >  exec_prefix=${prefix}
> > -libdir=${exec_prefix}/@libdir@
> > +libdir=@libdir@
> >  includedir=@includedir@
> >
> >  Name: libsepol
> 
> So this patch results in producing libsepol.pc with the value of
> $(DESTDIR) in libdir (because "s:@libdir@:$(LIBDIR):" in the sed
> command, and "LIBDIR ?= $(DESTDIR)$(PREFIX)/lib" in the Makefile). Is
> this intended? I supposed the point of these patches was to craft
> pkg-config files without references to $(DESTDIR), like the first
> version of this patch did. What did I miss?
> 

This is a regression between v2 and v3 I think.
Maybe we should remove DESTDIR from all variables and only use it in the
install target.

e.g.
SHLIBDIR ?= /lib
...
install:
	install -m 755 $(LIBSO) $(DESTDIR)$(SHLIBDIR)


> Best,
> Nicolas
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-01-31 11:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  9:27 Rework of Makefiles Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 01/15] libsepol: build: follow standard semantics for DESTDIR and PREFIX Marcus Folkesson
2018-01-24 21:29   ` Nicolas Iooss
2018-01-31 11:40     ` Marcus Folkesson [this message]
2018-01-24  9:27 ` [PATCH v4 02/15] libselinux: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 03/15] libsemanage: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 04/15] checkpolicy: " Marcus Folkesson
2018-01-24 22:04   ` Nicolas Iooss
2018-01-31 11:58     ` Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 05/15] gui: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 06/15] mcstrans: " Marcus Folkesson
2018-01-24 21:48   ` Nicolas Iooss
2018-01-31 11:43     ` Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 07/15] policycoreutils: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 08/15] python: " Marcus Folkesson
2018-01-24 22:06   ` Nicolas Iooss
2018-01-24  9:27 ` [PATCH v4 09/15] python: build: move modules from platform-specific to platform-shared Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 10/15] restorecond: build: follow standard semantics for DESTDIR and PREFIX Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 11/15] sandbox: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 12/15] secilc: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 13/15] semodule-utils: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 14/15] dbus: " Marcus Folkesson
2018-01-24  9:27 ` [PATCH v4 15/15] build: setup buildpaths if DESTDIR is specified Marcus Folkesson

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=20180131114024.GA13531@gmail.com \
    --to=marcus.folkesson@gmail.com \
    --cc=nicolas.iooss@m4x.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.