]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - pkgs/thruk/default.nix
Add thruk package
[perso/Immae/Config/Nix.git] / pkgs / thruk / default.nix
1 { buildPerlPackage, perl, perlPackages, fetchurl, fetchFromGitHub }:
2 buildPerlPackage rec {
3 name = "thruk-${version}";
4 version = "2.30-3";
5 src = fetchFromGitHub {
6 rev = "v${version}";
7 owner = "sni";
8 repo = "Thruk";
9 sha256 = "1vm3p0xsw44lw2p70gl9grc5rlnpb34yafgxll81vc8v653v5wwi";
10 };
11 preConfigure = ''
12 patchShebangs .
13 sed -i support/standard_script_header -e "s|exec perl|exec $perl/bin/perl $perlFlags|"
14 sed -i -e "/^#!/s/- perl -/-perl-/" support/standard_script_header
15 '';
16 preInstall = ''
17 sed -i -e "s@.{DESTDIR}.{TMPDIR}/reports .{DESTDIR}.{LOGDIR}@@" \
18 -e "/DESTDIR}.{TMPDIR/d" \
19 -e "/DESTDIR}.{LOCALSTATEDIR/d" \
20 -e "/DESTDIR}.{LOGDIR/d" Makefile
21 '';
22 postInstall = ''
23 rm -rf $out/var $out/tmp
24 '';
25 configureFlags = [
26 "--localstatedir=/var/lib/naemon/thruk"
27 "--libdir=/var/lib"
28 "--sysconfdir=$(out)/etc/thruk"
29 "--with-httpd-conf=$(out)/etc/httpd"
30 "--datadir=$(out)/share/thruk"
31 "--with-logdir=/var/log/thruk"
32 "--with-checkresultdir=/var/cache/naemon/checkresults"
33 "--with-tempdir=/var/lib/naemon/thruk"
34 "--with-thruk-user=immae"
35 "--with-thruk-group=immae"
36 ];
37 outputs = [ "out" ];
38 buildInputs = [ perl ];
39 propagatedBuildInputs = with perlPackages; [ DateCalc FCGI
40 FileSlurp GD HTMLParser JSONXS LogDispatch Log4Perl LWPProtocolHttps
41 MIMELite Plack TemplateToolkit URI ModuleInstall CpanelJSONXS
42 DateManip DateTime DateTimeTimeZone IOString LWPProtocolconnect DBI
43 DBDmysql HTMLEscape
44 ];
45 doCheck = false;
46 installTargets = "install";
47 }