{ungoogled-,}chromium,chromedriver: 130.0.6723.58 -> 130.0.6723.69 (#351519)
[NixPkgs.git] / pkgs / servers / monitoring / zabbix / proxy.nix
blobc0ac7d46628b2ef39c5d2a881757f9f00c5f4415
2   lib,
3   stdenv,
4   fetchurl,
5   pkg-config,
6   libevent,
7   libiconv,
8   openssl,
9   pcre,
10   zlib,
11   odbcSupport ? true,
12   unixODBC,
13   snmpSupport ? stdenv.buildPlatform == stdenv.hostPlatform,
14   net-snmp,
15   sshSupport ? true,
16   libssh2,
17   sqliteSupport ? false,
18   sqlite,
19   mysqlSupport ? false,
20   libmysqlclient,
21   postgresqlSupport ? false,
22   postgresql,
25 # ensure exactly one database type is selected
26 assert mysqlSupport -> !postgresqlSupport && !sqliteSupport;
27 assert postgresqlSupport -> !mysqlSupport && !sqliteSupport;
28 assert sqliteSupport -> !mysqlSupport && !postgresqlSupport;
30 let
31   inherit (lib) optional optionalString;
33 import ./versions.nix (
34   { version, hash, ... }:
35   stdenv.mkDerivation {
36     pname = "zabbix-proxy";
37     inherit version;
39     src = fetchurl {
40       url = "https://cdn.zabbix.com/zabbix/sources/stable/${lib.versions.majorMinor version}/zabbix-${version}.tar.gz";
41       inherit hash;
42     };
44     nativeBuildInputs = [ pkg-config ];
45     buildInputs =
46       [
47         libevent
48         libiconv
49         openssl
50         pcre
51         zlib
52       ]
53       ++ optional odbcSupport unixODBC
54       ++ optional snmpSupport net-snmp
55       ++ optional sqliteSupport sqlite
56       ++ optional sshSupport libssh2
57       ++ optional mysqlSupport libmysqlclient
58       ++ optional postgresqlSupport postgresql;
60     configureFlags =
61       [
62         "--enable-ipv6"
63         "--enable-proxy"
64         "--with-iconv"
65         "--with-libevent"
66         "--with-libpcre"
67         "--with-openssl=${openssl.dev}"
68         "--with-zlib=${zlib}"
69       ]
70       ++ optional odbcSupport "--with-unixodbc"
71       ++ optional snmpSupport "--with-net-snmp"
72       ++ optional sqliteSupport "--with-sqlite3=${sqlite.dev}"
73       ++ optional sshSupport "--with-ssh2=${libssh2.dev}"
74       ++ optional mysqlSupport "--with-mysql"
75       ++ optional postgresqlSupport "--with-postgresql";
77     prePatch = ''
78       find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} +
79     '';
81     makeFlags = [
82       "AR:=$(AR)"
83       "RANLIB:=$(RANLIB)"
84     ];
86     postInstall =
87       ''
88         mkdir -p $out/share/zabbix/database/
89       ''
90       + optionalString sqliteSupport ''
91         mkdir -p $out/share/zabbix/database/sqlite3
92         cp -prvd database/sqlite3/schema.sql $out/share/zabbix/database/sqlite3/
93       ''
94       + optionalString mysqlSupport ''
95         mkdir -p $out/share/zabbix/database/mysql
96         cp -prvd database/mysql/schema.sql $out/share/zabbix/database/mysql/
97       ''
98       + optionalString postgresqlSupport ''
99         mkdir -p $out/share/zabbix/database/postgresql
100         cp -prvd database/postgresql/schema.sql $out/share/zabbix/database/postgresql/
101       '';
103     meta = {
104       description = "Enterprise-class open source distributed monitoring solution (client-server proxy)";
105       homepage = "https://www.zabbix.com/";
106       license =
107         if (lib.versions.major version >= "7") then lib.licenses.agpl3Only else lib.licenses.gpl2Plus;
108       maintainers = with lib.maintainers; [ mmahut ];
109       platforms = lib.platforms.linux;
110     };
111   }