2021-01-11 07:54:33 +00:00
|
|
|
{lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, glibc }:
|
2015-11-01 10:20:12 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-09-17 22:15:58 +00:00
|
|
|
version = "1.1.5";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "longview";
|
2015-11-01 10:20:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linode";
|
|
|
|
repo = "longview";
|
2016-09-17 22:15:58 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1i9lli8iw8sb1bd633i82fzhx5gz85ma9d1hra41pkv2p3h823pa";
|
2015-11-01 10:20:12 +00:00
|
|
|
};
|
|
|
|
|
2016-05-04 10:08:35 +00:00
|
|
|
patches = [
|
|
|
|
# log to systemd journal
|
|
|
|
./log-stdout.patch
|
|
|
|
];
|
2015-11-01 10:20:12 +00:00
|
|
|
|
2017-03-26 21:56:28 +00:00
|
|
|
# Read all configuration from /run/longview
|
2016-05-04 10:08:35 +00:00
|
|
|
postPatch = ''
|
2017-03-26 21:56:28 +00:00
|
|
|
substituteInPlace Linode/Longview/Util.pm \
|
|
|
|
--replace /var/run/longview.pid /run/longview/longview.pid \
|
|
|
|
--replace /etc/linode /run/longview
|
|
|
|
substituteInPlace Linode/Longview.pl \
|
|
|
|
--replace /etc/linode /run/longview
|
2016-05-04 10:08:35 +00:00
|
|
|
'';
|
2015-11-01 10:20:12 +00:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl glibc ]
|
2015-11-01 10:20:12 +00:00
|
|
|
++ (with perlPackages; [
|
2018-07-22 02:03:24 +00:00
|
|
|
LWP
|
2015-11-01 10:20:12 +00:00
|
|
|
LWPProtocolHttps
|
|
|
|
MozillaCA
|
|
|
|
CryptSSLeay
|
|
|
|
IOSocketInet6
|
|
|
|
LinuxDistribution
|
|
|
|
JSONPP
|
|
|
|
JSON
|
|
|
|
LogLogLite
|
|
|
|
TryTiny
|
|
|
|
DBI
|
|
|
|
DBDmysql
|
|
|
|
]);
|
|
|
|
|
2016-05-04 10:08:35 +00:00
|
|
|
dontBuild = true;
|
|
|
|
|
2015-11-01 10:20:12 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/usr
|
|
|
|
mv Linode $out
|
|
|
|
ln -s ../Linode/Longview.pl $out/bin/longview
|
|
|
|
for h in syscall.h sys/syscall.h asm/unistd.h asm/unistd_32.h asm/unistd_64.h bits/wordsize.h bits/syscall.h; do
|
2016-08-30 00:11:09 +00:00
|
|
|
${perl}/bin/h2ph -d $out ${glibc.dev}/include/$h
|
2015-11-01 10:20:12 +00:00
|
|
|
mkdir -p $out/usr/include/$(dirname $h)
|
2016-08-30 00:11:09 +00:00
|
|
|
mv $out${glibc.dev}/include/''${h%.h}.ph $out/usr/include/$(dirname $h)
|
2015-11-01 10:20:12 +00:00
|
|
|
done
|
|
|
|
wrapProgram $out/Linode/Longview.pl --prefix PATH : ${perl}/bin:$out/bin \
|
|
|
|
--suffix PERL5LIB : $out/Linode --suffix PERL5LIB : $PERL5LIB \
|
|
|
|
--suffix PERL5LIB : $out --suffix INC : $out
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.linode.com/longview";
|
2020-10-26 04:08:40 +00:00
|
|
|
description = "Collects all of your system-level metrics and sends them to Linode";
|
2015-11-01 10:20:12 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = [ maintainers.rvl ];
|
|
|
|
inherit version;
|
2017-12-06 20:25:46 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2015-11-01 10:20:12 +00:00
|
|
|
};
|
|
|
|
}
|