From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0qcW-0006eD-7S for guix-patches@gnu.org; Wed, 19 Apr 2017 10:30:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0qcQ-00042L-Fr for guix-patches@gnu.org; Wed, 19 Apr 2017 10:30:12 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:58788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0qcQ-00042E-C7 for guix-patches@gnu.org; Wed, 19 Apr 2017 10:30:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d0qcQ-0001eN-6Y for guix-patches@gnu.org; Wed, 19 Apr 2017 10:30:06 -0400 Subject: bug#26561: [PATCH 6/9] gnu: Add python-sepolgen. Resent-Message-ID: From: Ricardo Wurmus Date: Wed, 19 Apr 2017 16:29:14 +0200 Message-Id: <20170419142918.11688-6-rekado@elephly.net> In-Reply-To: <20170419142918.11688-1-rekado@elephly.net> References: <20170419142918.11688-1-rekado@elephly.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26561@debbugs.gnu.org Cc: Ricardo Wurmus * gnu/packages/selinux.scm (python-sepolgen): New variable. --- gnu/packages/selinux.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gnu/packages/selinux.scm b/gnu/packages/selinux.scm index e73bc0ec6..8f3750daf 100644 --- a/gnu/packages/selinux.scm +++ b/gnu/packages/selinux.scm @@ -234,3 +234,55 @@ binary policies.") (description "The SELinux CIL compiler is a compiler that converts the @dfn{common intermediate language} (CIL) into a kernel binary policy file.") (license license:bsd-2))) + +(define-public python-sepolgen + (package (inherit libsepol) + (name "python-sepolgen") + (arguments + `(#:modules ((srfi srfi-1) + (guix build gnu-build-system) + (guix build utils)) + ,@(substitute-keyword-arguments (package-arguments libsepol) + ((#:phases phases) + `(modify-phases ,phases + (replace 'enter-dir + (lambda _ (chdir "sepolgen") #t)) + ;; By default all Python files would be installed to + ;; $out/gnu/store/...-python-.../, so we override the + ;; PACKAGEDIR to fix this. + (add-after 'enter-dir 'fix-target-path + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((get-python-version + ;; FIXME: copied from python-build-system + (lambda (python) + (let* ((version (last (string-split python #\-))) + (components (string-split version #\.)) + (major+minor (take components 2))) + (string-join major+minor "."))))) + (substitute* "src/sepolgen/Makefile" + (("^PACKAGEDIR.*") + (string-append "PACKAGEDIR=" + (assoc-ref outputs "out") + "/lib/python" + (get-python-version + (assoc-ref inputs "python")) + "/site-packages/sepolgen"))) + (substitute* "src/share/Makefile" + (("\\$\\(DESTDIR\\)") (assoc-ref outputs "out")))) + #t))))))) + (inputs + `(("python" ,python-wrapper))) + (native-inputs '()) + (synopsis "Python module for generating SELinux policies") + (description + "This package contains a Python module that forms the core of +@code{audit2allow}, a part of the package @code{policycoreutils}. The +sepolgen library contains: Reference Policy Representation, which are Objects +for representing policies and the reference policy interfaces. It has objects +and algorithms for representing access and sets of access in an abstract way +and searching that access. It also has a parser for reference policy +\"headers\". It contains infrastructure for parsing SELinux related messages +as produced by the audit system. It has facilities for generating policy +based on required access.") + ;; GPLv2 only + (license license:gpl2))) -- 2.12.2