2021-04-05 15:23:46 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python2Packages, unbound, libreswan }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-04-05 15:23:46 +00:00
|
|
|
pythonPackages = python2Packages;
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "hash-slinger";
|
|
|
|
version = "2.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "letoams";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "05wn744ydclpnpyah6yfjqlfjlasrrhzj48lqmm5a91nyps5yqyn";
|
|
|
|
};
|
|
|
|
|
|
|
|
pythonPath = with pythonPackages; [ dnspython m2crypto ipaddr python-gnupg
|
|
|
|
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 = ''
|
2021-04-05 15:23:46 +00:00
|
|
|
mkdir -p $out/bin $out/man $out/${pythonPackages.python.sitePackages}/
|
2020-04-24 23:36:52 +00:00
|
|
|
make install
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Various tools to generate special DNS records";
|
|
|
|
homepage = "https://github.com/letoams/hash-slinger";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = [ lib.maintainers.leenaars ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|