From c7a377cedbbb9d8353c7cd13dda1058923e5fe19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 5 Jul 2019 09:08:49 +0200 Subject: [PATCH] Add thruk package --- pkgs/default.nix | 2 ++ pkgs/thruk/default.nix | 47 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 pkgs/thruk/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index ff9d477..fd00be7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -29,6 +29,8 @@ rec { tiv = callPackage ../pkgs/tiv {}; unicodeDoc = callPackage ../pkgs/unicode {}; + thruk = callPackage ./thruk {}; + cardano = callPackage ../pkgs/crypto/cardano { inherit mylibs; }; iota-cli-app = callPackage ../pkgs/crypto/iota-cli-app { inherit mylibs; }; sia = callPackage ../pkgs/crypto/sia {}; diff --git a/pkgs/thruk/default.nix b/pkgs/thruk/default.nix new file mode 100644 index 0000000..444aa87 --- /dev/null +++ b/pkgs/thruk/default.nix @@ -0,0 +1,47 @@ +{ buildPerlPackage, perl, perlPackages, fetchurl, fetchFromGitHub }: +buildPerlPackage rec { + name = "thruk-${version}"; + version = "2.30-3"; + src = fetchFromGitHub { + rev = "v${version}"; + owner = "sni"; + repo = "Thruk"; + sha256 = "1vm3p0xsw44lw2p70gl9grc5rlnpb34yafgxll81vc8v653v5wwi"; + }; + preConfigure = '' + patchShebangs . + sed -i support/standard_script_header -e "s|exec perl|exec $perl/bin/perl $perlFlags|" + sed -i -e "/^#!/s/- perl -/-perl-/" support/standard_script_header + ''; + preInstall = '' + sed -i -e "s@.{DESTDIR}.{TMPDIR}/reports .{DESTDIR}.{LOGDIR}@@" \ + -e "/DESTDIR}.{TMPDIR/d" \ + -e "/DESTDIR}.{LOCALSTATEDIR/d" \ + -e "/DESTDIR}.{LOGDIR/d" Makefile + ''; + postInstall = '' + rm -rf $out/var $out/tmp + ''; + configureFlags = [ + "--localstatedir=/var/lib/naemon/thruk" + "--libdir=/var/lib" + "--sysconfdir=$(out)/etc/thruk" + "--with-httpd-conf=$(out)/etc/httpd" + "--datadir=$(out)/share/thruk" + "--with-logdir=/var/log/thruk" + "--with-checkresultdir=/var/cache/naemon/checkresults" + "--with-tempdir=/var/lib/naemon/thruk" + "--with-thruk-user=immae" + "--with-thruk-group=immae" + ]; + outputs = [ "out" ]; + buildInputs = [ perl ]; + propagatedBuildInputs = with perlPackages; [ DateCalc FCGI + FileSlurp GD HTMLParser JSONXS LogDispatch Log4Perl LWPProtocolHttps + MIMELite Plack TemplateToolkit URI ModuleInstall CpanelJSONXS + DateManip DateTime DateTimeTimeZone IOString LWPProtocolconnect DBI + DBDmysql HTMLEscape + ]; + doCheck = false; + installTargets = "install"; +} -- 2.41.0