Merge pull request #17323 from arpa2/hashslinger

Hash-slinger: init at 2.7.0

authored by Frederik Rietdijk and committed by GitHub 8f9326ff dbd856d7

+111
+63
pkgs/tools/networking/unbound/python.nix
··· 1 + { stdenv, fetchurl, openssl, expat, libevent, swig, python, pythonPackages }: 2 + 3 + stdenv.mkDerivation rec { 4 + pname = "pyunbound"; 5 + name = "${pname}-${version}"; 6 + version = "1.5.9"; 7 + 8 + src = fetchurl { 9 + url = "http://unbound.net/downloads/unbound-${version}.tar.gz"; 10 + sha256 = "01328cfac99ab5b8c47115151896a244979e442e284eb962c0ea84b7782b6990"; 11 + }; 12 + 13 + buildInputs = [ openssl expat libevent swig python ]; 14 + 15 + patchPhase = ''substituteInPlace Makefile.in \ 16 + --replace "\$(DESTDIR)\$(PYTHON_SITE_PKG)" "$out/${python.sitePackages}" \ 17 + --replace "\$(LIBTOOL) --mode=install cp _unbound.la" "cp _unbound.la" 18 + ''; 19 + 20 + preConfigure = "export PYTHON_VERSION=${python.majorVersion}"; 21 + 22 + configureFlags = [ 23 + "--with-ssl=${openssl.dev}" 24 + "--with-libexpat=${expat.dev}" 25 + "--with-libevent=${libevent.dev}" 26 + "--localstatedir=/var" 27 + "--sysconfdir=/etc" 28 + "--sbindir=\${out}/bin" 29 + "--enable-pie" 30 + "--enable-relro-now" 31 + "--with-pyunbound" 32 + "DESTDIR=$out PREFIX=" 33 + ]; 34 + 35 + preInstall = '' 36 + mkdir -p $out/${python.sitePackages} $out/etc/${pname} 37 + cp .libs/_unbound.so .libs/libunbound.so* $out/${python.sitePackages} 38 + substituteInPlace _unbound.la \ 39 + --replace "-L.libs $PWD/libunbound.la" "-L$out/${python.sitePackages}" \ 40 + --replace "libdir=\'$PWD/${python.sitePackages}\'" "libdir=\'$out/${python.sitePackages}\'" 41 + ''; 42 + 43 + installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf pyunbound-install lib" ]; 44 + 45 + # All we want is the Unbound Python module 46 + postInstall = '' 47 + # Generate the built in root anchor and root key and store these in a logical place 48 + # to be used by tools depending only on the Python module 49 + $out/bin/unbound-anchor -l | head -1 > $out/etc/${pname}/root.anchor 50 + $out/bin/unbound-anchor -l | tail --lines=+2 - > $out/etc/${pname}/root.key 51 + # We don't need anything else 52 + rm -fR $out/bin $out/share $out/include $out/etc/unbound 53 + patchelf --replace-needed libunbound.so.2 $out/${python.sitePackages}/libunbound.so.2 $out/${python.sitePackages}/_unbound.so 54 + ''; 55 + 56 + meta = with stdenv.lib; { 57 + description = "Python library for Unbound, the validating, recursive, and caching DNS resolver"; 58 + license = licenses.bsd3; 59 + homepage = http://www.unbound.net; 60 + maintainers = with maintainers; [ leenaars ]; 61 + platforms = stdenv.lib.platforms.unix; 62 + }; 63 + }
+44
pkgs/tools/security/hash-slinger/default.nix
··· 1 + { stdenv, fetchFromGitHub, pythonPackages, openssh, gnupg, unbound, libreswan }: 2 + 3 + stdenv.mkDerivation rec { 4 + pname = "hash-slinger"; 5 + name = "${pname}-${version}"; 6 + version = "2.7"; 7 + 8 + src = fetchFromGitHub { 9 + owner = "letoams"; 10 + repo = "${pname}"; 11 + rev = "${version}"; 12 + sha256 = "05wn744ydclpnpyah6yfjqlfjlasrrhzj48lqmm5a91nyps5yqyn"; 13 + }; 14 + 15 + pythonPath = with pythonPackages; [ dns m2crypto ipaddr python-gnupg 16 + pyunbound ]; 17 + 18 + buildInputs = [ pythonPackages.wrapPython ]; 19 + propagatedBuildInputs = [ unbound libreswan ] ++ pythonPath; 20 + propagatedUserEnvPkgs = [ unbound libreswan ]; 21 + 22 + patchPhase = '' 23 + substituteInPlace Makefile \ 24 + --replace "$(DESTDIR)/usr" "$out" 25 + substituteInPlace ipseckey \ 26 + --replace "/usr/sbin/ipsec" "${libreswan}/sbin/ipsec" 27 + substituteInPlace tlsa \ 28 + --replace "/var/lib/unbound/root" "${pythonPackages.pyunbound}/etc/pyunbound/root" 29 + patchShebangs * 30 + ''; 31 + 32 + installPhase = '' 33 + mkdir -p $out/bin $out/man $out/${python.sitePackages}/ 34 + make install 35 + wrapPythonPrograms 36 + ''; 37 + 38 + meta = { 39 + description = "Various tools to generate special DNS records"; 40 + homepage = "https://github.com/letoams/hash-slinger"; 41 + license = stdenv.lib.licenses.gpl2Plus; 42 + maintainers = [ stdenv.lib.maintainers.leenaars ]; 43 + }; 44 + }
+2
pkgs/top-level/all-packages.nix
··· 1964 1964 1965 1965 hashcat = callPackage ../tools/security/hashcat { }; 1966 1966 1967 + hash-slinger = callPackage ../tools/security/hash-slinger { }; 1968 + 1967 1969 hal-flash = callPackage ../os-specific/linux/hal-flash { }; 1968 1970 1969 1971 halibut = callPackage ../tools/typesetting/halibut { };
+2
pkgs/top-level/python-packages.nix
··· 327 327 hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; }; 328 328 }; 329 329 330 + pyunbound = callPackage ../tools/networking/unbound/python.nix { }; 331 + 330 332 # packages defined here 331 333 332 334 aafigure = buildPythonPackage rec {