@@ -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)))