2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3Packages }:
|
2018-08-01 14:40:57 +01:00
|
|
|
|
2020-09-13 23:45:13 +01:00
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
version = "1.0.1";
|
2018-08-01 14:40:57 +01:00
|
|
|
pname = "ipgrep";
|
|
|
|
|
2020-09-13 23:45:13 +01:00
|
|
|
disabled = python3Packages.isPy27;
|
|
|
|
|
2018-08-01 14:40:57 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jedisct1";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-09-13 23:45:13 +01:00
|
|
|
hash = "sha256-NrhcUFQM+L66KaDRRpAoC+z5s54a+1fqEepTRXVZ5Qs=";
|
2018-08-01 14:40:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
2020-09-13 23:45:13 +01:00
|
|
|
mkdir -p ${pname}
|
2018-08-01 14:40:57 +01:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'scripts': []" "'scripts': { '${pname}.py' }"
|
|
|
|
'';
|
|
|
|
|
2020-09-13 23:45:13 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2018-08-01 14:40:57 +01:00
|
|
|
pycares
|
|
|
|
urllib3
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-08-01 14:40:57 +01:00
|
|
|
description = "Extract, defang, resolve names and IPs from text";
|
|
|
|
longDescription = ''
|
|
|
|
ipgrep extracts possibly obfuscated host names and IP addresses
|
|
|
|
from text, resolves host names, and prints them, sorted by ASN.
|
|
|
|
'';
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ leenaars ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|