2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, which, coreutils, rrdtool, perlPackages
|
2021-07-27 19:08:46 +01:00
|
|
|
, python2, ruby, jre, nettools, bc
|
2014-01-02 16:53:57 +00:00
|
|
|
}:
|
2013-05-20 14:01:23 +01:00
|
|
|
|
2013-05-20 10:18:40 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-09 10:40:03 +00:00
|
|
|
version = "2.0.69";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "munin";
|
2013-05-20 10:18:40 +01:00
|
|
|
|
2017-01-24 13:37:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "munin-monitoring";
|
|
|
|
repo = "munin";
|
|
|
|
rev = version;
|
2021-12-09 10:40:03 +00:00
|
|
|
sha256 = "sha256-p273O5JLFX1dA2caV3lVVL9YNTcGMSrC7DWieUfUmqI=";
|
2013-05-20 10:18:40 +01:00
|
|
|
};
|
|
|
|
|
2018-07-22 03:03:24 +01:00
|
|
|
buildInputs = [
|
2013-05-20 10:18:40 +01:00
|
|
|
makeWrapper
|
|
|
|
which
|
2013-05-20 14:01:23 +01:00
|
|
|
coreutils
|
|
|
|
rrdtool
|
2013-10-15 02:16:10 +01:00
|
|
|
nettools
|
2018-12-15 03:50:31 +00:00
|
|
|
perlPackages.perl
|
2013-05-20 14:01:23 +01:00
|
|
|
perlPackages.ModuleBuild
|
2013-05-20 10:18:40 +01:00
|
|
|
perlPackages.HTMLTemplate
|
2014-11-05 21:09:43 +00:00
|
|
|
perlPackages.NetCIDR
|
2013-05-20 10:18:40 +01:00
|
|
|
perlPackages.NetSSLeay
|
|
|
|
perlPackages.NetServer
|
2018-07-22 03:03:24 +01:00
|
|
|
perlPackages.LogLog4perl
|
2013-05-20 14:01:23 +01:00
|
|
|
perlPackages.IOSocketInet6
|
|
|
|
perlPackages.Socket6
|
|
|
|
perlPackages.URI
|
|
|
|
perlPackages.DBFile
|
|
|
|
perlPackages.DateManip
|
|
|
|
perlPackages.FileCopyRecursive
|
|
|
|
perlPackages.FCGI
|
|
|
|
perlPackages.NetSNMP
|
|
|
|
perlPackages.NetServer
|
|
|
|
perlPackages.ListMoreUtils
|
2018-07-22 03:03:24 +01:00
|
|
|
perlPackages.LWP
|
2013-10-15 02:16:10 +01:00
|
|
|
perlPackages.DBDPg
|
2021-07-27 19:08:46 +01:00
|
|
|
python2
|
2013-05-20 14:01:23 +01:00
|
|
|
ruby
|
2015-01-01 23:49:20 +00:00
|
|
|
jre
|
2013-10-15 02:16:10 +01:00
|
|
|
# tests
|
|
|
|
perlPackages.TestLongString
|
|
|
|
perlPackages.TestDifferences
|
|
|
|
perlPackages.TestDeep
|
|
|
|
perlPackages.TestMockModule
|
|
|
|
perlPackages.TestMockObject
|
|
|
|
perlPackages.FileSlurp
|
|
|
|
perlPackages.IOStringy
|
|
|
|
];
|
|
|
|
|
2018-08-25 00:00:05 +01:00
|
|
|
# needs to find a local perl module during build
|
2018-10-03 20:25:44 +01:00
|
|
|
PERL_USE_UNSAFE_INC = "1";
|
2018-08-25 00:00:05 +01:00
|
|
|
|
2021-07-31 18:01:50 +01:00
|
|
|
# TODO: tests are failing https://munin-monitoring.org/ticket/1390#comment:1
|
2013-10-15 02:16:10 +01:00
|
|
|
# NOTE: important, test command always exits with 0, think of a way to abort the build once tests pass
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
checkPhase = ''
|
2018-12-15 03:50:31 +00:00
|
|
|
export PERL5LIB="$PERL5LIB:${rrdtool}/${perlPackages.perl.libPrefix}"
|
|
|
|
LC_ALL=C make -j1 test
|
2013-10-15 02:16:10 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# https://rt.cpan.org/Public/Bug/Display.html?id=75112
|
|
|
|
./dont_preserve_source_dir_permissions.patch
|
|
|
|
|
|
|
|
# https://github.com/munin-monitoring/munin/pull/134
|
|
|
|
./adding_servicedir_munin-node.patch
|
2017-11-21 22:38:11 +00:00
|
|
|
|
2017-11-24 02:27:15 +00:00
|
|
|
./adding_sconfdir_munin-node.patch
|
2017-11-21 22:38:11 +00:00
|
|
|
./preserve_environment.patch
|
2013-05-20 10:18:40 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
2018-12-15 20:02:54 +00:00
|
|
|
echo "${version}" > RELEASE
|
2013-10-15 02:16:10 +01:00
|
|
|
substituteInPlace "Makefile" \
|
2014-01-16 18:07:16 +00:00
|
|
|
--replace "/bin/pwd" "pwd" \
|
|
|
|
--replace "HTMLOld.3pm" "HTMLOld.3"
|
2013-10-15 02:16:10 +01:00
|
|
|
|
|
|
|
# munin checks at build time if user/group exists, unpure
|
2013-05-20 10:18:40 +01:00
|
|
|
sed -i '/CHECKUSER/d' Makefile
|
|
|
|
sed -i '/CHOWN/d' Makefile
|
|
|
|
sed -i '/CHECKGROUP/d' Makefile
|
2013-10-15 02:16:10 +01:00
|
|
|
|
|
|
|
# munin hardcodes PATH, we need it to obey $PATH
|
|
|
|
sed -i '/ENV{PATH}/d' node/lib/Munin/Node/Service.pm
|
2013-05-20 10:18:40 +01:00
|
|
|
'';
|
|
|
|
|
2022-01-29 10:12:07 +00:00
|
|
|
# Disable parallel build, errors:
|
|
|
|
# Can't locate Munin/Common/Defaults.pm in @INC ...
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2013-05-20 14:01:23 +01:00
|
|
|
# DESTDIR shouldn't be needed (and shouldn't have worked), but munin
|
|
|
|
# developers have forgotten to use PREFIX everywhere, so we use DESTDIR to
|
|
|
|
# ensure that everything is installed in $out.
|
2019-10-29 22:21:22 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PERLLIB=$(out)/${perlPackages.perl.libPrefix}"
|
|
|
|
"PERL=${perlPackages.perl.outPath}/bin/perl"
|
2021-07-27 19:08:46 +01:00
|
|
|
"PYTHON=${python2.outPath}/bin/python"
|
2019-10-29 22:21:22 +00:00
|
|
|
"RUBY=${ruby.outPath}/bin/ruby"
|
|
|
|
"JAVARUN=${jre.outPath}/bin/java"
|
|
|
|
"PLUGINUSER=munin"
|
|
|
|
];
|
2013-05-20 14:01:23 +01:00
|
|
|
|
2013-05-20 10:18:40 +01:00
|
|
|
postFixup = ''
|
2015-01-03 15:27:16 +00:00
|
|
|
echo "Removing references to /usr/{bin,sbin}/ from munin plugins..."
|
2017-02-25 13:10:09 +00:00
|
|
|
find "$out/lib/plugins" -type f -print0 | xargs -0 -L1 \
|
|
|
|
sed -i -e "s|/usr/bin/||g" -e "s|/usr/sbin/||g" -e "s|\<bc\>|${bc}/bin/bc|g"
|
2015-01-03 15:27:16 +00:00
|
|
|
|
2017-11-17 18:26:21 +00:00
|
|
|
if test -e $out/nix-support/propagated-build-inputs; then
|
|
|
|
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
2013-05-20 10:18:40 +01:00
|
|
|
fi
|
2013-05-20 14:01:23 +01:00
|
|
|
|
|
|
|
for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
|
|
|
|
# don't wrap .jar files
|
|
|
|
case "$file" in
|
|
|
|
*.jar) continue;;
|
|
|
|
esac
|
2013-10-15 02:16:10 +01:00
|
|
|
wrapProgram "$file" \
|
2018-12-15 03:50:31 +00:00
|
|
|
--set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${with perlPackages; makePerlPath [
|
2018-07-22 03:03:24 +01:00
|
|
|
LogLog4perl IOSocketInet6 Socket6 URI DBFile DateManip
|
2014-11-05 21:09:43 +00:00
|
|
|
HTMLTemplate FileCopyRecursive FCGI NetCIDR NetSNMP NetServer
|
2018-12-14 15:40:36 +00:00
|
|
|
ListMoreUtils DBDPg LWP rrdtool
|
2014-07-17 21:59:20 +01:00
|
|
|
]}"
|
2013-05-20 14:01:23 +01:00
|
|
|
done
|
2013-05-20 10:18:40 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-05-20 14:01:23 +01:00
|
|
|
description = "Networked resource monitoring tool";
|
|
|
|
longDescription = ''
|
|
|
|
Munin is a monitoring tool that surveys all your computers and remembers
|
|
|
|
what it saw. It presents all the information in graphs through a web
|
|
|
|
interface. Munin can help analyze resource trends and 'what just happened
|
|
|
|
to kill our performance?' problems.
|
|
|
|
'';
|
2021-07-31 18:01:50 +01:00
|
|
|
homepage = "https://munin-monitoring.org/";
|
2013-05-20 10:18:40 +01:00
|
|
|
license = licenses.gpl2;
|
2021-03-03 10:50:26 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2013-05-20 10:18:40 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|