1{stdenv, fetchurl, zlib, ncurses}:
2
3stdenv.mkDerivation rec {
4 version = "2.2-3";
5 name = "atop-${version}";
6
7 src = fetchurl {
8 url = "http://www.atoptool.nl/download/atop-${version}.tar.gz";
9 sha256 = "0p85isn6zih3xfprjym5xanqzazwqjj8x2mmwqyqpqjv6nibi1f7";
10 };
11
12 buildInputs = [zlib ncurses];
13
14 makeFlags = [
15 ''SCRPATH=$out/etc/atop''
16 ''LOGPATH=/var/log/atop''
17 ''INIPATH=$out/etc/rc.d/init.d''
18 ''CRNPATH=$out/etc/cron.d''
19 ''ROTPATH=$out/etc/logrotate.d''
20 ];
21
22 preConfigure = ''
23 sed -e "s@/usr/@$out/@g" -i $(find . -type f )
24 sed -e "/mkdir.*LOGPATH/s@mkdir@echo missing dir @" -i Makefile
25 sed -e "/touch.*LOGPATH/s@touch@echo should have created @" -i Makefile
26 sed -e 's/chown/true/g' -i Makefile
27 sed -e '/chkconfig/d' -i Makefile
28 '';
29
30 preInstall = ''
31 mkdir -p "$out"/{bin,sbin}
32 make systemdinstall $makeFlags
33 '';
34
35 meta = {
36 platforms = stdenv.lib.platforms.linux;
37 maintainers = with stdenv.lib.maintainers; [raskin];
38 description = ''Console system performance monitor'';
39
40 longDescription = ''
41 Atop is an ASCII full-screen performance monitor that is capable of reporting the activity of all processes (even if processes have finished during the interval), daily logging of system and process activity for long-term analysis, highlighting overloaded system resources by using colors, etc. At regular intervals, it shows system-level activity related to the CPU, memory, swap, disks and network layers, and for every active process it shows the CPU utilization, memory growth, disk utilization, priority, username, state, and exit code.
42 '';
43 inherit version;
44 downloadPage = http://atoptool.nl/downloadatop.php;
45 };
46}