guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: gnu: Add python-pamela.


From: guix-commits
Subject: 03/03: gnu: Add python-pamela.
Date: Sun, 9 Aug 2020 08:48:40 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit e8f04331702ceacdc7484aea1b6f0e889762dfa2
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Aug 9 15:45:33 2020 +0300

    gnu: Add python-pamela.
    
    * gnu/packages/linux.scm (python-pamela): New variable.
---
 gnu/packages/linux.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 2f83801..f04cd99 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1332,6 +1332,49 @@ at login.  Local and dynamic reconfiguration are its key 
features.")
         "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
       (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
 
+(define-public python-pamela
+  (package
+    (name "python-pamela")
+    (version "1.0.0")
+    (source
+      (origin
+        ;; Tests not distributed in pypi release.
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/minrk/pamela.git";)
+               (commit version)))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:tests? #f ; Test suite isn't designed to be run inside a container.
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'hardcode-pam.so
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((pam (assoc-ref inputs "linux-pam")))
+               (substitute* "pamela.py"
+                 (("find_library\\(\"pam\")")
+                  (string-append "'" pam "/lib/libpam.so'")))
+               #t)))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+               (if (file-exists? "test_pamela.py")
+                 (invoke "py.test" "--assert=plain" "test_pamela.py")
+                 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
+               #t))))))
+    (inputs
+     `(("linux-pam" ,linux-pam)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/minrk/pamela";)
+    (synopsis "PAM interface using ctypes")
+    (description "This package provides a PAM interface using @code{ctypes}.")
+    (license license:expat)))
+
 
 ;;;
 ;;; Miscellaneous.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]