gnu: Add python-pamela.

* gnu/packages/linux.scm (python-pamela): New variable.
This commit is contained in:
Efraim Flashner 2020-08-09 15:45:33 +03:00
parent 5e5c695dea
commit e8f0433170
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -1332,6 +1332,49 @@ (define-public linux-pam-1.2
"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.