2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-05-31 04:11:23 +02:00
|
|
|
, makeWrapper, installShellFiles
|
|
|
|
, python3, sqlite }:
|
2020-03-24 23:21:03 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tuptime";
|
2020-10-31 21:30:59 +01:00
|
|
|
version = "5.0.1";
|
2020-03-24 23:21:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rfrail3";
|
|
|
|
repo = "tuptime";
|
|
|
|
rev = version;
|
2020-10-31 21:30:59 +01:00
|
|
|
sha256 = "0nk3yyjavgmc435vj3f0siw4y5nwipsbcsvsf5m7mgvq0xi8f3ls";
|
2020-03-24 23:21:03 +01:00
|
|
|
};
|
|
|
|
|
2020-05-31 04:11:23 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
|
|
|
|
2020-03-24 23:21:03 +01:00
|
|
|
buildInputs = [ python3 ];
|
|
|
|
|
2020-05-31 04:11:23 +02:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2020-03-24 23:21:03 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2020-05-31 04:11:23 +02:00
|
|
|
install -m 755 $src/src/tuptime $out/bin/
|
2020-03-24 23:21:03 +01:00
|
|
|
|
2020-05-31 04:11:23 +02: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 23:21:03 +01:00
|
|
|
|
2020-05-31 04:11:23 +02:00
|
|
|
preFixup = ''
|
|
|
|
wrapProgram $out/share/tuptime/db-tuptime-migrate-4.0-to-5.0.sh \
|
2021-01-15 10:19:50 +01:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ sqlite ]}"
|
2020-03-24 23:21:03 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-03-24 23:21:03 +01:00
|
|
|
description = "Total uptime & downtime statistics utility";
|
|
|
|
homepage = "https://github.com/rfrail3/tuptime";
|
2020-06-23 12:49:01 +02:00
|
|
|
license = licenses.gpl2Plus;
|
2020-03-24 23:21:03 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.evils ];
|
|
|
|
};
|
|
|
|
}
|