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