Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 35/36] policycoreutils: rework host installation
Date: Wed, 5 Jul 2017 13:14:52 +0200	[thread overview]
Message-ID: <20170705111453.2284-36-arnout@mind.be> (raw)
In-Reply-To: <20170705111453.2284-1-arnout@mind.be>

policycoreutils has a pretty peculiar interpretation of DESTDIR and
PREFIX.  PREFIX is not consistently used: some installation paths and
include paths are forced to $(DESTDIR)/usr/... . In other cases,
PREFIX is indeed used. PREFIX defaults to $(DESTDIR)/usr

Try to be a little bit more correct by passing both DESTDIR and PREFIX,
both set to $(HOST_DIR). This is not a complete fix: some things are
still installed in $(HOST_DIR)/usr - but nothing we care about (just
manpages, systemd services, ...). More importantly, however, it still
looks for e.g. D-Bus in $(DESTDIR)/usr/include/dbus-1.0.

Still, it's better than nothing.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/policycoreutils/policycoreutils.mk | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/package/policycoreutils/policycoreutils.mk b/package/policycoreutils/policycoreutils.mk
index 480fd6e09d..6fec4afb25 100644
--- a/package/policycoreutils/policycoreutils.mk
+++ b/package/policycoreutils/policycoreutils.mk
@@ -87,13 +87,18 @@ HOST_POLICYCOREUTILS_DEPENDENCIES = \
 # Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h
 # large file support.
 # See https://bugzilla.redhat.com/show_bug.cgi?id=574992 for more information
+# We need to pass DESTDIR at build time because it's used by
+# policycoreutils build system to find headers and libraries.
+# We also need to pass PREFIX because it defaults to $(DESTDIR)/usr
 HOST_POLICYCOREUTILS_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	CFLAGS="$(HOST_CFLAGS) -U_FILE_OFFSET_BITS" \
 	CPPFLAGS="$(HOST_CPPFLAGS) -U_FILE_OFFSET_BITS" \
 	PYTHON="$(HOST_DIR)/bin/python" \
 	PYTHON_INSTALL_ARGS="$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS)" \
-	ARCH="$(HOSTARCH)"
+	ARCH="$(HOSTARCH)" \
+	DESTDIR=$(HOST_DIR) \
+	PREFIX=$(HOST_DIR)
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 HOST_POLICYCOREUTILS_DEPENDENCIES += host-python3
@@ -112,19 +117,15 @@ HOST_POLICYCOREUTILS_MAKE_DIRS = \
 	semodule_package setfiles restorecond \
 	audit2allow scripts semanage sepolicy
 
-# We need to pass DESTDIR at build time because it's used by
-# policycoreutils build system to find headers and libraries.
 define HOST_POLICYCOREUTILS_BUILD_CMDS
 	$(foreach d,$(HOST_POLICYCOREUTILS_MAKE_DIRS),
-		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) \
-			DESTDIR=$(HOST_DIR) all
+		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) all
 	)
 endef
 
 define HOST_POLICYCOREUTILS_INSTALL_CMDS
 	$(foreach d,$(HOST_POLICYCOREUTILS_MAKE_DIRS),
-		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) \
-			DESTDIR=$(HOST_DIR) install
+		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) install
 	)
 	# Fix python paths
 	$(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/audit2allow
-- 
2.13.2

  parent reply	other threads:[~2017-07-05 11:14 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05 11:14 [Buildroot] [PATCH v4 00/36] Remove /usr component from HOST_DIR (continued) Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 01/36] generic packages: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 02/36] Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/bin Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 03/36] Globally replace $(HOST_DIR)/usr/sbin with $(HOST_DIR)/sbin Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 04/36] Globally replace $(HOST_DIR)/usr/lib with $(HOST_DIR)/lib Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 05/36] Globally replace $(HOST_DIR)/usr/include with $(HOST_DIR)/include Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 06/36] Globally replace $(HOST_DIR)/usr/share with $(HOST_DIR)/share Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 07/36] Globally replace $(HOST_DIR)/usr with $(HOST_DIR) Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 08/36] qt: fix up alignment after mechanical replacement Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 09/36] boards: replace $HOST_DIR/usr/ with $HOST_DIR/ in scripts Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 10/36] chromebook snow: remove $(HOST_DIR)/usr reference from README Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 11/36] warpboard: " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 12/36] stm32f429-disco: replace $HOST_DIR/usr with $HOST_DIR in flash script Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 13/36] stm32f469-disco: " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 14/36] eclipse-register-toolchain: toolchain is no longer installed in $(HOST_DIR)/usr Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 15/36] manual: remove references to host/usr paths Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 16/36] grub2: remove host/usr reference from help text Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 17/36] lttng-tools: " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 18/36] mfgtools: remove host/usr reference from readme.txt Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 19/36] lesstif: remove host/usr reference from .mk comment Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 20/36] board/gdb/bfin-bf512: remove host/usr reference from readme.txt Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 21/36] board/csky: " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 22/36] libffi: avoid $(HOST_DIR)/usr while moving headers Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 23/36] genromfs: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 24/36] libcap: use $(HOST_DIR) as prefix instead of DESTDIR Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 25/36] lzip: " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 26/36] opkg-utils: use $(HOST_DIR) as PREFIX " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 27/36] raspberrypi-usbboot: remove /usr from DESTDIR-based install commands Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 28/36] dos2unix: use prefix instead of DESTDIR for host installation Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 29/36] imx-uxb-loader: " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 30/36] grub2: install in $(HOST_DIR) instead of $(HOST_DIR)/usr Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 31/36] sepolgen: strip /usr/ part from HOST_DIR Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 32/36] libsemanage: rework host installation Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 33/36] libselinux: " Arnout Vandecappelle
2017-07-05 11:14 ` [Buildroot] [PATCH v4 34/36] checkpolicy: " Arnout Vandecappelle
2017-07-05 11:14 ` Arnout Vandecappelle [this message]
2017-07-05 11:14 ` [Buildroot] [PATCH v4 36/36] execline: remove --shebangdir configure option Arnout Vandecappelle
2017-07-05 14:31 ` [Buildroot] [PATCH v4 00/36] Remove /usr component from HOST_DIR (continued) Thomas Petazzoni

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=20170705111453.2284-36-arnout@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /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