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