From patchwork Sun Oct 2 04:15:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Zaman X-Patchwork-Id: 9359557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7FAC46075E for ; Sun, 2 Oct 2016 04:18:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CC6528C44 for ; Sun, 2 Oct 2016 04:18:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B04428C59; Sun, 2 Oct 2016 04:18:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (smtp.nsa.gov [8.44.101.9]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7935828C44 for ; Sun, 2 Oct 2016 04:18:28 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.31,282,1473120000"; d="scan'208";a="19727799" IronPort-PHdr: =?us-ascii?q?9a23=3AX9uHWRO+OmU5f+Zw4Twl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KPjyrarrMEGX3/hxlliBBdydsKMezbCM+Pq7BCQp2tWoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09?= =?us-ascii?q?fr2zQd+IyZ7tnLrpptX6WEZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu?= =?us-ascii?q?5blitCLFOXmAvgtI/rpMYwuxlKv7od0+IIEeCjJ+VrBYBfWS8rN2Ez+d3DqQjI?= =?us-ascii?q?TQzJ4GAVFGoRjElmGQ/AuTPzRZD3+hnzs+N7kH2YNNbxS5gsVC6s7qFqTxmugy?= =?us-ascii?q?ACYW1quFrLg9B92foI6CmqoAZylsuNOIw=3D?= X-IPAS-Result: =?us-ascii?q?A2EDBwDRifBX/wHyM5BdHQEFAQsBgygVAQEBAQEeV3ymJgG?= =?us-ascii?q?UKCIDgXiFZEwBAQEBAQEBAQIBAlsngjIEAxMFeVs9AgEDAQIPKAYBAQwgDAIDC?= =?us-ascii?q?QEBFykICAMBLQMBBQELEQ4LBRgEAYgrAaEpgTI+MopWhTABAQWIJwgQhBiKexE?= =?us-ascii?q?BaIUSjzGKTIYniUxlgVWHHiWFc48qMYERVIMRgghlAYUoeIEoAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 02 Oct 2016 04:18:26 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u924INxC011758; Sun, 2 Oct 2016 00:18:24 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u924FXHF098260 for ; Sun, 2 Oct 2016 00:15:33 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u924FXYf011650 for ; Sun, 2 Oct 2016 00:15:33 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1DUBAC0iPBXesPAVdFdHQEFAQsBgygVAQEBAQF1fLZDhBUchgICgVhMAQIBAQEBAQITAQEJCxQZhRECAQMSLgEBNwEPUTQBBQEcGSKIKwGhKIEyPjKKVoUwAQEFh34BAQEBAQEEAgEcCBCEGIt1ggALgwePMYpMhieJTGWBVYcehhiPKjGBEYNlgghlAYdIAQEB X-IPAS-Result: A1DUBAC0iPBXesPAVdFdHQEFAQsBgygVAQEBAQF1fLZDhBUchgICgVhMAQIBAQEBAQITAQEJCxQZhRECAQMSLgEBNwEPUTQBBQEcGSKIKwGhKIEyPjKKVoUwAQEFh34BAQEBAQEEAgEcCBCEGIt1ggALgwePMYpMhieJTGWBVYcehhiPKjGBEYNlgghlAYdIAQEB X-IronPort-AV: E=Sophos;i="5.31,282,1473134400"; d="scan'208";a="5740541" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 02 Oct 2016 00:15:32 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AK2zEcxZdNsN1mVsT/aVdhuP/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpc++bnLW6fgltlLVR4KTs6sC0LuM9fq6EjZbvN6oizMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3Dwdp?= =?us-ascii?q?POO9QteU1JXtkbrosMeIPk1hv3mUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO?= =?us-ascii?q?9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVSqj+fqIlXZREHT8mNCYz/8Stuh7d?= =?us-ascii?q?HiWV4X5JcGwNlRwAMQHA5ReyCpX4qSz8nvJwwiebO8zxS/Y/XjH0vPQjcwPhlC?= =?us-ascii?q?pSb21xy2rQkMEl1K8=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0EABwA+ifBXesPAVdFdHgYMGBgNgmsVA?= =?us-ascii?q?QEBAQF1fKYnkByEFRyBeIQKAoFYTAEBAQEBAQEBAgECEAEBCQsUGS+CMhiBAFs?= =?us-ascii?q?9AgEDEi4BATcBD1E0AQUBHBkiiCsBoSiBMj4yilaFMAEBBYd+AQEBAQEBBAIBH?= =?us-ascii?q?AgQhBiLdYIAC4MHjzGKTIYniUxlgVWHHoYYjyoxgRGDZYIIZQGHSAEBAQ?= X-IPAS-Result: =?us-ascii?q?A0EABwA+ifBXesPAVdFdHgYMGBgNgmsVAQEBAQF1fKYnkBy?= =?us-ascii?q?EFRyBeIQKAoFYTAEBAQEBAQEBAgECEAEBCQsUGS+CMhiBAFs9AgEDEi4BATcBD?= =?us-ascii?q?1E0AQUBHBkiiCsBoSiBMj4yilaFMAEBBYd+AQEBAQEBBAIBHAgQhBiLdYIAC4M?= =?us-ascii?q?HjzGKTIYniUxlgVWHHoYYjyoxgRGDZYIIZQGHSAEBAQ?= X-IronPort-AV: E=Sophos;i="5.31,282,1473120000"; d="scan'208";a="18181756" Received: from mail-pf0-f195.google.com ([209.85.192.195]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 02 Oct 2016 04:15:27 +0000 Received: by mail-pf0-f195.google.com with SMTP id i85so313271pfa.0 for ; Sat, 01 Oct 2016 21:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perfinion-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LbDHiIHHwtXRrhYknspVPixRM4c88USWDKk/2cIytZc=; b=UjzDuiUBujit+dsp4a+B67/PKX463oDUapa6i2xDQlmUbS+lJ26pTifXd9i7Q4GnUl J8o2qKaehZqyEzfe/3Ehsr0ijUizBipGckTkvV7NB5xWyhxyKANNYyMuZZZUJqsv1v9Z lbeTEzgCzcNtdQtO/UUV5nCk3GomViEIy2wz5k6UPa+vD0d7Hot77qtHH1VBZnhZRfD7 +Rtu04Is8GN4D5YwBe3v04jL741AeZ/JLpAJ3Bv9MrmwlzwiXRj++MC52JO7QlDxjs9s 8xKuOcZqvrI+vjt85wOcieK6USUb82+5oq7iX/O4/veYAXc2cYrGZB5mxLdUm0gFwg8C FvNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LbDHiIHHwtXRrhYknspVPixRM4c88USWDKk/2cIytZc=; b=dkvvkx9a6gdlyMr8XPp0aKx2NAq5E3dWUxPssyYsPncrvYuPplJt9D5qm8+EUPUCF/ y35mMBCqmz1UdO7hqpIh87Zr9FLZJEAsnGHkdW00pbcTrI1SaJfeLAiNsiYBDgKVXJ/Y kmecRJHIpqLvteFnuXrFWLvE/DdV8hjqO/wH6C+XjlPA3HZs+eNscbCCGO3Dp1q4gEmr eHbeef/2t1T9gPBOUcEancfHScq0tMm++3t5wxkK8Oka+HybNRYKoudP5ZRRfOUPk+5z 6VuX7YRUElRkBOHVzOQB1SW9MJPbktIrRwQ1mzQBAQDU6j/YCZovD1pZs3BaygnstYPn WcQg== X-Gm-Message-State: AA6/9RljM8AjYQXd8G/6Vy7B+QVd072JJp/10UZgfAnFKNQg23GxpsYcHPTR6BSDaJD3ww== X-Received: by 10.98.194.133 with SMTP id w5mr25566131pfk.42.1475381727087; Sat, 01 Oct 2016 21:15:27 -0700 (PDT) Received: from localhost ([2404:e800:e600:540:d867:f0:61d1:b38f]) by smtp.gmail.com with ESMTPSA id b88sm37801756pfe.66.2016.10.01.21.15.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Oct 2016 21:15:26 -0700 (PDT) From: Jason Zaman To: selinux@tycho.nsa.gov Subject: [PATCH 2/2] libselinux: query for python site-packages dir directly Date: Sun, 2 Oct 2016 12:15:14 +0800 Message-Id: <1475381714-9906-2-git-send-email-jason@perfinion.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1475381714-9906-1-git-send-email-jason@perfinion.com> References: <1475381714-9906-1-git-send-email-jason@perfinion.com> X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP instead of building the path manually which is more error prone Signed-off-by: Jason Zaman --- libselinux/src/Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index f9e3de1..13501cd 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -12,9 +12,8 @@ PREFIX ?= $(DESTDIR)/usr LIBDIR ?= $(PREFIX)/lib SHLIBDIR ?= $(DESTDIR)/lib INCLUDEDIR ?= $(PREFIX)/include -PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])') PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX)) -PYLIBDIR ?= $(LIBDIR)/$(PYLIBVER) +PYSITEDIR ?= $(DESTDIR)$(shell $(PYTHON) -c 'import site; print(site.getsitepackages()[0])') RUBYLIBVER ?= $(shell $(RUBY) -e 'print RUBY_VERSION.split(".")[0..1].join(".")') RUBYINC ?= $(shell $(PKG_CONFIG) --exists ruby-$(RUBYLIBVER) && $(PKG_CONFIG) --cflags ruby-$(RUBYLIBVER) || $(PKG_CONFIG) --cflags ruby) RUBYINSTALL ?= $(DESTDIR)$(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]') @@ -160,10 +159,10 @@ install: all ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET) install-pywrap: pywrap - test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux - install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/_selinux.so - install -m 755 $(AUDIT2WHYSO) $(PYLIBDIR)/site-packages/selinux/audit2why.so - install -m 644 $(SWIGPYOUT) $(PYLIBDIR)/site-packages/selinux/__init__.py + test -d $(PYSITEDIR)/selinux || install -m 755 -d $(PYSITEDIR)/selinux + install -m 755 $(SWIGSO) $(PYSITEDIR)/_selinux.so + install -m 755 $(AUDIT2WHYSO) $(PYSITEDIR)/selinux/audit2why.so + install -m 644 $(SWIGPYOUT) $(PYSITEDIR)/selinux/__init__.py install-rubywrap: rubywrap test -d $(RUBYINSTALL) || install -m 755 -d $(RUBYINSTALL)