From ad0d03283bc3ed23bf4cf7421bf746a4358fc7c0 Mon Sep 17 00:00:00 2001 From: Jim Fowler Date: Fri, 14 Dec 2018 11:04:17 -0500 Subject: [PATCH 1/6] hashcash from http://hashcash.org --- pkgs/tools/security/hashcash/default.nix | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pkgs/tools/security/hashcash/default.nix diff --git a/pkgs/tools/security/hashcash/default.nix b/pkgs/tools/security/hashcash/default.nix new file mode 100644 index 00000000000..5c63845a584 --- /dev/null +++ b/pkgs/tools/security/hashcash/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, openssl }: + +stdenv.mkDerivation rec { + name = "hashcash-${version}"; + version = "1.22"; + + buildInputs = [ openssl ]; + + src = fetchurl { + url = "http://www.hashcash.org/source/hashcash-1.22.tgz"; + sha256 = "15kqaimwb2y8wvzpn73021bvay9mz1gqqfc40gk4hj6f84nz34h1"; + }; + + makeFlags = "generic-openssl LIBCRYPTO=-lcrypto"; + + installPhase = '' + mkdir -p $out/bin + mkdir -p $out/share/man/man1 + install -m 0755 hashcash $out/bin + install -m 0755 sha1 $out/bin + install -m 0444 hashcash.1 $out/share/man/man1 + ''; + + meta = with stdenv.lib; { + description = "Hashcash is a proof-of-work algorithm, which has been used as a denial-of-service counter measure technique in a number of systems."; + homepage = http://hashcash.org; + license = licenses.gpl2; + }; +} From bd6cbe256bc8b4ff413473ad78c52ff4c297fff5 Mon Sep 17 00:00:00 2001 From: Jim Fowler Date: Fri, 14 Dec 2018 11:04:49 -0500 Subject: [PATCH 2/6] added hashcash to all packages --- pkgs/top-level/all-packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 209a90a1601..aaa48338d32 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3233,6 +3233,8 @@ in hardlink = callPackage ../tools/system/hardlink { }; + hashcash = callPackage ../tools/security/hashcash { }; + hashcat = callPackage ../tools/security/hashcat { }; hash_extender = callPackage ../tools/security/hash_extender { }; From fe162a347a7cd521552a7aad1710f341dbfabf21 Mon Sep 17 00:00:00 2001 From: Jim Fowler Date: Fri, 14 Dec 2018 11:10:10 -0500 Subject: [PATCH 3/6] adding myself as a maintainer --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 7a0ff6fe437..eda5d27391a 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -2278,6 +2278,11 @@ github = "kirelagin"; name = "Kirill Elagin"; }; + kisonecat = { + email = "kisonecat@gmail.com"; + github = "kisonecat"; + name = "Jim Fowler"; + }; kkallio = { email = "tierpluspluslists@gmail.com"; name = "Karn Kallio"; From e66d3074976c9fe4a377030b547e3c9bf0d0f943 Mon Sep 17 00:00:00 2001 From: Jim Fowler Date: Fri, 14 Dec 2018 11:11:07 -0500 Subject: [PATCH 4/6] hashcash: init at 1.22 --- pkgs/tools/security/hashcash/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/security/hashcash/default.nix b/pkgs/tools/security/hashcash/default.nix index 5c63845a584..521dcf87a5f 100644 --- a/pkgs/tools/security/hashcash/default.nix +++ b/pkgs/tools/security/hashcash/default.nix @@ -22,8 +22,9 @@ stdenv.mkDerivation rec { ''; meta = with stdenv.lib; { - description = "Hashcash is a proof-of-work algorithm, which has been used as a denial-of-service counter measure technique in a number of systems."; + description = "Proof-of-work algorithm used as spam and denial-of-service counter measure"; homepage = http://hashcash.org; license = licenses.gpl2; + maintainers = with maintainers; [ kisonecat ]; }; } From 6206a783d5015463de8e7bc5205bb711d00c49f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 14 Dec 2018 18:07:36 +0000 Subject: [PATCH 5/6] hashcash: simplify installation --- pkgs/tools/security/hashcash/default.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/security/hashcash/default.nix b/pkgs/tools/security/hashcash/default.nix index 521dcf87a5f..337837f3116 100644 --- a/pkgs/tools/security/hashcash/default.nix +++ b/pkgs/tools/security/hashcash/default.nix @@ -4,21 +4,18 @@ stdenv.mkDerivation rec { name = "hashcash-${version}"; version = "1.22"; - buildInputs = [ openssl ]; + buildInputs = [ openssl ]; src = fetchurl { url = "http://www.hashcash.org/source/hashcash-1.22.tgz"; sha256 = "15kqaimwb2y8wvzpn73021bvay9mz1gqqfc40gk4hj6f84nz34h1"; }; - + makeFlags = "generic-openssl LIBCRYPTO=-lcrypto"; installPhase = '' - mkdir -p $out/bin - mkdir -p $out/share/man/man1 - install -m 0755 hashcash $out/bin - install -m 0755 sha1 $out/bin - install -m 0444 hashcash.1 $out/share/man/man1 + install -D -m 0755 --target $out/bin hashcash sha1 + install -D -m 0444 hashcash.1 $out/share/man/man1/hashcash.1 ''; meta = with stdenv.lib; { From 6b8c09bffca82c1373c38586cac2032088f0e5bf Mon Sep 17 00:00:00 2001 From: Jim Fowler Date: Mon, 7 Jan 2019 21:06:09 -0500 Subject: [PATCH 6/6] more idiomatic nix --- pkgs/tools/security/hashcash/default.nix | 26 ++++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/security/hashcash/default.nix b/pkgs/tools/security/hashcash/default.nix index 337837f3116..a28822ecd95 100644 --- a/pkgs/tools/security/hashcash/default.nix +++ b/pkgs/tools/security/hashcash/default.nix @@ -1,23 +1,27 @@ { stdenv, fetchurl, openssl }: stdenv.mkDerivation rec { - name = "hashcash-${version}"; + pname = "hashcash"; version = "1.22"; - + buildInputs = [ openssl ]; src = fetchurl { - url = "http://www.hashcash.org/source/hashcash-1.22.tgz"; - sha256 = "15kqaimwb2y8wvzpn73021bvay9mz1gqqfc40gk4hj6f84nz34h1"; + url = "http://www.hashcash.org/source/hashcash-${version}.tgz"; + sha256 = "15kqaimwb2y8wvzpn73021bvay9mz1gqqfc40gk4hj6f84nz34h1"; }; + + makeFlags = [ + "generic-openssl" + "LIBCRYPTO=-lcrypto" + ]; - makeFlags = "generic-openssl LIBCRYPTO=-lcrypto"; - - installPhase = '' - install -D -m 0755 --target $out/bin hashcash sha1 - install -D -m 0444 hashcash.1 $out/share/man/man1/hashcash.1 - ''; - + installFlags = [ + "INSTALL_PATH=${placeholder "out"}/bin" + "MAN_INSTALL_PATH=${placeholder "out"}/share/man/man1" + "DOC_INSTALL_PATH=${placeholder "out"}/share/doc/hashcash-$(version)" + ]; + meta = with stdenv.lib; { description = "Proof-of-work algorithm used as spam and denial-of-service counter measure"; homepage = http://hashcash.org;