]>
Commit | Line | Data |
---|---|---|
cec64641 | 1 | # TODO: |
bb684e69 | 2 | # - switch to LTS version??? where??? |
cc1675a4 JB |
3 | # - relies on libs in /usr which is wrong |
4 | # (well, for modules bringing additional functionality it's acceptable IMO --q) | |
e803f395 | 5 | # - package python module |
cec64641 | 6 | # |
8eca2e89 | 7 | # Conditional build: |
011ba713 | 8 | %bcond_with dynamic # link dynamically with glib, eventlog, pcre (modules are always linked dynamically) |
306cd2c9 | 9 | %if "%{pld_release}" == "ac" |
011ba713 | 10 | %bcond_with sql # support for logging to SQL DB |
306cd2c9 | 11 | %else |
011ba713 | 12 | %bcond_without sql # support for logging to SQL DB |
306cd2c9 | 13 | %endif |
011ba713 | 14 | %bcond_without tests # do not perform "make check" |
d3133019 | 15 | %bcond_without http # support for HTTP destination |
011ba713 JB |
16 | %bcond_without json # support for JSON template formatting |
17 | %bcond_without mongodb # support for mongodb destination | |
18 | %bcond_without redis # support for Redis destination | |
19 | %bcond_without smtp # support for logging into SMTP | |
312323d8 | 20 | %bcond_without geoip # support for GeoIP |
35b01c3c | 21 | %bcond_without riemann # support for Riemann monitoring system |
2890986e | 22 | %bcond_without systemd # systemd (daemon and journal) support |
c612fe0c | 23 | %bcond_without amqp # AMQP support |
eebad2d5 JR |
24 | %bcond_with python # python module |
25 | %bcond_with java # java modules and support | |
fd7236ec AM |
26 | %bcond_without system_libivykis # use system libivykis |
27 | %bcond_without system_rabbitmq # use system librabbitmq | |
5461d50b | 28 | |
c612fe0c JK |
29 | %if %{without amqp} |
30 | %undefine with_system_rabbitmq | |
31 | %endif | |
32 | ||
306cd2c9 | 33 | %if "%{pld_release}" == "ac" |
4c650c71 | 34 | %define glib2_ver 1:2.16.0 |
306cd2c9 | 35 | %else |
4c650c71 | 36 | %define glib2_ver 1:2.24.0 |
306cd2c9 | 37 | %endif |
78780d53 AM |
38 | %define mver 3.14 |
39 | %define docmver 3.12 | |
80a87a81 | 40 | Summary: Syslog-ng - new generation of the system logger |
cc1675a4 | 41 | Summary(pl.UTF-8): Syslog-ng - systemowy demon logujący nowej generacji |
f7affeae | 42 | Summary(pt_BR.UTF-8): Daemon de log nova geração |
db55bc6c | 43 | Name: syslog-ng |
78780d53 | 44 | Version: 3.14.1 |
fd7236ec | 45 | Release: 0.1 |
4c650c71 | 46 | License: GPL v2+ with OpenSSL exception |
db55bc6c | 47 | Group: Daemons |
fd7236ec | 48 | Source0: https://github.com/balabit/syslog-ng/archive/%{name}-%{version}.tar.gz |
78780d53 | 49 | # Source0-md5: 60c58c5e50860c5b81afb6e80abb0a04 |
70c1937a | 50 | Source1: %{name}.init |
51 | Source2: %{name}.conf | |
e0f9b227 | 52 | Source3: %{name}.logrotate |
78780d53 | 53 | Source4: http://www.balabit.com/support/documentation/syslog-ng-ose-%{docmver}-guides/en/syslog-ng-ose-v%{docmver}-guide-admin/pdf/%{name}-ose-v%{docmver}-guide-admin.pdf |
fd7236ec | 54 | # Source4-md5: fce7075b03ba9501911b9812a553e680 |
0872fe7c | 55 | Source5: %{name}-simple.conf |
35907845 | 56 | Patch0: %{name}-datadir.patch |
5fe1f11f | 57 | Patch1: cap_syslog-vserver-workaround.patch |
38883b2f | 58 | Patch2: %{name}-nolibs.patch |
17524264 | 59 | Patch3: %{name}-systemd.patch |
cd31ca9b | 60 | Patch4: man-paths.patch |
118f372b | 61 | Patch5: %{name}-link.patch |
fd7236ec | 62 | URL: https://syslog-ng.org/ |
312323d8 | 63 | %{?with_geoip:BuildRequires: GeoIP-devel >= 1.5.1} |
be957de7 | 64 | BuildRequires: autoconf >= 2.59 |
53500332 | 65 | BuildRequires: automake |
4a7ca8b7 | 66 | BuildRequires: bison >= 2.4 |
d3133019 | 67 | %{?with_http:BuildRequires: curl-devel} |
cd31ca9b | 68 | BuildRequires: docbook-style-xsl |
cc1675a4 | 69 | BuildRequires: eventlog-devel >= 0.2.12 |
b7fea326 | 70 | %{?with_tests:BuildRequires: findutils} |
ac9ca8e0 | 71 | BuildRequires: flex |
4c650c71 | 72 | BuildRequires: glib2-devel >= %{glib2_ver} |
bada063a | 73 | %{?with_redis:BuildRequires: hiredis-devel} |
011ba713 | 74 | %{?with_json:BuildRequires: json-c-devel >= 0.9} |
cc1675a4 JB |
75 | BuildRequires: libcap-devel |
76 | %{?with_sql:BuildRequires: libdbi-devel >= 0.8.3-2} | |
af6a2653 | 77 | %{?with_smtp:BuildRequires: libesmtp-devel} |
fd7236ec AM |
78 | %{?with_system_libivykis:BuildRequires: libivykis-devel >= 0.42} |
79 | %{?with_mongodb:BuildRequires: mongo-c-driver-devel} | |
cc1675a4 | 80 | BuildRequires: libnet-devel >= 1:1.1.2.1-3 |
4a7ca8b7 | 81 | BuildRequires: libtool >= 2:2.0 |
cc1675a4 | 82 | BuildRequires: libwrap-devel |
9f2bd341 | 83 | BuildRequires: libxslt-progs |
d3133019 | 84 | BuildRequires: lz4-devel >= r131-5 |
cc1675a4 JB |
85 | BuildRequires: openssl-devel >= 0.9.8 |
86 | BuildRequires: pcre-devel >= 6.1 | |
bf8c4b27 | 87 | BuildRequires: pkgconfig |
8fd1a6f4 | 88 | %{?with_system_rabbitmq:BuildRequires: rabbitmq-c-devel >= 0.0.1} |
35b01c3c | 89 | %{?with_riemann:BuildRequires: riemann-c-client-devel >= 1.0.0} |
306cd2c9 | 90 | BuildRequires: rpm >= 4.4.9-56 |
6d708cb5 | 91 | BuildRequires: rpmbuild(macros) >= 1.623 |
be957de7 | 92 | %{?with_systemd:BuildRequires: systemd-devel >= 1:195} |
24642adc | 93 | BuildRequires: which |
bc708ef6 | 94 | %if %{with tests} |
eebad2d5 | 95 | BuildRequires: GeoIP-db-Country |
e803f395 | 96 | BuildRequires: pylint |
24642adc | 97 | BuildRequires: python |
e803f395 | 98 | BuildRequires: python-pep8 |
acaccb00 | 99 | BuildRequires: python-ply |
bc708ef6 AF |
100 | BuildRequires: tzdata |
101 | %endif | |
cc1675a4 | 102 | %if %{without dynamic} |
d132f512 | 103 | BuildRequires: eventlog-static >= 0.2.12 |
4c650c71 | 104 | BuildRequires: glib2-static >= %{glib2_ver} |
fd7236ec | 105 | %{?with_system_libivykis:BuildRequires: libivykis-static >= 0.42} |
585ae33b | 106 | BuildRequires: pcre-static >= 6.1 |
808ca97e | 107 | BuildRequires: zlib-static |
8eca2e89 | 108 | %endif |
768882cc | 109 | Requires(post): fileutils |
cc4597b5 | 110 | Requires(post,preun): /sbin/chkconfig |
b3030031 | 111 | Requires(post,preun,postun): systemd-units >= 38 |
cc1675a4 | 112 | Requires: %{name}-libs = %{version}-%{release} |
0471c4e3 | 113 | Requires: psmisc >= 20.1 |
8fd1a6f4 | 114 | %{?with_system_rabbitmq:Requires: rabbitmq-c >= 0.0.1} |
622aa91c | 115 | Requires: rc-scripts >= 0.4.3.0 |
b3030031 | 116 | Requires: systemd-units >= 38 |
ceea8d15 JB |
117 | # for afsocket |
118 | Requires: libnet >= 1:1.1.2.1-7 | |
119 | # for afsocket and dbparser | |
120 | Requires: openssl >= 0.9.8 | |
34031399 JR |
121 | Provides: service(klogd) |
122 | Provides: service(syslog) | |
18a2d4ea | 123 | Provides: syslogdaemon |
ceea8d15 JB |
124 | Obsoletes: syslog-ng-module-afsocket |
125 | Obsoletes: syslog-ng-module-dbparser | |
c0bb099a | 126 | Obsoletes: syslog-ng-systemd |
5db3c127 | 127 | Conflicts: klogd |
1a409b7d | 128 | Conflicts: msyslog |
240bc451 | 129 | Conflicts: rsyslog |
0baee825 | 130 | Conflicts: syslog |
1002ecce BS |
131 | Conflicts: cronie < 1.5.0-3 |
132 | Conflicts: fcron < 3.1.2-5 | |
8a78073d | 133 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
db55bc6c | 134 | |
cd31ca9b ER |
135 | %define xsl_stylesheets_dir /usr/share/sgml/docbook/xsl-stylesheets |
136 | ||
be957de7 | 137 | %if %{without dynamic} |
35907845 AM |
138 | # syslog-ng has really crazy linking rules (see their bugzilla). |
139 | # Some rules, according to syslog-ng devs, are like this: | |
140 | # - libsyslog-ng.so has undefined symbols for third party libraries | |
141 | # and these symbols should go via main syslog-ng binary | |
142 | # - same applies for modules | |
cc1675a4 JB |
143 | # In dynamic case tests are forcily linked with dynamic modules, which doesn't work with as-needed. |
144 | %define filterout_ld -Wl,--as-needed -Wl,--no-copy-dt-needed-entries | |
bb38cad4 JR |
145 | %define no_install_post_check_so 1 |
146 | %define _sbindir /sbin | |
be957de7 JB |
147 | %define slibdir /%{_lib} |
148 | %else | |
149 | %define slibdir %{_libdir} | |
bb38cad4 | 150 | %endif |
be957de7 JB |
151 | # or just %{_libdir}? modules seem to be always linked dynamically |
152 | %define moduledir %{slibdir}/syslog-ng | |
bb38cad4 | 153 | |
db55bc6c | 154 | %description |
a42dcc7c | 155 | syslog-ng is a syslogd replacement for Unix and Unix-like systems. It |
70c1937a | 156 | has been tested on Solaris, BSDi and Linux, and were found to run |
157 | reliably. syslog-ng gives you a much enhanced configuration scheme, | |
158 | which lets you filter messages based on not only priority/facility | |
159 | pairs, but also on message content. You can use regexps to direct log | |
160 | stream to different destinations. A destination can be anything from a | |
161 | simple file to a network connection. syslog-ng supports TCP | |
162 | logforwarding, together with hashing to prevent unauthorized | |
163 | modification on the line. | |
db55bc6c | 164 | |
6ab9000c JR |
165 | %description -l pl.UTF-8 |
166 | Syslog-ng jest zamiennikiem dla standardowo używanych programów typu | |
a42dcc7c | 167 | syslog. Działa w systemie SunOS, BSD, Linux. Daje znacznie większe |
6ab9000c | 168 | możliwości logowania i kontrolowania zbieranych informacji. |
db55bc6c | 169 | |
6ab9000c JR |
170 | %description -l pt_BR.UTF-8 |
171 | Syslog-ng é um substituto para o syslog tradicional, mas com diversas | |
02e7b20a | 172 | melhorias, como, por exemplo, a habilidade de filtrar mensagens de log |
6ab9000c | 173 | por seu conteúdo (usando expressões regulares) e não apenas pelo par |
02e7b20a | 174 | facility/prioridade como o syslog original. |
175 | ||
4c650c71 JB |
176 | %package module-afmongodb |
177 | Summary: MongoDB destination support module for syslog-ng | |
178 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazie MongoDB | |
179 | Group: Libraries | |
180 | Requires: %{name} = %{version}-%{release} | |
be957de7 | 181 | Requires: libmongo-client >= 0.1.8 |
4c650c71 JB |
182 | |
183 | %description module-afmongodb | |
184 | MongoDB destination support module for syslog-ng. | |
185 | ||
186 | %description module-afmongodb -l pl.UTF-8 | |
187 | Moduł sysloga-ng do obsługi zapisu logów w bazie MongoDB. | |
188 | ||
24e8f380 MK |
189 | %package module-afsmtp |
190 | Summary: SMTP output support module for syslog-ng | |
191 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi wysyłania logów do serwerów SMTP | |
192 | Group: Libraries | |
193 | Requires: %{name} = %{version}-%{release} | |
24e8f380 MK |
194 | Requires: openssl >= 0.9.8 |
195 | ||
196 | %description module-afsmtp | |
af6a2653 | 197 | SMTP output support module for syslog-ng. |
24e8f380 MK |
198 | |
199 | %description module-afsmtp -l pl.UTF-8 | |
af6a2653 | 200 | Moduł sysloga-ng do obsługi wysyłania logów do serwerów SMTP. |
24e8f380 | 201 | |
4c650c71 JB |
202 | %package module-afsql |
203 | Summary: SQL destination support module for syslog-ng | |
204 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazach SQL | |
205 | Group: Libraries | |
206 | Requires: %{name} = %{version}-%{release} | |
207 | Requires: libdbi >= 0.8.3-2 | |
208 | Requires: openssl >= 0.9.8 | |
209 | ||
210 | %description module-afsql | |
211 | SQL destination support module for syslog-ng (via libdbi). | |
212 | ||
213 | %description module-afsql -l pl.UTF-8 | |
214 | Moduł sysloga-ng do obsługi zapisu logów w bazach SQL (poprzez | |
215 | libdbi). | |
216 | ||
d3133019 JR |
217 | %package module-http |
218 | Summary: HTTP destination support module for syslog-ng | |
219 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów poprzez HTTP | |
220 | Group: Libraries | |
221 | Requires: %{name} = %{version}-%{release} | |
222 | ||
223 | %description module-http | |
224 | HTTP destination support module for syslog-ng (via libcurl). | |
225 | ||
226 | %description module-http -l pl.UTF-8 | |
227 | Moduł sysloga-ng do obsługi zapisu logów poprzez HTTP (via libcurl). | |
228 | ||
24e8f380 | 229 | %package module-json-plugin |
4c650c71 JB |
230 | Summary: JSON formatting template function for syslog-ng |
231 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON | |
232 | Group: Libraries | |
233 | Requires: %{name} = %{version}-%{release} | |
887b46ca MK |
234 | Requires: json-c >= 0.9 |
235 | Obsoletes: syslog-ng-module-tfjson | |
4c650c71 | 236 | |
24e8f380 | 237 | %description module-json-plugin |
4c650c71 JB |
238 | JSON formatting template function for syslog-ng. |
239 | ||
24e8f380 | 240 | %description module-json-plugin -l pl.UTF-8 |
4c650c71 JB |
241 | Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON. |
242 | ||
011ba713 JB |
243 | %package module-redis |
244 | Summary: Redis destination support module for syslog-ng | |
245 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazie Redis | |
246 | Group: Libraries | |
247 | Requires: %{name} = %{version}-%{release} | |
248 | ||
249 | %description module-redis | |
250 | Redis destination support module for syslog-ng (via libhiredis). | |
251 | ||
252 | %description module-redis -l pl.UTF-8 | |
253 | Moduł sysloga-ng do obsługi zapisu logów w bazie Redis (poprzez | |
254 | libhiredis). | |
255 | ||
2890986e JB |
256 | %package module-riemann |
257 | Summary: Riemann destination support module for syslog-ng | |
258 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów do systemu Riemann | |
259 | Group: Libraries | |
260 | Requires: %{name} = %{version}-%{release} | |
261 | Requires: riemann-c-client >= 1.0.0 | |
262 | ||
263 | %description module-riemann | |
264 | Riemann destination support module for syslog-ng. | |
265 | ||
266 | %description module-riemann -l pl.UTF-8 | |
267 | Moduł sysloga-ng do obsługi zapisu logów do systemu Riemann. | |
268 | ||
06e66789 JB |
269 | %package module-tfgeoip |
270 | Summary: syslog-ng template function module to get GeoIP info from an IPv4 addresses | |
271 | Summary(pl.UTF-8): Moduł funkcji szablonu sysloga-ng do pobierania informacji GeoIP z adresów IPv4 | |
272 | Group: Libraries | |
273 | Requires: %{name} = %{version}-%{release} | |
eebad2d5 | 274 | Requires: GeoIP-db-Country |
06e66789 JB |
275 | Requires: GeoIP-libs >= 1.5.1 |
276 | ||
277 | %description module-tfgeoip | |
278 | syslog-ng template function module to get GeoIP info from an IPv4 | |
279 | addresses. | |
280 | ||
281 | %description module-tfgeoip -l pl.UTF-8 | |
282 | Moduł funkcji szablonu sysloga-ng do pobierania informacji GeoIP z | |
283 | adresów IPv4. | |
284 | ||
cc1675a4 JB |
285 | %package libs |
286 | Summary: Shared library for syslog-ng | |
287 | Summary(pl.UTF-8): Biblioteka współdzielona sysloga-ng | |
288 | Group: Libraries | |
289 | %if %{with dynamic} | |
290 | Requires: eventlog >= 0.2.12 | |
4c650c71 | 291 | Requires: glib2 >= %{glib2_ver} |
fd7236ec | 292 | %{?with_system_libivykis:Requires: libivykis >= 0.42} |
cc1675a4 JB |
293 | Requires: pcre >= 6.1 |
294 | %endif | |
295 | Conflicts: syslog-ng < 3.3.1-3 | |
296 | ||
297 | %description libs | |
298 | Shared library for syslog-ng. | |
299 | ||
300 | %description libs -l pl.UTF-8 | |
301 | Biblioteka współdzielona sysloga-ng. | |
302 | ||
303 | %package devel | |
304 | Summary: Header files for syslog-ng modules development | |
305 | Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia modułów dla sysloga-ng | |
306 | Group: Development/Libraries | |
307 | Requires: %{name}-libs = %{version}-%{release} | |
308 | %if %{with dynamic} | |
309 | Requires: eventlog-devel >= 0.2.12 | |
4c650c71 | 310 | Requires: glib2-devel >= %{glib2_ver} |
fd7236ec | 311 | %{?with_system_libivykis:Requires: libivykis-devel >= 0.42} |
cc1675a4 JB |
312 | Requires: pcre-devel >= 6.1 |
313 | %endif | |
314 | ||
315 | %description devel | |
316 | Header files for syslog-ng modules development. | |
317 | ||
318 | %description devel -l pl.UTF-8 | |
319 | Pliki nagłówkowe do tworzenia modułów dla sysloga-ng. | |
320 | ||
db55bc6c | 321 | %prep |
fd7236ec | 322 | %setup -q -n %{name}-%{name}-%{version} |
489ceddf | 323 | %patch0 -p1 |
3b8a2194 | 324 | %patch1 -p1 |
38883b2f | 325 | %patch2 -p1 |
17524264 | 326 | %patch3 -p1 |
cd31ca9b | 327 | %patch4 -p1 |
118f372b | 328 | %patch5 -p1 |
db1b62f6 ER |
329 | cp -p %{SOURCE4} doc |
330 | cp -p %{SOURCE5} contrib/syslog-ng.conf.simple | |
b6fee34c | 331 | |
cec64641 JR |
332 | %{__sed} -i -e 's|/usr/bin/awk|/bin/awk|' scl/syslogconf/convert-syslogconf.awk |
333 | ||
db55bc6c | 334 | %build |
fd7236ec | 335 | for i in . ; do |
5fe1f11f AM |
336 | cd $i |
337 | %{__libtoolize} | |
4b94cfad | 338 | %{__aclocal} `[ -d m4 ] && echo '-I m4'` |
5fe1f11f | 339 | %{__autoconf} |
585ae33b | 340 | %{__autoheader} |
5fe1f11f AM |
341 | %{__automake} |
342 | cd - | |
343 | done | |
c67bc54f | 344 | %configure \ |
8eca2e89 | 345 | --sysconfdir=%{_sysconfdir}/syslog-ng \ |
db1b62f6 | 346 | --disable-silent-rules \ |
7e54a951 | 347 | --with-default-modules=affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat \ |
35b01c3c | 348 | --with-docbook=%{xsl_stylesheets_dir}/manpages/docbook.xsl \ |
eebad2d5 JR |
349 | --enable-java%{!?with_java:=no} \ |
350 | --enable-java-modules%{!?with_java:=no} \ | |
351 | --enable-python%{!?with_python:=no} \ | |
18bd7ab6 JK |
352 | %if %{with mongodb} |
353 | --enable-mongodb \ | |
78780d53 | 354 | --with-mongoc=system \ |
18bd7ab6 JK |
355 | %else |
356 | --disable-mongodb \ | |
357 | %endif | |
c6011c69 | 358 | %if %{with system_libivykis} |
4c3de3cf | 359 | --with-ivykis=system \ |
c6011c69 MK |
360 | %else |
361 | --with-ivykis=internal \ | |
362 | %endif | |
8fd1a6f4 | 363 | %{?with_system_rabbitmq:--with-librabbitmq-client=system} \ |
be957de7 | 364 | --with-module-dir=%{moduledir} \ |
808ca97e | 365 | --with-pidfile-dir=/var/run \ |
6d708cb5 | 366 | --with-systemdsystemunitdir=%{systemdunitdir} \ |
be957de7 | 367 | --with-timezone-dir=%{_datadir}/zoneinfo \ |
c612fe0c | 368 | %{__enable_disable amqp} \ |
312323d8 | 369 | --enable-geoip%{!?with_geoip:=no} \ |
d3133019 | 370 | --enable-http%{!?with_http:=no} \ |
808ca97e | 371 | --enable-ipv6 \ |
06e66789 | 372 | --enable-json%{!?with_json:=no} \ |
808ca97e | 373 | --enable-linux-caps \ |
35b01c3c | 374 | --enable-manpages \ |
1fe2e76c | 375 | --enable-pacct \ |
4a7ca8b7 | 376 | --enable-pcre \ |
011ba713 | 377 | --enable-redis%{!?with_redis:=no} \ |
35b01c3c | 378 | --enable-riemann%{!?with_riemann:=no} \ |
06e66789 | 379 | --enable-smtp%{!?with_smtp:=no} \ |
4a7ca8b7 JB |
380 | --enable-spoof-source \ |
381 | --enable-ssl \ | |
be957de7 | 382 | --enable-systemd%{!?with_systemd:=no} \ |
4a7ca8b7 | 383 | --enable-tcp-wrapper \ |
808ca97e JR |
384 | %if %{with sql} |
385 | --enable-sql \ | |
386 | %endif | |
8eca2e89 JB |
387 | %if %{with dynamic} |
388 | --enable-dynamic-linking | |
bb38cad4 JR |
389 | %else |
390 | --enable-mixed-linking | |
8eca2e89 | 391 | %endif |
4298f6c0 | 392 | |
35b01c3c JB |
393 | %{__make} |
394 | ||
db55bc6c | 395 | |
cc1675a4 | 396 | %if %{with tests} |
b7fea326 AM |
397 | LD_LIBRARY_PATH=$(find $PWD -name '*.so*' -printf "%h:") |
398 | PYTHONPATH=$(pwd)/tests/functional | |
399 | export LD_LIBRARY_PATH PYTHONPATH | |
cc1675a4 JB |
400 | %{__make} check |
401 | %endif | |
f3688193 | 402 | |
db55bc6c | 403 | %install |
db55bc6c | 404 | rm -rf $RPM_BUILD_ROOT |
6277303e | 405 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d} \ |
303be384 | 406 | $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/patterndb.d \ |
cd6284ba | 407 | $RPM_BUILD_ROOT/var/{log,lib/%{name}/xsd} |
db55bc6c | 408 | |
1fe2e76c | 409 | %{__make} -j1 install \ |
80a5deba | 410 | pkgconfigdir=%{_pkgconfigdir} \ |
4d7c194a | 411 | DESTDIR=$RPM_BUILD_ROOT |
db55bc6c | 412 | |
be957de7 JB |
413 | %if "%{slibdir}" != "%{_libdir}" |
414 | install -d $RPM_BUILD_ROOT%{slibdir} | |
118f372b JB |
415 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libsyslog-ng-%{mver}.so.* $RPM_BUILD_ROOT%{slibdir} |
416 | ln -snf %{slibdir}/$(basename $RPM_BUILD_ROOT%{slibdir}/libsyslog-ng-%{mver}.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libsyslog-ng.so | |
78780d53 AM |
417 | |
418 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libevtlog-%{mver}.so.* $RPM_BUILD_ROOT%{slibdir} | |
419 | ln -snf %{slibdir}/$(basename $RPM_BUILD_ROOT%{slibdir}/libevtlog-%{mver}.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libevtlog.so | |
420 | ||
421 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libsecret-storage.so.* $RPM_BUILD_ROOT%{slibdir} | |
422 | ln -snf %{slibdir}/$(basename $RPM_BUILD_ROOT%{slibdir}/libsecret-storage.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libsecret-storage.so | |
be957de7 JB |
423 | %endif |
424 | ||
544d8db5 | 425 | %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng |
db1b62f6 ER |
426 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf |
427 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng | |
db55bc6c | 428 | |
6d64ef6a | 429 | for n in cron daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog; do |
3fb60e3b JR |
430 | > $RPM_BUILD_ROOT/var/log/$n |
431 | done | |
2a14aff2 | 432 | touch $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
db55bc6c | 433 | |
78780d53 AM |
434 | %{__rm} $RPM_BUILD_ROOT%{_sbindir}/syslog-ng-debun |
435 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/syslog-ng-debun.1 | |
04316877 | 436 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la |
118f372b | 437 | %{__rm} $RPM_BUILD_ROOT%{moduledir}/*.la |
f2972fae | 438 | |
80a87a81 JB |
439 | %clean |
440 | rm -rf $RPM_BUILD_ROOT | |
441 | ||
db55bc6c | 442 | %post |
1519c9ad ER |
443 | if [ "$1" = "1" ]; then |
444 | # disable /proc/kmsg from config on first install on vserver | |
445 | { | |
446 | while read f ctx; do | |
447 | [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break | |
448 | done </proc/self/status | |
449 | } 2>/dev/null | |
450 | if [ -z "$ctx" -o "$ctx" = "0" ]; then | |
451 | VSERVER=no | |
452 | else | |
453 | VSERVER=yes | |
454 | fi | |
455 | if [ "$VSERVER" = "yes" ]; then | |
456 | %{__sed} -i -e '/\/proc\/kmsg/ s/^[^#]/#&/' %{_sysconfdir}/%{name}/%{name}.conf | |
457 | fi | |
458 | fi | |
459 | ||
0b833f9b | 460 | /sbin/chkconfig --add syslog-ng |
da4f5bde | 461 | %service syslog-ng restart "syslog-ng daemon" |
db55bc6c | 462 | |
fd7236ec | 463 | %systemd_post syslog-ng@.service |
34031399 | 464 | |
db55bc6c | 465 | %preun |
0b833f9b | 466 | if [ "$1" = "0" ]; then |
da4f5bde | 467 | %service syslog-ng stop |
0b833f9b | 468 | /sbin/chkconfig --del syslog-ng |
469 | fi | |
fd7236ec | 470 | %systemd_preun syslog-ng@.service |
34031399 JR |
471 | |
472 | %postun | |
473 | %systemd_reload | |
474 | ||
475 | %triggerpostun -- syslog-ng < 3.3.4-3 | |
fd7236ec | 476 | %systemd_trigger syslog-ng@.service |
db55bc6c | 477 | |
31446e62 | 478 | %triggerun -- syslog-ng < 3.0 |
60bdc15a | 479 | sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
480 | sed -i -e 's#pipe ("/proc/kmsg"#file ("/proc/kmsg"#g' /etc/syslog-ng/syslog-ng.conf |
481 | sed -i -e 's#log_prefix#program_override#g' /etc/syslog-ng/syslog-ng.conf | |
482 | sed -i -e 's#^destination #destination d_#g' /etc/syslog-ng/syslog-ng.conf | |
483 | sed -i -e 's#destination(#destination(d_#g' /etc/syslog-ng/syslog-ng.conf | |
01113c19 | 484 | sed -i -e 's,\bstats\b,stats_freq,' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
485 | sed -i -e 's#match("IN\=\[A-Za-z0-9\]\* OUT=\[A-Za-z0-9\]\*");#match("IN=[A-Za-z0-9]* OUT=[A-Za-z0-9]*" value("MESSAGE"));#g' /etc/syslog-ng/syslog-ng.conf |
486 | sed -i -e "1 s#\(.*\)\$#@version: 3.0\n\1#g" /etc/syslog-ng/syslog-ng.conf | |
487 | rm -f %{_var}/lib/%{name}/syslog-ng.persist | |
e3a52627 | 488 | %service -q syslog-ng restart |
31446e62 AM |
489 | exit 0 |
490 | ||
cc1675a4 JB |
491 | %post libs -p /sbin/ldconfig |
492 | %postun libs -p /sbin/ldconfig | |
493 | ||
db55bc6c | 494 | %files |
a25388f3 | 495 | %defattr(644,root,root,755) |
fd7236ec | 496 | %doc AUTHORS NEWS.md contrib/relogger.pl |
04316877 | 497 | %doc contrib/syslog-ng.conf.{doc,simple,RedHat} |
78780d53 | 498 | %doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-ose-v%{docmver}-guide-admin.pdf |
2a14aff2 | 499 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
a25388f3 | 500 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng |
303be384 | 501 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng/patterndb.d |
bb38cad4 | 502 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/scl.conf |
cc4597b5 ER |
503 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/syslog-ng.conf |
504 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng | |
a25388f3 | 505 | %attr(754,root,root) /etc/rc.d/init.d/syslog-ng |
fd7236ec | 506 | %{systemdunitdir}/syslog-ng@.service |
be957de7 | 507 | %dir %{moduledir} |
d3133019 | 508 | %attr(755,root,root) %{moduledir}/libadd-contextual-data.so |
c612fe0c | 509 | %if %{with amqp} |
be957de7 | 510 | %attr(755,root,root) %{moduledir}/libafamqp.so |
c612fe0c | 511 | %endif |
be957de7 JB |
512 | %attr(755,root,root) %{moduledir}/libaffile.so |
513 | %attr(755,root,root) %{moduledir}/libafprog.so | |
514 | %attr(755,root,root) %{moduledir}/libafsocket.so | |
be957de7 JB |
515 | %attr(755,root,root) %{moduledir}/libafstomp.so |
516 | %attr(755,root,root) %{moduledir}/libafuser.so | |
78780d53 | 517 | %attr(755,root,root) %{moduledir}/libappmodel.so |
be957de7 | 518 | %attr(755,root,root) %{moduledir}/libbasicfuncs.so |
d3133019 | 519 | %attr(755,root,root) %{moduledir}/libcef.so |
be957de7 JB |
520 | %attr(755,root,root) %{moduledir}/libconfgen.so |
521 | %attr(755,root,root) %{moduledir}/libcryptofuncs.so | |
522 | %attr(755,root,root) %{moduledir}/libcsvparser.so | |
d3133019 | 523 | %attr(755,root,root) %{moduledir}/libdate.so |
be957de7 | 524 | %attr(755,root,root) %{moduledir}/libdbparser.so |
d3133019 | 525 | %attr(755,root,root) %{moduledir}/libdisk-buffer.so |
78780d53 | 526 | %attr(755,root,root) %{moduledir}/libgeoip2-plugin.so |
2890986e | 527 | %attr(755,root,root) %{moduledir}/libgraphite.so |
e803f395 | 528 | %attr(755,root,root) %{moduledir}/libkvformat.so |
be957de7 | 529 | %attr(755,root,root) %{moduledir}/liblinux-kmsg-format.so |
78780d53 | 530 | %attr(755,root,root) %{moduledir}/libmap-value-pairs.so |
be957de7 | 531 | %attr(755,root,root) %{moduledir}/libpacctformat.so |
2890986e | 532 | %attr(755,root,root) %{moduledir}/libpseudofile.so |
78780d53 AM |
533 | %attr(755,root,root) %{moduledir}/libsnmptrapd-parser.so |
534 | %attr(755,root,root) %{moduledir}/libstardate.so | |
535 | %attr(755,root,root) %{moduledir}/libtags-parser.so | |
536 | %attr(755,root,root) %{moduledir}/libtfgetent.so | |
537 | %attr(755,root,root) %{moduledir}/libxml.so | |
2890986e JB |
538 | %if %{with systemd} |
539 | %attr(755,root,root) %{moduledir}/libsdjournal.so | |
540 | %endif | |
be957de7 JB |
541 | %attr(755,root,root) %{moduledir}/libsyslogformat.so |
542 | %attr(755,root,root) %{moduledir}/libsystem-source.so | |
302dff3f | 543 | %attr(755,root,root) %{_sbindir}/syslog-ng |
bb38cad4 | 544 | %attr(755,root,root) %{_sbindir}/syslog-ng-ctl |
d3133019 | 545 | %attr(755,root,root) %{_bindir}/dqtool |
31da20fc | 546 | %attr(755,root,root) %{_bindir}/loggen |
ceea8d15 | 547 | %attr(755,root,root) %{_bindir}/pdbtool |
303be384 | 548 | %attr(755,root,root) %{_bindir}/update-patterndb |
a0237816 | 549 | |
a0237816 JR |
550 | %dir %{_datadir}/syslog-ng/include |
551 | %dir %{_datadir}/syslog-ng/include/scl | |
78780d53 AM |
552 | %{_datadir}/syslog-ng/include/scl/apache |
553 | %{_datadir}/syslog-ng/include/scl/default-network-drivers | |
e803f395 | 554 | %{_datadir}/syslog-ng/include/scl/elasticsearch |
78780d53 | 555 | %{_datadir}/syslog-ng/include/scl/graphite |
e803f395 | 556 | %{_datadir}/syslog-ng/include/scl/hdfs |
e803f395 | 557 | %{_datadir}/syslog-ng/include/scl/kafka |
78780d53 AM |
558 | #%{_datadir}/syslog-ng/include/scl/iptables |
559 | %dir %{_datadir}/syslog-ng/include/scl/loadbalancer | |
560 | %attr(755,root,root) %{_datadir}/syslog-ng/include/scl/loadbalancer/gen-loadbalancer.sh | |
561 | %{_datadir}/syslog-ng/include/scl/loadbalancer/plugin.conf | |
562 | %{_datadir}/syslog-ng/include/scl/loggly | |
563 | %{_datadir}/syslog-ng/include/scl/logmatic | |
e803f395 | 564 | %{_datadir}/syslog-ng/include/scl/mbox |
78780d53 AM |
565 | %{_datadir}/syslog-ng/include/scl/nodejs |
566 | %{_datadir}/syslog-ng/include/scl/osquery | |
567 | %{_datadir}/syslog-ng/include/scl/pacct | |
568 | %{_datadir}/syslog-ng/include/scl/rewrite | |
569 | %{_datadir}/syslog-ng/include/scl/snmptrap | |
e803f395 | 570 | %{_datadir}/syslog-ng/include/scl/solaris |
78780d53 AM |
571 | #%{_datadir}/syslog-ng/include/scl/sudo |
572 | %{_datadir}/syslog-ng/include/scl/windowseventlog | |
a0237816 JR |
573 | %dir %{_datadir}/syslog-ng/include/scl/syslogconf |
574 | %{_datadir}/syslog-ng/include/scl/syslogconf/README | |
575 | %attr(755,root,root) %{_datadir}/syslog-ng/include/scl/syslogconf/convert-syslogconf.awk | |
576 | %{_datadir}/syslog-ng/include/scl/syslogconf/plugin.conf | |
78780d53 AM |
577 | %{_datadir}/syslog-ng/include/scl/system |
578 | %{_datadir}/syslog-ng/xsd | |
a0237816 | 579 | |
4d910d4c | 580 | %dir %{_var}/lib/%{name} |
cd6284ba | 581 | %dir %{_var}/lib/%{name}/xsd |
78780d53 | 582 | %{_mandir}/man1/dqtool.1* |
31da20fc | 583 | %{_mandir}/man1/loggen.1* |
ceea8d15 | 584 | %{_mandir}/man1/pdbtool.1* |
bb38cad4 | 585 | %{_mandir}/man1/syslog-ng-ctl.1* |
81f47e04 JB |
586 | %{_mandir}/man5/syslog-ng.conf.5* |
587 | %{_mandir}/man8/syslog-ng.8* | |
822b8fbf | 588 | |
6d64ef6a BS |
589 | %attr(640,root,logs) %ghost /var/log/cron |
590 | %attr(640,root,logs) %ghost /var/log/daemon | |
591 | %attr(640,root,logs) %ghost /var/log/debug | |
592 | %attr(640,root,logs) %ghost /var/log/iptables | |
593 | %attr(640,root,logs) %ghost /var/log/kernel | |
594 | %attr(640,root,logs) %ghost /var/log/lpr | |
595 | %attr(640,root,logs) %ghost /var/log/maillog | |
596 | %attr(640,root,logs) %ghost /var/log/messages | |
597 | %attr(640,root,logs) %ghost /var/log/secure | |
598 | %attr(640,root,logs) %ghost /var/log/spooler | |
599 | %attr(640,root,logs) %ghost /var/log/syslog | |
600 | %attr(640,root,logs) %ghost /var/log/user | |
601 | %attr(640,root,logs) %ghost /var/log/xferlog | |
c3d7f31f | 602 | |
18bd7ab6 | 603 | %if %{with mongodb} |
4c650c71 JB |
604 | %files module-afmongodb |
605 | %defattr(644,root,root,755) | |
be957de7 | 606 | %attr(755,root,root) %{moduledir}/libafmongodb.so |
18bd7ab6 | 607 | %endif |
4c650c71 | 608 | |
24e8f380 MK |
609 | %if %{with smtp} |
610 | %files module-afsmtp | |
611 | %defattr(644,root,root,755) | |
be957de7 | 612 | %attr(755,root,root) %{moduledir}/libafsmtp.so |
24e8f380 MK |
613 | %endif |
614 | ||
5f709b4d | 615 | %if %{with sql} |
4c650c71 JB |
616 | %files module-afsql |
617 | %defattr(644,root,root,755) | |
be957de7 | 618 | %attr(755,root,root) %{moduledir}/libafsql.so |
5f709b4d | 619 | %endif |
4c650c71 | 620 | |
d3133019 JR |
621 | %if %{with http} |
622 | %files module-http | |
623 | %defattr(644,root,root,755) | |
fd7236ec | 624 | %attr(755,root,root) %{moduledir}/libhttp.so |
d3133019 JR |
625 | %endif |
626 | ||
18bd7ab6 | 627 | %if %{with json} |
24e8f380 | 628 | %files module-json-plugin |
4c650c71 | 629 | %defattr(644,root,root,755) |
be957de7 | 630 | %attr(755,root,root) %{moduledir}/libjson-plugin.so |
b17a2ded | 631 | %{_datadir}/syslog-ng/include/scl/cim |
78780d53 AM |
632 | %{_datadir}/syslog-ng/include/scl/cisco |
633 | %{_datadir}/syslog-ng/include/scl/ewmm | |
634 | %{_datadir}/syslog-ng/include/scl/graylog2 | |
18bd7ab6 | 635 | %endif |
4c650c71 | 636 | |
011ba713 JB |
637 | %if %{with redis} |
638 | %files module-redis | |
639 | %defattr(644,root,root,755) | |
be957de7 | 640 | %attr(755,root,root) %{moduledir}/libredis.so |
011ba713 JB |
641 | %endif |
642 | ||
2890986e JB |
643 | %if %{with riemann} |
644 | %files module-riemann | |
645 | %defattr(644,root,root,755) | |
646 | %attr(755,root,root) %{moduledir}/libriemann.so | |
647 | %endif | |
648 | ||
312323d8 | 649 | %if %{with geoip} |
06e66789 JB |
650 | %files module-tfgeoip |
651 | %defattr(644,root,root,755) | |
e803f395 | 652 | %attr(755,root,root) %{moduledir}/libgeoip-plugin.so |
312323d8 | 653 | %endif |
06e66789 | 654 | |
cc1675a4 JB |
655 | %files libs |
656 | %defattr(644,root,root,755) | |
78780d53 AM |
657 | %attr(755,root,root) %{slibdir}/libevtlog-%{mver}.so.*.*.* |
658 | %attr(755,root,root) %{slibdir}/libevtlog-%{mver}.so.0 | |
659 | %attr(755,root,root) %{slibdir}/libsecret-storage.so.*.*.* | |
660 | %attr(755,root,root) %{slibdir}/libsecret-storage.so.0 | |
be957de7 JB |
661 | %attr(755,root,root) %{slibdir}/libsyslog-ng-%{mver}.so.*.*.* |
662 | %attr(755,root,root) %ghost %{slibdir}/libsyslog-ng-%{mver}.so.0 | |
cc1675a4 JB |
663 | %dir %{_datadir}/syslog-ng |
664 | ||
665 | %files devel | |
666 | %defattr(644,root,root,755) | |
78780d53 AM |
667 | %attr(755,root,root) %{_libdir}/libevtlog.so |
668 | %attr(755,root,root) %{_libdir}/libsecret-storage.so | |
cc1675a4 | 669 | %attr(755,root,root) %{_libdir}/libsyslog-ng.so |
d3133019 | 670 | %{_libdir}/libsyslog-ng-native-connector.a |
be957de7 JB |
671 | %dir %{_includedir}/syslog-ng |
672 | %{_includedir}/syslog-ng/*.h | |
673 | %{_includedir}/syslog-ng/compat | |
674 | %{_includedir}/syslog-ng/control | |
d3133019 | 675 | %{_includedir}/syslog-ng/debugger |
be957de7 | 676 | %{_includedir}/syslog-ng/filter |
118f372b | 677 | %if %{without system_libivykis} |
35b01c3c JB |
678 | %{_includedir}/syslog-ng/ivykis |
679 | %endif | |
d3133019 | 680 | %{_includedir}/syslog-ng/logmsg |
be957de7 | 681 | %{_includedir}/syslog-ng/logproto |
78780d53 AM |
682 | %dir %{_includedir}/syslog-ng/modules |
683 | %{_includedir}/syslog-ng/modules/add-contextual-data | |
be957de7 JB |
684 | %{_includedir}/syslog-ng/parser |
685 | %{_includedir}/syslog-ng/rewrite | |
d3133019 | 686 | %{_includedir}/syslog-ng/scanner |
be957de7 | 687 | %{_includedir}/syslog-ng/stats |
78780d53 | 688 | %{_includedir}/syslog-ng/str-repr |
be957de7 JB |
689 | %{_includedir}/syslog-ng/template |
690 | %{_includedir}/syslog-ng/transport | |
d3133019 | 691 | %{_includedir}/syslog-ng/value-pairs |
cc1675a4 JB |
692 | %{_datadir}/syslog-ng/tools |
693 | %{_pkgconfigdir}/syslog-ng.pc | |
78780d53 | 694 | %{_pkgconfigdir}/syslog-ng-add-contextual-data.pc |
d3133019 | 695 | %{_pkgconfigdir}/syslog-ng-native-connector.pc |
be957de7 JB |
696 | |
697 | # test-devel ? | |
698 | %if "%{_libdir}/syslog-ng" != "{moduledir}" | |
699 | %dir %{_libdir}/syslog-ng | |
700 | %endif | |
701 | %dir %{_libdir}/syslog-ng/libtest | |
702 | %{_libdir}/syslog-ng/libtest/libsyslog-ng-test.a | |
703 | %{_includedir}/syslog-ng/libtest | |
704 | %{_pkgconfigdir}/syslog-ng-test.pc |