2020-05-31 02:11:23 +00:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, makeWrapper, installShellFiles
|
|
|
|
, python3, sqlite }:
|
2020-03-24 22:21:03 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tuptime";
|
2020-05-31 02:11:23 +00:00
|
|
|
version = "5.0.0";
|
2020-03-24 22:21:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rfrail3";
|
|
|
|
repo = "tuptime";
|
|
|
|
rev = version;
|
2020-05-31 02:11:23 +00:00
|
|
|
sha256 = "0izps85p8pxidfrzp7l4hp221fx3dcgapapsix1zavq6jrsl2qyh";
|
2020-03-24 22:21:03 +00:00
|
|
|
};
|
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
|
|
|
|
2020-03-24 22:21:03 +00:00
|
|
|
buildInputs = [ python3 ];
|
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2020-03-24 22:21:03 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2020-05-31 02:11:23 +00:00
|
|
|
install -m 755 $src/src/tuptime $out/bin/
|
2020-03-24 22:21:03 +00:00
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
installManPage $src/src/man/tuptime.1
|
|
|
|
|
|
|
|
install -Dm 0755 $src/misc/scripts/db-tuptime-migrate-4.0-to-5.0.sh \
|
|
|
|
$out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh
|
|
|
|
'';
|
2020-03-24 22:21:03 +00:00
|
|
|
|
2020-05-31 02:11:23 +00:00
|
|
|
preFixup = ''
|
|
|
|
wrapProgram $out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh \
|
|
|
|
--prefix PATH : "${stdenv.lib.makeBinPath [ sqlite ]}"
|
2020-03-24 22:21:03 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Total uptime & downtime statistics utility";
|
|
|
|
homepage = "https://github.com/rfrail3/tuptime";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.evils ];
|
|
|
|
};
|
|
|
|
}
|