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