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