From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kD1NF8iq216rFAAA0tVLHw (envelope-from ) for ; Sat, 06 Jun 2020 14:40:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8AEZE8iq217hFgAAbx9fmQ (envelope-from ) for ; Sat, 06 Jun 2020 14:40:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7E8B294014C for ; Sat, 6 Jun 2020 14:40:07 +0000 (UTC) Received: from localhost ([::1]:50984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhZzS-0004Xc-3o for larch@yhetil.org; Sat, 06 Jun 2020 10:40:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhZzO-0004XK-B2 for guix-patches@gnu.org; Sat, 06 Jun 2020 10:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhZzO-0002p6-0r for guix-patches@gnu.org; Sat, 06 Jun 2020 10:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhZzN-00088G-QO for guix-patches@gnu.org; Sat, 06 Jun 2020 10:40:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41637] [PATCH] gnu: Add hashcash. Resent-From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 06 Jun 2020 14:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41637 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 41637@debbugs.gnu.org Received: via spool by 41637-submit@debbugs.gnu.org id=B41637.159145437631220 (code B ref 41637); Sat, 06 Jun 2020 14:40:01 +0000 Received: (at 41637) by debbugs.gnu.org; 6 Jun 2020 14:39:36 +0000 Received: from localhost ([127.0.0.1]:52292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhZyx-00087S-Nt for submit@debbugs.gnu.org; Sat, 06 Jun 2020 10:39:36 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:59678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhZyu-00087F-S4 for 41637@debbugs.gnu.org; Sat, 06 Jun 2020 10:39:33 -0400 Received: (qmail 16513 invoked by uid 1009); 6 Jun 2020 16:39:30 +0200 Received: from user-5-173-120-16.play-internet.pl (kuba@kadziolka.net@user-5-173-120-16.play-internet.pl) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25834. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(5.173.120.16):. Processed in 0.12163 secs); 06 Jun 2020 14:39:30 -0000 Received: from user-5-173-120-16.play-internet.pl (HELO gravity) (kuba@kadziolka.net@5.173.120.16) by pat.zlotemysli.pl with SMTP; 6 Jun 2020 16:39:30 +0200 Date: Sat, 6 Jun 2020 16:39:28 +0200 From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Message-ID: <20200606143928.humyr6gzzwcb4ool@gravity> References: <20200601004015.21684-1-kuba@kadziolka.net> <87blm07i50.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="htkwus75asbprhea" Content-Disposition: inline In-Reply-To: <87blm07i50.fsf@gnu.org> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -2.61 X-TUID: zBid4XYQL18K --htkwus75asbprhea Content-Type: multipart/mixed; boundary="ua3jwwtucgeexfma" Content-Disposition: inline --ua3jwwtucgeexfma Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 03, 2020 at 08:55:39AM +0200, Mathieu Othacehe wrote: >=20 > Hey Jakub, >=20 > Thanks for fixing the cross-compilation, a full review this time :) >=20 > > + (let* ((outdir (assoc-ref outputs "out")) > > + (bindir (string-append outdir "/bin")) > > + (mandir (string-append outdir "/share/man/man1")) > > + (docdir (string-append outdir "/share/doc/hashcash= -" ,version))) > > + ;; make install assumes /usr and doesn't provide a way = to override it > > + (install-file "hashcash" bindir) > > + (install-file "hashcash.1" mandir) > > + (install-file "README" docdir) > > + (install-file "LICENSE" docdir) > > + (install-file "CHANGELOG" docdir) >=20 > I think you can set the variables INSTALL_PATH, MAN_INSTALL_PATH and > DOC_INSTALL_PATH instead. >=20 > > + #t)))))) > > + (home-page "https://www.hashcash.org/") > > + (synopsis "Denial-of-service countermeasure") > > + (description "Hashcash is a proof-of-work algorithm, which has bee= n used > > +as a denial-of-service countermeasure technique in a number of systems. >=20 > You can remove "in a number of systems". Note that systems means things like e-mail or bitcoin, rather than Guix or Debian. > > +A hashcash stamp constitutes a proof-of-work which takes a parametriza= ble > > +amount of work to compute for the sender. The recipient can verify re= ceived > > +hashcash stamps efficiently. > > + > > +This package contains a command-line tool for computing and verifying = hashcash > > +stamps.") > > + (license license:public-domain))) >=20 > I'm also concerned by this line in the Makefile: >=20 > --8<---------------cut here---------------start------------->8--- > # request static link of -lcrypto only > LIBCRYPTO=3D/usr/lib/libcrypto.a > --8<---------------cut here---------------end--------------->8--- >=20 > We should maybe add "openssl" to the inputs and fix this variable > (that's what Nix does). Firstly, the benchmarking code seems to be broken in Hashcash 1.22. Downgrading to 1.21 and running hashcash -sv, I found that OpenSSL is slower than another minting backend, and is not used by default. I believe it would be better to not include OpenSSL in the package. That's what Debian does, anyway. I therefore propose only the following changes: diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index b38e75eb7f..ecd72eee26 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -3217,7 +3217,7 @@ an implementation of LLDP. It also supports some pro= prietary protocols.") (bindir (string-append outdir "/bin")) (mandir (string-append outdir "/share/man/man1")) (docdir (string-append outdir "/share/doc/hashcash-" ,= version))) - ;; make install assumes /usr and doesn't provide a way to o= verride it + ;; Install manually, as we don't need the `sha1' binary (install-file "hashcash" bindir) (install-file "hashcash.1" mandir) (install-file "README" docdir) Regards, Jakub K=C4=85dzio=C5=82ka --ua3jwwtucgeexfma Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="v2-0001-gnu-Add-hashcash.patch" Content-Transfer-Encoding: quoted-printable =46rom de679e91b17b3a04a5f07446d0b121ed8f5890ed Mon Sep 17 00:00:00 2001 =46rom: =3D?UTF-8?q?Jakub=3D20K=3DC4=3D85dzio=3DC5=3D82ka?=3D Date: Mon, 1 Jun 2020 02:37:03 +0200 Subject: [PATCH v2] gnu: Add hashcash. * gnu/packages/networking.scm (hashcash): New variable. --- gnu/packages/networking.scm | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index fd29370841..d7de5b1956 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -38,6 +38,7 @@ ;;; Copyright =C2=A9 2019 Diego N. Barbato ;;; Copyright =C2=A9 2020 Vincent Legoll ;;; Copyright =C2=A9 2020 Brice Waegeneire +;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka ;;; ;;; This file is part of GNU Guix. ;;; @@ -3189,3 +3190,49 @@ CDP. The goal of LLDP is to provide an inter-vendor= compatible mechanism to deliver Link-Layer notifications to adjacent network devices. @code{lldpd= } is an implementation of LLDP. It also supports some proprietary protocols.") (license license:isc))) + +(define-public hashcash + (package + (name "hashcash") + (version "1.22") + (source + (origin + (method url-fetch) + (uri (string-append "http://www.hashcash.org/source/hashcash-" + version ".tgz")) + (sha256 + (base32 + "15kqaimwb2y8wvzpn73021bvay9mz1gqqfc40gk4hj6f84nz34h1")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list (string-append "CC=3D" ,(cc-for-target))) + #:phases + (modify-phases %standard-phases + (delete 'configure) + ;; No tests available. + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((outdir (assoc-ref outputs "out")) + (bindir (string-append outdir "/bin")) + (mandir (string-append outdir "/share/man/man1")) + (docdir (string-append outdir "/share/doc/hashcash-" ,= version))) + ;; Install manually, as we don't need the `sha1' binary + (install-file "hashcash" bindir) + (install-file "hashcash.1" mandir) + (install-file "README" docdir) + (install-file "LICENSE" docdir) + (install-file "CHANGELOG" docdir) + #t)))))) + (home-page "https://www.hashcash.org/") + (synopsis "Denial-of-service countermeasure") + (description "Hashcash is a proof-of-work algorithm, which has been us= ed +as a denial-of-service countermeasure technique in a number of systems. + +A hashcash stamp constitutes a proof-of-work which takes a parametrizable +amount of work to compute for the sender. The recipient can verify receiv= ed +hashcash stamps efficiently. + +This package contains a command-line tool for computing and verifying hash= cash +stamps.") + (license license:public-domain))) --=20 2.26.2 --ua3jwwtucgeexfma-- --htkwus75asbprhea Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl7bqp8ACgkQ4xWnWEYT FWQ/Og/9H1XzRMTCfoJCcZMoiispj9cRNW0A+YLiXGLdx4vAexGLQnhK6PYT3Aq8 GzxOTt1w6P3+HlI0XPnX54UfspsbIHQr3cN4gpa+zhIWb8w1fYPGlOZIwQvRrY1p mYmBLncLkMpKjUhtUNxCoh1kQUOLjoLZ61w4mY4qvShvxRCVVLLEi3nddTZvNrFF 8T0MlHR50wzrHABiaSOdnQyfQq+zmSCUnB595RN/Prq1oC9IXkpjS0ASGt0jo4lO ddu2YouLft2oZmyuDBzo1fBJ0dDCqZN1Ud0QxLcJL3E3XQnvqm0gJ/7c62OpMe6L s5X8z4Sg6OQ/WO2m0L5eay8tdna7c/tZtNDUz6aGDiyBGcqkSD96uCsW25iwSjzy /tJ6H9k017NWjc4PwFTsHrCEFUmKIwJf05F0RgbwsgNE/PrIlfGg46m4CNAeVX9H AkvvxeM6L96Qotk77GsmZAOV+8GZ7vE0nqdEWOy+KBjkjaQC+XLmLuKbHIn5RHx6 47/4LDr8YBCHTE4dqui054o3GJk+xsmZqxOhEpKiU/ZyQuZoOZqfbgM1rYxHe+2H OUltn7K0AnnhF3xSg4ewwuBw3jy+O18NFBMjzLFEq72s55QMKl2c7u/VR+E1S23X IGpSj9HkomBHUlwwuFgVxAI+DE4AEw1ST46fxKwYs965BP70Hws= =aV+d -----END PGP SIGNATURE----- --htkwus75asbprhea--