[PATCH] Add makepasswd package

  • Done
  • quality assurance status badge
Details
2 participants
  • Jean-Baptiste Note
  • Marius Bakke
Owner
unassigned
Submitted by
Jean-Baptiste Note
Severity
normal
J
J
Jean-Baptiste Note wrote on 2 May 2020 22:37
(name . guixpatch)(address . guix-patches@gnu.org)
87zhaq8453.fsf@m4x.org
Dear Guix maintainers,

Here is an attempt at packaging makepasswd, a run-time dependency of
x2go.

I've placed it in its own file which may be ill-advised for now; please
let me know where I could more sensibly move it.

Hopefully patches will follow that put more flesh in this x2go.scm file;
however I find this program useful in its own right.

Kind regards,
Jean-Baptiste
From f8c9c93e359f4f65a12709f244e6e8952db4bad9 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Note <jean-baptiste.note@m4x.org>
Date: Sat, 2 May 2020 05:50:20 +0000
Subject: [PATCH] x2go: Add makepasswd.

* gnu/packages/x2go.scm: New file.

* gnu/packages/xorg.scm (makepasswd): New variable.
---
gnu/packages/x2go.scm | 66 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100644 gnu/packages/x2go.scm

Toggle diff (74 lines)
diff --git a/gnu/packages/x2go.scm b/gnu/packages/x2go.scm
new file mode 100644
index 0000000000..b77f81cee5
--- /dev/null
+++ b/gnu/packages/x2go.scm
@@ -0,0 +1,66 @@
+;;; GNU Guix --- Functional package management for GNU
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages x2go)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix git-download)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix utils)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages tls)
+ #:use-module (gnu packages xml)
+ #:use-module (gnu packages docbook))
+
+(define-public makepasswd
+ (let ((commit "3545d57d3a589a392d7eb0df36a5286785345c9e")
+ (revision "1"))
+ (package
+ (name "makepasswd")
+ (version (git-version "0.5.4" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/khorben/makepasswd")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0lspqyyxbk6h28yxnp7pd5aib161vrkzgasam5jpzn35n1jacx2j"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("libxslt" ,libxslt)
+ ("libxml2" ,libxml2)
+ ("docbook-xsl" ,docbook-xsl)
+ ("docbook-xml" ,docbook-xml)))
+ (inputs
+ `(("openssl" ,openssl)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure))
+ #:make-flags (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
+ #:tests? #f))
+ (synopsis "Generate (pseudo-)random passwords and hashes")
+ (description
+ "Makepasswd is a program that generates pseudo-random passwords of a
+desired length. It can also generate their corresponding hashes for a given
+encryption algorithm if so desired.")
+ (home-page "https://github.com/khorben/makepasswd")
+ (license license:gpl3))))
--
2.26.2
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEPxcq3dp4FVY5UpckkC0pVsuz75YFAl6t2ggACgkQkC0pVsuz
75ZFdA//WCXQAgCf3aicYGV9PL5sUemGnRYyfA90UXPhenpj7UkT7ORpoHQ77y7D
C2RXhHQwla9VOfE2w+nVSdBw306FfIy3NLWlB/FLNirvaPGiFJNdPyPcbZG5fMxk
GrFDWc6Rg53lfWkLDmRdPVvihhz2OO/hzU0tJtyvaneL64dQVUB+4jC2XBv9Qtv9
LzvV8jrjnXFECtI4FLP2OmZ38WwbFbVld/FFxynwYzsd7Jj9MHwtPwUCVM08Udxp
j+7meBRfyVwOYQLLfY48voCUgz3WqOWGzvy8GR3z+2hleYzLVVvEANdCsNNJ0+Qx
F2sRw7AAC0gDmnsUn+Dml4B56JkznGW6e65RHie4cEelseKCd6EBrU1roufIbPOR
qxDHsixBaTotT/3e8AlS/zB1uJCoMKXP1+taudnc652HIqP+KQNdXEozHXw48p/k
3N76rzzrLHlXaFy/LQtmNA3X48uvZhmBkN2ePrdHK/iK5GIlaVm5c06NVaE2BOTQ
Fqb/QTRVtCeJppLzVJMt2yYib/djhfziddM5uZIdAugxMPPKuf6eVf/dv2g+JJh6
VIKn2/t/6jcjhlz6jbN4vofDd/J9FEqyW87dCY+imwwzfduTvVAaZu9uymlONM7+
YDuHRi4yvrZ4JbJ6e5s9QEQSZDiI2WNvMqOJCuQGlK0bPLhcmC8=
=nHio
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 5 May 2020 18:49
87bln2z5qg.fsf@devup.no
Jean-Baptiste Note <jean-baptiste.note@m4x.org> writes:

Toggle quote (8 lines)
> Dear Guix maintainers,
>
> Here is an attempt at packaging makepasswd, a run-time dependency of
> x2go.
>
> I've placed it in its own file which may be ill-advised for now; please
> let me know where I could more sensibly move it.

Perhaps password-utils.scm could work for this package?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl6xmTcACgkQoqBt8qM6
VPqduggA0VVGejw986/STKqYMo15Yi4Eh+uT2Icwzs5c8wdzfqN2r8GgnPrQHHQL
BYbBDnAy4e6QbPDb2NfxuYoVDSikddvm/2799kAliEqljBty2C7Uaq/tVH/j0mbL
nL1znCA7dM83+uTzEghAN+qJ/mm9Sk76cWaHOmPJXdH3Kay2JsRM1D3W5Kx4Cgf5
M5qnmvKwsekwDpQzzzXbYmArSjbC4icQ0YctwbbLvjv/FVdfQrSlQVAiyp0+TfU4
H9/LGnjTluaQTc0BhUeqyHB2rJCucAplNzo35xQSBb1Zu6fmOqVX1hgR7rdwpepR
bViiSfCj/RhL5OZVlMhbFPvSsC9D4Q==
=5w98
-----END PGP SIGNATURE-----

J
J
Jean-Baptiste Note wrote on 5 May 2020 20:47
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 41032@debbugs.gnu.org)
87zhamw75k.fsf@m4x.org
Hi Marius,

Thanks for your review and the heads up on the correct file.
Please find an updated patch.

I've used guix-devel-mode and ran indent-according-to-mode on the buffer
before producing the patch; let me know if this is not sufficient to
correctly indent the code :)

Kind regards,
Jean-Baptiste
From 3d8786e2b818e28e79fc62eb6872bea1400a1d24 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Note <jean-baptiste.note@m4x.org>
Date: Sat, 2 May 2020 05:50:20 +0000
Subject: [PATCH] gnu: Add makepasswd.

* gnu/packages/password-utils.scm (makepasswd): New variable.
---
gnu/packages/password-utils.scm | 39 +++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 2a570691a4..59c7befddc 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -61,6 +61,7 @@
#:use-module (gnu packages crypto)
#:use-module (gnu packages cryptsetup)
#:use-module (gnu packages curl)
+ #:use-module (gnu packages docbook)
#:use-module (gnu packages file)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gettext)
@@ -1168,3 +1169,41 @@ exhaustive mode to try every password given a charset or in dictionary mode to
try every password contained in a file.")
(home-page "https://github.com/glv2/bruteforce-luks")
(license license:gpl3+)))
+
+(define-public makepasswd
+ (let ((commit "3545d57d3a589a392d7eb0df36a5286785345c9e")
+ (revision "1"))
+ (package
+ (name "makepasswd")
+ (version (git-version "0.5.4" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/khorben/makepasswd")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0lspqyyxbk6h28yxnp7pd5aib161vrkzgasam5jpzn35n1jacx2j"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("libxslt" ,libxslt)
+ ("libxml2" ,libxml2)
+ ("docbook-xsl" ,docbook-xsl)
+ ("docbook-xml" ,docbook-xml)))
+ (inputs
+ `(("openssl" ,openssl)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure))
+ #:make-flags (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))
+ #:tests? #f))
+ (synopsis "Generate (pseudo-)random passwords and hashes")
+ (description
+ "Makepasswd is a program that generates pseudo-random passwords of a
+desired length. It can also generate their corresponding hashes for a given
+encryption algorithm if so desired.")
+ (home-page "https://github.com/khorben/makepasswd")
+ (license license:gpl3))))
--
2.26.2
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEPxcq3dp4FVY5UpckkC0pVsuz75YFAl6xtMcACgkQkC0pVsuz
75a8HA//T5fR3To8fvUYw4u4xfLX9NnGhNfZ87WeTm0Uv94Cw7Pz5ljG26mLTjLp
hFjAUDkdQIecE/5yjRCmb0upKLicVnsoLGdqqqaEZfEw1THPpBZRtn/ZMeKJJ53k
BSTdtg0AnJYQu3jziYDhPV2ZgXb0CO5cJ2sUpMbkg0MRruS5sH2ODAu1RAIBSj+i
eYGVGJKJuFPbnqXTpsViH69N3iVK2MaTAZsSBQjD7RgHHIfyKvnCZ8+TAPvOTqWn
v1PoqjQWDmAiOExNfNrEjfWOF2QMhhDRmZlz8KHJaqn392V3RYIR+seqgYrmwgpC
bsu5ykz5dqgphZIsx4tfMp+b2d84bs8sJyoAdfornmgB7yW5RDKE3bJbwkvWl5LY
b+UB6jpJD/hfZErmH8H94ofvTITWJv/xen1b2uc9IepCGjGQFjo+yBC8iX+C6ocM
ZUZ/Ct9cxFBvtMdDaQz0Gr3ITyrXgryKcF0Lq4Yp54Gy9wPvOrC9ve1RZ4iFfAdy
mvBkkmicznOmRV9XfiJuMQOvODn4VmyVb/UdYGUz+EBso70+0rZ+29PEinp0rHp7
1eSKmYrilDS/YoCFijQVPNy+6rcyZ9Es6aDzEBfMfOiCoRcIb5Zu6cPdC5MFEvCA
pWM5lLIDHHF8hpFT26xkOWkBAFn5Fq9kVNvnagtmYQc5dv9Pxdc=
=VMad
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 6 May 2020 22:29
(name . Jean-Baptiste Note)(address . jean-baptiste.note@m4x.org)(address . 41032-done@debbugs.gnu.org)
877dxo4xix.fsf@devup.no
Jean-Baptiste Note <jean-baptiste.note@m4x.org> writes:

Toggle quote (9 lines)
> Hi Marius,
>
> Thanks for your review and the heads up on the correct file.
> Please find an updated patch.
>
> I've used guix-devel-mode and ran indent-according-to-mode on the buffer
> before producing the patch; let me know if this is not sufficient to
> correctly indent the code :)

Thanks! My Emacs agrees, so LGTM.

[...]

Toggle quote (6 lines)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (delete 'configure))
> + #:make-flags (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))

I moved the second flag to its own line as 89 characters is a bit much.

Toggle quote (2 lines)
> + #:tests? #f))

And added a comment about why tests are disabled.

Toggle quote (8 lines)
> + (synopsis "Generate (pseudo-)random passwords and hashes")
> + (description
> + "Makepasswd is a program that generates pseudo-random passwords of a
> +desired length. It can also generate their corresponding hashes for a given
> +encryption algorithm if so desired.")
> + (home-page "https://github.com/khorben/makepasswd")
> + (license license:gpl3))))

Indeed GPL3 only :-/

Applied!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl6zHkYACgkQoqBt8qM6
VPpKoAf/XlFAw7jyPNOp6Q3c79cRWnYv75cFvFvua9zcr8rRdExWfj2WJIs4PjIH
Ib0/bd6lk2mHmB16v5gGftSvP9q9vKSkFTZ6fHnXaXT8uR9MnY+2irjLvs04x4xg
BbG0iLSpwJJhGHM2qIpjDSDp0kDPy8MMYXfKF42kwt0ndHZ5LOcxYUonTEL8C+Bt
LC25AZOHtL4VCRahWqGPERN4WxTdbr4UFFRfz6EWcSOr6Fd6ds9rruiFhfTQf4DF
s/rHZNuJQ7ERBU/vkuxMSS1dd83ZQsCFbLiJ9AUMxx7dgkJvL99g5Ao3OPQWOkv4
UgNvM78ajXEt41qWVzfcVMfOCbLbYQ==
=jjRa
-----END PGP SIGNATURE-----

Closed
?