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