From patchwork Mon Jul 3 12:44:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 783455 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x1RhJ2SkLz9rxm for ; Mon, 3 Jul 2017 22:46:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B26533013F; Mon, 3 Jul 2017 12:45:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CuO+8wRyexxL; Mon, 3 Jul 2017 12:45:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id CF3D630124; Mon, 3 Jul 2017 12:45:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A93C51C409D for ; Mon, 3 Jul 2017 12:45:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A4EDD85BEE for ; Mon, 3 Jul 2017 12:45:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4gv0YRk0HbMD for ; Mon, 3 Jul 2017 12:45:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by whitealder.osuosl.org (Postfix) with ESMTPS id EB0EA86771 for ; Mon, 3 Jul 2017 12:45:47 +0000 (UTC) Received: from vandecaa-laptop.bzh.lan (10.3.7.11) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Mon, 3 Jul 2017 14:45:04 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Mon, 3 Jul 2017 14:44:56 +0200 Message-ID: <20170703124502.26113-3-arnout@mind.be> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170703124502.26113-1-arnout@mind.be> References: <20170703124502.26113-1-arnout@mind.be> MIME-Version: 1.0 X-Originating-IP: [10.3.7.11] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Subject: [Buildroot] [PATCH 2/8] libsepol: rework host installation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" libsepol has a pretty peculiar interpretation of DESTDIR and PREFIX. PREFIX is not consistently used: some installation paths are forced to $(DESTDIR)/usr/... . Also, the shared lib symlink is forced to ../../lib (i.e. assumes it's installed under /usr). For these reasons, the host build and install commands are a bit unusual: they use DESTDIR instead of PREFIX, DESTDIR points to $(HOST_DIR) without /usr, and some additional fixup is needed to correct the installation directory of libsepol.so.1 and the symlink to it. This can be simplified quite a lot by passing both DESTDIR and PREFIX, and including the /usr part in both. The symlink still has to be fixed, but that's much simpler. Note that a side effect is that the man pages are now installed under $(HOST_DIR)/usr/usr/man. While not very nice, we don't really care about man pages. In addition, this will resolve itself when we later move $(HOST_DIR)/usr to $(HOST_DIR). Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- It's a bit counter-intuitive to have a patch that adds /usr in a series that is meant to remove it, but this is the simplest way to have a bisectable series... --- package/libsepol/libsepol.mk | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/package/libsepol/libsepol.mk b/package/libsepol/libsepol.mk index 9bdac1e0da..d360bfbcb1 100644 --- a/package/libsepol/libsepol.mk +++ b/package/libsepol/libsepol.mk @@ -33,15 +33,18 @@ define LIBSEPOL_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install $(LIBSEPOL_MAKE_FLAGS) DESTDIR=$(TARGET_DIR) endef +HOST_LIBSEPOL_MAKE_ENV = \ + $(HOST_MAKE_ENV) \ + DESTDIR=$(HOST_DIR)/usr \ + PREFIX=$(HOST_DIR)/usr + define HOST_LIBSEPOL_BUILD_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CONFIGURE_OPTS) DESTDIR=$(HOST_DIR) + $(HOST_LIBSEPOL_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CONFIGURE_OPTS) endef define HOST_LIBSEPOL_INSTALL_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install $(HOST_CONFIGURE_OPTS) DESTDIR=$(HOST_DIR) - mv $(HOST_DIR)/lib/libsepol.so.1 $(HOST_DIR)/usr/lib - (cd $(HOST_DIR)/usr/lib; rm -f libsepol.so; ln -s libsepol.so.1 libsepol.so) - -rmdir $(HOST_DIR)/lib + $(HOST_LIBSEPOL_MAKE_ENV) $(MAKE) -C $(@D) install $(HOST_CONFIGURE_OPTS) + ln -sf libsepol.so.1 $(HOST_DIR)/usr/lib/libsepol.so endef $(eval $(generic-package))