2016-04-30 20:09:18 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper
|
2016-11-09 12:49:06 +00:00
|
|
|
, python2Packages, ncurses, lsof, nettools
|
2016-04-30 20:09:18 +01:00
|
|
|
}:
|
2014-12-10 09:59:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-04-30 20:09:18 +01:00
|
|
|
name = "tor-arm-${version}";
|
2014-12-10 09:59:51 +00:00
|
|
|
version = "1.4.5.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-04-30 20:09:18 +01:00
|
|
|
url = "https://www.atagar.com/arm/resources/static/arm-${version}.tar.bz2";
|
2014-12-10 09:59:51 +00:00
|
|
|
sha256 = "1yi87gdglkvi1a23hv5c3k7mc18g0rw7b05lfcw81qyxhlapf3pw";
|
|
|
|
};
|
|
|
|
|
2016-11-09 12:49:06 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper python2Packages.python ];
|
2014-12-10 09:59:51 +00:00
|
|
|
|
2016-04-30 20:09:18 +01:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2014-12-10 09:59:51 +00:00
|
|
|
substituteInPlace ./setup.py --replace "/usr/bin" "$out/bin"
|
|
|
|
substituteInPlace ./src/util/connections.py \
|
|
|
|
--replace "lsof -wnPi" "${lsof}/bin/lsof"
|
|
|
|
substituteInPlace ./src/util/torTools.py \
|
|
|
|
--replace "netstat -npl" "${nettools}/bin/netstat -npl" \
|
|
|
|
--replace "lsof -wnPi" "${lsof}/bin/lsof"
|
|
|
|
|
|
|
|
substituteInPlace ./arm --replace '"$0" = /usr/bin/arm' 'true'
|
2016-11-09 12:49:06 +00:00
|
|
|
substituteInPlace ./arm --replace "python" "${python2Packages.python}/bin/python"
|
2014-12-10 09:59:51 +00:00
|
|
|
|
|
|
|
for i in ./install ./arm ./src/gui/controller.py ./src/cli/wizard.py ./src/resources/torrcOverride/override.h ./src/resources/torrcOverride/override.py ./src/resources/arm.1 ./setup.py; do
|
|
|
|
substituteInPlace $i --replace "/usr/share" "$out/share"
|
|
|
|
done
|
2016-04-30 20:09:18 +01:00
|
|
|
|
|
|
|
# fixes man page installation
|
|
|
|
substituteInPlace ./setup.py --replace "src/resoureces" "src/resources"
|
2014-12-10 09:59:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/arm $out/bin $out/libexec
|
2016-04-30 20:09:18 +01:00
|
|
|
python setup.py install --prefix=$out --docPath $out/share/doc/arm
|
2014-12-10 09:59:51 +00:00
|
|
|
cp -R src/TorCtl $out/libexec
|
|
|
|
|
2016-04-30 20:09:18 +01:00
|
|
|
wrapProgram $out/bin/arm \
|
2016-10-13 23:03:12 +01:00
|
|
|
--prefix PYTHONPATH : "$(toPythonPath $out):$out/libexec:$PYTHONPATH" \
|
2016-04-30 20:09:18 +01:00
|
|
|
--set TERMINFO "${ncurses.out}/share/terminfo" \
|
|
|
|
--set TERM "xterm"
|
2014-12-10 09:59:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2016-04-30 20:09:18 +01:00
|
|
|
description = "A terminal status monitor for Tor relays";
|
2014-12-10 09:59:51 +00:00
|
|
|
homepage = "https://www.atagar.com/arm/";
|
|
|
|
license = stdenv.lib.licenses.gpl3;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|