From patchwork Sat Jun 6 14:39:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Maja_K=C4=85dzio=C5=82ka?= X-Patchwork-Id: 22572 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B84AA27BBE3; Sat, 6 Jun 2020 15:40:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 28A4E27BBE1 for ; Sat, 6 Jun 2020 15:40:08 +0100 (BST) Received: from localhost ([::1]:50984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhZzT-0004Xc-OX for patchwork@mira.cbaines.net; Sat, 06 Jun 2020 10:40:07 -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?b?S8SFZHppb8WCa2E=?= 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?b?S8SFZHppb8WCa2E=?= Message-ID: <20200606143928.humyr6gzzwcb4ool@gravity> References: <20200601004015.21684-1-kuba@kadziolka.net> <87blm07i50.fsf@gnu.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87blm07i50.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches On Wed, Jun 03, 2020 at 08:55:39AM +0200, Mathieu Othacehe wrote: > > Hey Jakub, > > Thanks for fixing the cross-compilation, a full review this time :) > > > + (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) > > I think you can set the variables INSTALL_PATH, MAN_INSTALL_PATH and > DOC_INSTALL_PATH instead. > > > + #t)))))) > > + (home-page "https://www.hashcash.org/") > > + (synopsis "Denial-of-service countermeasure") > > + (description "Hashcash is a proof-of-work algorithm, which has been used > > +as a denial-of-service countermeasure technique in a number of systems. > > 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 parametrizable > > +amount of work to compute for the sender. The recipient can verify received > > +hashcash stamps efficiently. > > + > > +This package contains a command-line tool for computing and verifying hashcash > > +stamps.") > > + (license license:public-domain))) > > I'm also concerned by this line in the Makefile: > > --8<---------------cut here---------------start------------->8--- > # request static link of -lcrypto only > LIBCRYPTO=/usr/lib/libcrypto.a > --8<---------------cut here---------------end--------------->8--- > > 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: Regards, Jakub Kądziołka From de679e91b17b3a04a5f07446d0b121ed8f5890ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= 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 © 2019 Diego N. Barbato ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Brice Waegeneire +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; 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=" ,(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 used +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 received +hashcash stamps efficiently. + +This package contains a command-line tool for computing and verifying hashcash +stamps.") + (license license:public-domain))) 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 proprietary 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 override it + ;; Install manually, as we don't need the `sha1' binary (install-file "hashcash" bindir) (install-file "hashcash.1" mandir) (install-file "README" docdir)