about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/rsyslog/default.nix
blob: 865c66926259092ae82193cb7709d6d6fe486456 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{ lib
, stdenv
, fetchurl
, pkg-config
, autoreconfHook
, libestr
, json_c
, zlib
, docutils
, fastJson
, withKrb5 ? true
, libkrb5
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
, withJemalloc ? true
, jemalloc
, withMysql ? true
, libmysqlclient
, withPostgres ? true
, postgresql
, withDbi ? true
, libdbi
, withNetSnmp ? true
, net-snmp
, withUuid ? true
, libuuid
, withCurl ? true
, curl
, withGnutls ? true
, gnutls
, withGcrypt ? true
, libgcrypt
, withLognorm ? true
, liblognorm
, withMaxminddb ? true
, libmaxminddb
, withOpenssl ? true
, openssl
, withRelp ? true
, librelp
, withKsi ? true
, libksi
, withLogging ? true
, liblogging
, withNet ? true
, libnet
, withHadoop ? true
, hadoop
, withRdkafka ? true
, rdkafka
, withMongo ? true
, mongoc
, withCzmq ? true
, czmq
, withRabbitmq ? true
, rabbitmq-c
, withHiredis ? true
, hiredis
, nixosTests
}:

stdenv.mkDerivation rec {
  pname = "rsyslog";
  version = "8.2402.0";

  src = fetchurl {
    url = "https://www.rsyslog.com/files/download/rsyslog/${pname}-${version}.tar.gz";
    hash = "sha256-rL3YV5SJ3za0o4PcaQmmG3YjgH8K/1TAYhFfLefqhbo=";
  };

  nativeBuildInputs = [
    pkg-config
    autoreconfHook
    docutils
  ];

  buildInputs = [
    fastJson
    libestr
    json_c
    zlib
  ] ++ lib.optional withKrb5 libkrb5
  ++ lib.optional withJemalloc jemalloc
  ++ lib.optional withPostgres postgresql
  ++ lib.optional withDbi libdbi
  ++ lib.optional withNetSnmp net-snmp
  ++ lib.optional withUuid libuuid
  ++ lib.optional withCurl curl
  ++ lib.optional withGnutls gnutls
  ++ lib.optional withGcrypt libgcrypt
  ++ lib.optional withLognorm liblognorm
  ++ lib.optional withOpenssl openssl
  ++ lib.optional withRelp librelp
  ++ lib.optional withKsi libksi
  ++ lib.optional withLogging liblogging
  ++ lib.optional withNet libnet
  ++ lib.optional withHadoop hadoop
  ++ lib.optional withRdkafka rdkafka
  ++ lib.optionals withMongo [ mongoc ]
  ++ lib.optional withCzmq czmq
  ++ lib.optional withRabbitmq rabbitmq-c
  ++ lib.optional withHiredis hiredis
  ++ lib.optional withMaxminddb libmaxminddb
  ++ lib.optional withMysql libmysqlclient
  ++ lib.optional withSystemd systemd;

  configureFlags = with lib; [
    "--sysconfdir=/etc"
    "--localstatedir=/var"
    "--with-systemdsystemunitdir=\${out}/etc/systemd/system"
    (enableFeature true "largefile")
    (enableFeature true "regexp")
    (enableFeature withKrb5 "gssapi-krb5")
    (enableFeature true "klog")
    (enableFeature true "kmsg")
    (enableFeature withSystemd "imjournal")
    (enableFeature true "inet")
    (enableFeature withJemalloc "jemalloc")
    (enableFeature true "unlimited-select")
    (enableFeature withCurl "clickhouse")
    (enableFeature false "debug")
    (enableFeature false "debug-symbols")
    (enableFeature true "debugless")
    (enableFeature false "valgrind")
    (enableFeature false "diagtools")
    (enableFeature withCurl "fmhttp")
    (enableFeature true "usertools")
    (enableFeature withMysql "mysql")
    (enableFeature withPostgres "pgsql")
    (enableFeature withDbi "libdbi")
    (enableFeature withNetSnmp "snmp")
    (enableFeature withUuid "uuid")
    (enableFeature withCurl "elasticsearch")
    (enableFeature withGnutls "gnutls")
    (enableFeature withGcrypt "libgcrypt")
    (enableFeature true "rsyslogrt")
    (enableFeature true "rsyslogd")
    (enableFeature true "mail")
    (enableFeature withLognorm "mmnormalize")
    (enableFeature withMaxminddb "mmdblookup")
    (enableFeature true "mmjsonparse")
    (enableFeature true "mmaudit")
    (enableFeature true "mmanon")
    (enableFeature true "mmutf8fix")
    (enableFeature true "mmcount")
    (enableFeature true "mmsequence")
    (enableFeature true "mmfields")
    (enableFeature true "mmpstrucdata")
    (enableFeature withOpenssl "mmrfc5424addhmac")
    (enableFeature withRelp "relp")
    (enableFeature withKsi "ksi-ls12")
    (enableFeature withLogging "liblogging-stdlog")
    (enableFeature withLogging "rfc3195")
    (enableFeature true "imfile")
    (enableFeature false "imsolaris")
    (enableFeature true "imptcp")
    (enableFeature true "impstats")
    (enableFeature true "omprog")
    (enableFeature withNet "omudpspoof")
    (enableFeature true "omstdout")
    (enableFeature withSystemd "omjournal")
    (enableFeature true "pmlastmsg")
    (enableFeature true "pmcisconames")
    (enableFeature true "pmciscoios")
    (enableFeature true "pmaixforwardedfrom")
    (enableFeature true "pmsnare")
    (enableFeature true "omruleset")
    (enableFeature true "omuxsock")
    (enableFeature true "mmsnmptrapd")
    (enableFeature withHadoop "omhdfs")
    (enableFeature withRdkafka "omkafka")
    (enableFeature withMongo "ommongodb")
    (enableFeature withCzmq "imczmq")
    (enableFeature withCzmq "omczmq")
    (enableFeature withRabbitmq "omrabbitmq")
    (enableFeature withHiredis "omhiredis")
    (enableFeature withCurl "omhttp")
    (enableFeature true "generate-man-pages")
  ];

  passthru.tests = {
    nixos-rsyslogd = nixosTests.rsyslogd;
  };

  meta = with lib; {
    homepage = "https://www.rsyslog.com/";
    description = "Enhanced syslog implementation";
    mainProgram = "rsyslogd";
    changelog = "https://raw.githubusercontent.com/rsyslog/rsyslog/v${version}/ChangeLog";
    license = licenses.gpl3Only;
    platforms = platforms.linux;
    maintainers = with maintainers; [ ];
  };
}