2015-11-01 11:20:12 +01:00
|
|
|
{stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, glibc }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-09-18 00:15:58 +02:00
|
|
|
version = "1.1.5";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "longview";
|
2015-11-01 11:20:12 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linode";
|
|
|
|
repo = "longview";
|
2016-09-18 00:15:58 +02:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1i9lli8iw8sb1bd633i82fzhx5gz85ma9d1hra41pkv2p3h823pa";
|
2015-11-01 11:20:12 +01:00
|
|
|
};
|
|
|
|
|
2016-05-04 12:08:35 +02:00
|
|
|
patches = [
|
|
|
|
# log to systemd journal
|
|
|
|
./log-stdout.patch
|
|
|
|
];
|
2015-11-01 11:20:12 +01:00
|
|
|
|
2017-03-26 23:56:28 +02:00
|
|
|
# Read all configuration from /run/longview
|
2016-05-04 12:08:35 +02:00
|
|
|
postPatch = ''
|
2017-03-26 23:56:28 +02: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 12:08:35 +02:00
|
|
|
'';
|
2015-11-01 11:20:12 +01:00
|
|
|
|
|
|
|
buildInputs = [ perl makeWrapper glibc ]
|
|
|
|
++ (with perlPackages; [
|
2018-07-22 04:03:24 +02:00
|
|
|
LWP
|
2015-11-01 11:20:12 +01:00
|
|
|
LWPProtocolHttps
|
|
|
|
MozillaCA
|
|
|
|
CryptSSLeay
|
|
|
|
IOSocketInet6
|
|
|
|
LinuxDistribution
|
|
|
|
JSONPP
|
|
|
|
JSON
|
|
|
|
LogLogLite
|
|
|
|
TryTiny
|
|
|
|
DBI
|
|
|
|
DBDmysql
|
|
|
|
]);
|
|
|
|
|
2016-05-04 12:08:35 +02:00
|
|
|
dontBuild = true;
|
|
|
|
|
2015-11-01 11:20:12 +01: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 02:11:09 +02:00
|
|
|
${perl}/bin/h2ph -d $out ${glibc.dev}/include/$h
|
2015-11-01 11:20:12 +01:00
|
|
|
mkdir -p $out/usr/include/$(dirname $h)
|
2016-08-30 02:11:09 +02:00
|
|
|
mv $out${glibc.dev}/include/''${h%.h}.ph $out/usr/include/$(dirname $h)
|
2015-11-01 11:20:12 +01: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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.linode.com/longview";
|
2020-10-26 05:08:40 +01:00
|
|
|
description = "Collects all of your system-level metrics and sends them to Linode";
|
2015-11-01 11:20:12 +01:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = [ maintainers.rvl ];
|
|
|
|
inherit version;
|
2017-12-06 21:25:46 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2015-11-01 11:20:12 +01:00
|
|
|
};
|
|
|
|
}
|