2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, fetchFromGitHub, pythonPackages, unbound, libreswan }:
|
2016-07-20 18:09:44 +02:00
|
|
|
|
2016-08-01 10:19:55 +02:00
|
|
|
let
|
|
|
|
inherit (pythonPackages) python;
|
|
|
|
in stdenv.mkDerivation rec {
|
2016-07-20 18:09:44 +02:00
|
|
|
pname = "hash-slinger";
|
|
|
|
version = "2.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "letoams";
|
2019-09-09 01:38:31 +02:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2016-07-20 18:09:44 +02:00
|
|
|
sha256 = "05wn744ydclpnpyah6yfjqlfjlasrrhzj48lqmm5a91nyps5yqyn";
|
|
|
|
};
|
|
|
|
|
2017-12-10 15:27:06 +01:00
|
|
|
pythonPath = with pythonPackages; [ dnspython m2crypto ipaddr python-gnupg
|
2016-07-20 18:09:44 +02:00
|
|
|
pyunbound ];
|
|
|
|
|
|
|
|
buildInputs = [ pythonPackages.wrapPython ];
|
|
|
|
propagatedBuildInputs = [ unbound libreswan ] ++ pythonPath;
|
|
|
|
propagatedUserEnvPkgs = [ unbound libreswan ];
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "$(DESTDIR)/usr" "$out"
|
|
|
|
substituteInPlace ipseckey \
|
|
|
|
--replace "/usr/sbin/ipsec" "${libreswan}/sbin/ipsec"
|
|
|
|
substituteInPlace tlsa \
|
|
|
|
--replace "/var/lib/unbound/root" "${pythonPackages.pyunbound}/etc/pyunbound/root"
|
|
|
|
patchShebangs *
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/man $out/${python.sitePackages}/
|
|
|
|
make install
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Various tools to generate special DNS records";
|
|
|
|
homepage = "https://github.com/letoams/hash-slinger";
|
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.leenaars ];
|
|
|
|
};
|
|
|
|
}
|