diff mbox series

[bug#59336,2/6] gnu: Add apparmor.

Message ID y76h6yxpmpz.wl-hako@ultrarare.space
State New
Headers show
Series gnu: Add apparmor. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success
cbaines/issue success View issue

Commit Message

Hilton Chain Nov. 17, 2022, 4:30 p.m. UTC
* gnu/packages/apparmor.scm (apparmor): New variable.
---
 gnu/packages/apparmor.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/apparmor.scm b/gnu/packages/apparmor.scm
index 8cb4c7e94d..742414e18b 100644
--- a/gnu/packages/apparmor.scm
+++ b/gnu/packages/apparmor.scm
@@ -88,3 +88,40 @@  (define-public libapparmor
 the mainline Linux kernel since version 2.6.36 and its development has been
 supported by Canonical since 2009.")
     (license license:lgpl2.1)))
+
+(define-public apparmor
+  (package
+    (inherit libapparmor)
+    (name "apparmor")
+    (arguments
+     (list #:make-flags
+           #~(list (string-append "CC=" #$(cc-for-target))
+                   (string-append "DESTDIR=" #$output)
+                   "USE_SYSTEM=1")
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (add-after 'unpack 'fix-makefile-paths
+                 (lambda _
+                   (for-each patch-shebang
+                             '("common/list_af_names.sh"
+                               "common/list_capabilities.sh"))
+                   (for-each (lambda (file)
+                               (substitute* file
+                                 (("/usr/bin/\\<(pod2man|pod2html|prove)\\>" all cmd) cmd)
+                                 (("/usr") "")))
+                             '("common/Make-po.rules"
+                               "common/Make.rules"
+                               "binutils/Makefile"
+                               "parser/Makefile"
+                               "parser/tst/Makefile"
+                               "profiles/Makefile"
+                               "utils/Makefile"
+                               "utils/python-tools-setup.py"
+                               "utils/vim/Makefile"))))
+               (add-after 'fix-makefile-paths 'change-directory
+                 (lambda _
+                   (chdir "binutils"))))))
+    (native-inputs (list gettext-minimal perl which))
+    (inputs (list libapparmor))
+    (license license:gpl2)))