]>
Commit | Line | Data |
---|---|---|
5aa38709 | 1 | # |
cec64641 | 2 | # TODO: |
cc1675a4 JB |
3 | # - relies on libs in /usr which is wrong |
4 | # (well, for modules bringing additional functionality it's acceptable IMO --q) | |
cec64641 | 5 | # |
8eca2e89 | 6 | # Conditional build: |
cc1675a4 | 7 | %bcond_with dynamic # link dynamically with glib, eventlog, pcre (modules are always linked dynamically) |
306cd2c9 | 8 | %if "%{pld_release}" == "ac" |
544d8db5 | 9 | %bcond_with sql # build with support for logging to SQL DB |
306cd2c9 | 10 | %else |
808ca97e | 11 | %bcond_without sql # build without support for logging to SQL DB |
306cd2c9 | 12 | %endif |
f3688193 | 13 | %bcond_without tests |
18bd7ab6 JK |
14 | %bcond_without json # build without support for JSON template formatting |
15 | %bcond_without mongodb # build without support for mongodb destination | |
24e8f380 | 16 | %bcond_without smtp # build without support for logging into SMTP |
5461d50b | 17 | |
306cd2c9 | 18 | %if "%{pld_release}" == "ac" |
4c650c71 | 19 | %define glib2_ver 1:2.16.0 |
306cd2c9 | 20 | %else |
4c650c71 | 21 | %define glib2_ver 1:2.24.0 |
306cd2c9 | 22 | %endif |
80a87a81 | 23 | Summary: Syslog-ng - new generation of the system logger |
cc1675a4 | 24 | Summary(pl.UTF-8): Syslog-ng - systemowy demon logujący nowej generacji |
f7affeae | 25 | Summary(pt_BR.UTF-8): Daemon de log nova geração |
db55bc6c | 26 | Name: syslog-ng |
887b46ca | 27 | Version: 3.4.2 |
24e8f380 | 28 | Release: 0.2 |
4c650c71 | 29 | License: GPL v2+ with OpenSSL exception |
db55bc6c | 30 | Group: Daemons |
5fe1f11f | 31 | Source0: http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/%{version}/source/%{name}_%{version}.tar.gz |
887b46ca | 32 | # Source0-md5: 2e32c5fedc067dd83a363c0316b29fb4 |
70c1937a | 33 | Source1: %{name}.init |
34 | Source2: %{name}.conf | |
e0f9b227 | 35 | Source3: %{name}.logrotate |
887b46ca MK |
36 | Source4: http://www.balabit.com/support/documentation/syslog-ng-ose-3.4-guides/en/syslog-ng-ose-v3.4-guide-admin/pdf/syslog-ng-ose-v3.4-guide-admin.pdf |
37 | # Source4-md5: fbc1516a2af9f40d0a7c4929fdf381b1 | |
0872fe7c | 38 | Source5: %{name}-simple.conf |
c3d7f31f | 39 | Source6: %{name}.upstart |
35907845 | 40 | Patch0: %{name}-datadir.patch |
5fe1f11f | 41 | Patch1: cap_syslog-vserver-workaround.patch |
38883b2f | 42 | Patch2: %{name}-nolibs.patch |
17524264 | 43 | Patch3: %{name}-systemd.patch |
42a0f185 | 44 | Patch4: %{name}-am.patch |
887b46ca | 45 | Patch5: %{name}-pacct.patch |
34c905de | 46 | URL: http://www.balabit.com/products/syslog_ng/ |
96ef1ac7 | 47 | BuildRequires: autoconf >= 2.53 |
53500332 | 48 | BuildRequires: automake |
4a7ca8b7 | 49 | BuildRequires: bison >= 2.4 |
cc1675a4 | 50 | BuildRequires: eventlog-devel >= 0.2.12 |
b7fea326 | 51 | %{?with_tests:BuildRequires: findutils} |
ac9ca8e0 | 52 | BuildRequires: flex |
24e8f380 | 53 | BuildRequires: GeoIP-devel >= 1.5.1 |
4c650c71 | 54 | BuildRequires: glib2-devel >= %{glib2_ver} |
18bd7ab6 | 55 | %{?with_json:BuildRequires: json-c-devel >= 0.7} |
cc1675a4 JB |
56 | BuildRequires: libcap-devel |
57 | %{?with_sql:BuildRequires: libdbi-devel >= 0.8.3-2} | |
24e8f380 | 58 | %{?with_sql:BuildRequires: libesmtp-devel} |
4c3de3cf | 59 | BuildRequires: libivykis-devel >= 0.30.1 |
887b46ca | 60 | %{?with_mongodb:BuildRequires: libmongo-client-devel >= 0.1.6} |
cc1675a4 | 61 | BuildRequires: libnet-devel >= 1:1.1.2.1-3 |
4a7ca8b7 | 62 | BuildRequires: libtool >= 2:2.0 |
cc1675a4 JB |
63 | BuildRequires: libwrap-devel |
64 | BuildRequires: openssl-devel >= 0.9.8 | |
65 | BuildRequires: pcre-devel >= 6.1 | |
bf8c4b27 | 66 | BuildRequires: pkgconfig |
306cd2c9 | 67 | BuildRequires: rpm >= 4.4.9-56 |
6d708cb5 | 68 | BuildRequires: rpmbuild(macros) >= 1.623 |
24642adc | 69 | BuildRequires: which |
bc708ef6 | 70 | %if %{with tests} |
306cd2c9 | 71 | %{?with_sql:BuildRequires: libdbi-drivers-sqlite3} |
24642adc | 72 | BuildRequires: python |
73 | BuildRequires: python-modules | |
bc708ef6 AF |
74 | BuildRequires: tzdata |
75 | %endif | |
cc1675a4 | 76 | %if %{without dynamic} |
d132f512 | 77 | BuildRequires: eventlog-static >= 0.2.12 |
4c650c71 | 78 | BuildRequires: glib2-static >= %{glib2_ver} |
b7fea326 | 79 | BuildRequires: libivykis-static >= 0.30.1 |
585ae33b | 80 | BuildRequires: pcre-static >= 6.1 |
808ca97e | 81 | BuildRequires: zlib-static |
8eca2e89 | 82 | %endif |
768882cc | 83 | Requires(post): fileutils |
cc4597b5 | 84 | Requires(post,preun): /sbin/chkconfig |
b3030031 | 85 | Requires(post,preun,postun): systemd-units >= 38 |
cc1675a4 JB |
86 | Requires: %{name}-libs = %{version}-%{release} |
87 | Requires: eventlog >= 0.2.12 | |
4c650c71 | 88 | Requires: glib2 >= %{glib2_ver} |
cc1675a4 | 89 | Requires: pcre >= 6.1 |
0471c4e3 | 90 | Requires: psmisc >= 20.1 |
622aa91c | 91 | Requires: rc-scripts >= 0.4.3.0 |
b3030031 | 92 | Requires: systemd-units >= 38 |
ceea8d15 JB |
93 | # for afsocket |
94 | Requires: libnet >= 1:1.1.2.1-7 | |
95 | # for afsocket and dbparser | |
96 | Requires: openssl >= 0.9.8 | |
34031399 JR |
97 | Provides: service(klogd) |
98 | Provides: service(syslog) | |
18a2d4ea | 99 | Provides: syslogdaemon |
ceea8d15 JB |
100 | Obsoletes: syslog-ng-module-afsocket |
101 | Obsoletes: syslog-ng-module-dbparser | |
c0bb099a | 102 | Obsoletes: syslog-ng-systemd |
5db3c127 | 103 | Conflicts: klogd |
1a409b7d | 104 | Conflicts: msyslog |
240bc451 | 105 | Conflicts: rsyslog |
0baee825 | 106 | Conflicts: syslog |
8a78073d | 107 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
db55bc6c | 108 | |
35907845 AM |
109 | # syslog-ng has really crazy linking rules (see their bugzilla). |
110 | # Some rules, according to syslog-ng devs, are like this: | |
111 | # - libsyslog-ng.so has undefined symbols for third party libraries | |
112 | # and these symbols should go via main syslog-ng binary | |
113 | # - same applies for modules | |
cc1675a4 JB |
114 | # In dynamic case tests are forcily linked with dynamic modules, which doesn't work with as-needed. |
115 | %define filterout_ld -Wl,--as-needed -Wl,--no-copy-dt-needed-entries | |
bb38cad4 JR |
116 | %if %{without dynamic} |
117 | %define no_install_post_check_so 1 | |
118 | %define _sbindir /sbin | |
119 | %define _libdir /%{_lib} | |
120 | %endif | |
121 | ||
db55bc6c | 122 | %description |
a42dcc7c | 123 | syslog-ng is a syslogd replacement for Unix and Unix-like systems. It |
70c1937a | 124 | has been tested on Solaris, BSDi and Linux, and were found to run |
125 | reliably. syslog-ng gives you a much enhanced configuration scheme, | |
126 | which lets you filter messages based on not only priority/facility | |
127 | pairs, but also on message content. You can use regexps to direct log | |
128 | stream to different destinations. A destination can be anything from a | |
129 | simple file to a network connection. syslog-ng supports TCP | |
130 | logforwarding, together with hashing to prevent unauthorized | |
131 | modification on the line. | |
db55bc6c | 132 | |
6ab9000c JR |
133 | %description -l pl.UTF-8 |
134 | Syslog-ng jest zamiennikiem dla standardowo używanych programów typu | |
a42dcc7c | 135 | syslog. Działa w systemie SunOS, BSD, Linux. Daje znacznie większe |
6ab9000c | 136 | możliwości logowania i kontrolowania zbieranych informacji. |
db55bc6c | 137 | |
6ab9000c JR |
138 | %description -l pt_BR.UTF-8 |
139 | Syslog-ng é um substituto para o syslog tradicional, mas com diversas | |
02e7b20a | 140 | melhorias, como, por exemplo, a habilidade de filtrar mensagens de log |
6ab9000c | 141 | por seu conteúdo (usando expressões regulares) e não apenas pelo par |
02e7b20a | 142 | facility/prioridade como o syslog original. |
143 | ||
c3d7f31f JK |
144 | %package upstart |
145 | Summary: Upstart job description for syslog-ng | |
4a7ca8b7 | 146 | Summary(pl.UTF-8): Opis zadania Upstart dla demona syslog-ng |
c3d7f31f JK |
147 | Group: Daemons |
148 | Requires: %{name} = %{version}-%{release} | |
149 | Requires: upstart >= 0.6 | |
528e8fc2 JK |
150 | Conflicts: avahi-upstart < 0.6.30-2 |
151 | Conflicts: openssh-server-upstart < 2:5.8p2-2 | |
152 | Conflicts: postgresql-upstart < 9.0.4-2 | |
c3d7f31f JK |
153 | |
154 | %description upstart | |
155 | Upstart job description for syslog-ng. | |
156 | ||
157 | %description upstart -l pl.UTF-8 | |
4a7ca8b7 | 158 | Opis zadania Upstart dla demona syslog-ng. |
c3d7f31f | 159 | |
4c650c71 JB |
160 | %package module-afmongodb |
161 | Summary: MongoDB destination support module for syslog-ng | |
162 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazie MongoDB | |
163 | Group: Libraries | |
164 | Requires: %{name} = %{version}-%{release} | |
165 | Requires: libmongo-client >= 0.1.0 | |
166 | ||
167 | %description module-afmongodb | |
168 | MongoDB destination support module for syslog-ng. | |
169 | ||
170 | %description module-afmongodb -l pl.UTF-8 | |
171 | Moduł sysloga-ng do obsługi zapisu logów w bazie MongoDB. | |
172 | ||
24e8f380 MK |
173 | %package module-afsmtp |
174 | Summary: SMTP output support module for syslog-ng | |
175 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi wysyłania logów do serwerów SMTP | |
176 | Group: Libraries | |
177 | Requires: %{name} = %{version}-%{release} | |
178 | Requires: libdbi >= 0.8.3-2 | |
179 | Requires: openssl >= 0.9.8 | |
180 | ||
181 | %description module-afsmtp | |
182 | SMTP output support module for syslog-ng | |
183 | ||
184 | %description module-afsmtp -l pl.UTF-8 | |
185 | Moduł sysloga-ng do obsługi wysyłania logów do serwerów SMTP | |
186 | ||
4c650c71 JB |
187 | %package module-afsql |
188 | Summary: SQL destination support module for syslog-ng | |
189 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazach SQL | |
190 | Group: Libraries | |
191 | Requires: %{name} = %{version}-%{release} | |
192 | Requires: libdbi >= 0.8.3-2 | |
193 | Requires: openssl >= 0.9.8 | |
194 | ||
195 | %description module-afsql | |
196 | SQL destination support module for syslog-ng (via libdbi). | |
197 | ||
198 | %description module-afsql -l pl.UTF-8 | |
199 | Moduł sysloga-ng do obsługi zapisu logów w bazach SQL (poprzez | |
200 | libdbi). | |
201 | ||
24e8f380 | 202 | %package module-json-plugin |
4c650c71 JB |
203 | Summary: JSON formatting template function for syslog-ng |
204 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON | |
205 | Group: Libraries | |
206 | Requires: %{name} = %{version}-%{release} | |
887b46ca MK |
207 | Requires: json-c >= 0.9 |
208 | Obsoletes: syslog-ng-module-tfjson | |
4c650c71 | 209 | |
24e8f380 | 210 | %description module-json-plugin |
4c650c71 JB |
211 | JSON formatting template function for syslog-ng. |
212 | ||
24e8f380 | 213 | %description module-json-plugin -l pl.UTF-8 |
4c650c71 JB |
214 | Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON. |
215 | ||
cc1675a4 JB |
216 | %package libs |
217 | Summary: Shared library for syslog-ng | |
218 | Summary(pl.UTF-8): Biblioteka współdzielona sysloga-ng | |
219 | Group: Libraries | |
220 | %if %{with dynamic} | |
221 | Requires: eventlog >= 0.2.12 | |
4c650c71 | 222 | Requires: glib2 >= %{glib2_ver} |
4c3de3cf | 223 | Requires: libivykis >= 0.30.1 |
cc1675a4 JB |
224 | Requires: pcre >= 6.1 |
225 | %endif | |
226 | Conflicts: syslog-ng < 3.3.1-3 | |
227 | ||
228 | %description libs | |
229 | Shared library for syslog-ng. | |
230 | ||
231 | %description libs -l pl.UTF-8 | |
232 | Biblioteka współdzielona sysloga-ng. | |
233 | ||
234 | %package devel | |
235 | Summary: Header files for syslog-ng modules development | |
236 | Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia modułów dla sysloga-ng | |
237 | Group: Development/Libraries | |
238 | Requires: %{name}-libs = %{version}-%{release} | |
239 | %if %{with dynamic} | |
240 | Requires: eventlog-devel >= 0.2.12 | |
4c650c71 | 241 | Requires: glib2-devel >= %{glib2_ver} |
4c3de3cf | 242 | Requires: libivykis-devel >= 0.30.1 |
cc1675a4 JB |
243 | Requires: pcre-devel >= 6.1 |
244 | %endif | |
245 | ||
246 | %description devel | |
247 | Header files for syslog-ng modules development. | |
248 | ||
249 | %description devel -l pl.UTF-8 | |
250 | Pliki nagłówkowe do tworzenia modułów dla sysloga-ng. | |
251 | ||
db55bc6c | 252 | %prep |
40b3220e | 253 | %setup -q |
489ceddf | 254 | %patch0 -p1 |
3b8a2194 | 255 | %patch1 -p1 |
38883b2f | 256 | %patch2 -p1 |
17524264 | 257 | %patch3 -p1 |
42a0f185 | 258 | %patch4 -p1 |
887b46ca | 259 | %patch5 -p1 |
0872fe7c | 260 | cp -a %{SOURCE4} doc |
f83d4749 | 261 | cp -a %{SOURCE5} contrib/syslog-ng.conf.simple |
b6fee34c | 262 | |
cec64641 JR |
263 | %{__sed} -i -e 's|/usr/bin/awk|/bin/awk|' scl/syslogconf/convert-syslogconf.awk |
264 | ||
db55bc6c | 265 | %build |
5fe1f11f AM |
266 | for i in . lib/ivykis; do |
267 | cd $i | |
268 | %{__libtoolize} | |
4b94cfad | 269 | %{__aclocal} `[ -d m4 ] && echo '-I m4'` |
5fe1f11f | 270 | %{__autoconf} |
585ae33b | 271 | %{__autoheader} |
5fe1f11f AM |
272 | %{__automake} |
273 | cd - | |
274 | done | |
c67bc54f | 275 | %configure \ |
8eca2e89 | 276 | --sysconfdir=%{_sysconfdir}/syslog-ng \ |
303be384 | 277 | --datadir=%{_datadir}/syslog-ng \ |
7e54a951 | 278 | --with-default-modules=affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat \ |
18bd7ab6 JK |
279 | %if %{with mongodb} |
280 | --enable-mongodb \ | |
752e2969 | 281 | --with-libmongo-client=system \ |
18bd7ab6 JK |
282 | %else |
283 | --disable-mongodb \ | |
284 | %endif | |
4c3de3cf | 285 | --with-ivykis=system \ |
bb38cad4 | 286 | --with-module-dir=%{_libdir}/syslog-ng \ |
808ca97e | 287 | --with-pidfile-dir=/var/run \ |
4a7ca8b7 | 288 | --with-timezone-dir=%{_datadir}/zoneinfo \ |
17524264 | 289 | --enable-systemd \ |
6d708cb5 | 290 | --with-systemdsystemunitdir=%{systemdunitdir} \ |
887b46ca | 291 | --enable-amqp \ |
24e8f380 | 292 | --enable-geoip \ |
808ca97e | 293 | --enable-ipv6 \ |
808ca97e | 294 | --enable-linux-caps \ |
1fe2e76c | 295 | --enable-pacct \ |
4a7ca8b7 | 296 | --enable-pcre \ |
24e8f380 | 297 | %if %{with smtp} |
887b46ca | 298 | --enable-smtp \ |
24e8f380 MK |
299 | %else |
300 | --disable-smtp \ | |
301 | %endif | |
4a7ca8b7 JB |
302 | --enable-spoof-source \ |
303 | --enable-ssl \ | |
304 | --enable-tcp-wrapper \ | |
18bd7ab6 JK |
305 | %if %{with json} |
306 | --enable-json \ | |
307 | %else | |
308 | --disable-json \ | |
309 | %endif | |
808ca97e JR |
310 | %if %{with sql} |
311 | --enable-sql \ | |
312 | %endif | |
8eca2e89 JB |
313 | %if %{with dynamic} |
314 | --enable-dynamic-linking | |
bb38cad4 JR |
315 | %else |
316 | --enable-mixed-linking | |
8eca2e89 | 317 | %endif |
4298f6c0 | 318 | |
84ad47e7 | 319 | %{__make} |
db55bc6c | 320 | |
cc1675a4 | 321 | %if %{with tests} |
b7fea326 AM |
322 | LD_LIBRARY_PATH=$(find $PWD -name '*.so*' -printf "%h:") |
323 | PYTHONPATH=$(pwd)/tests/functional | |
324 | export LD_LIBRARY_PATH PYTHONPATH | |
cc1675a4 JB |
325 | %{__make} check |
326 | %endif | |
f3688193 | 327 | |
db55bc6c | 328 | %install |
db55bc6c | 329 | rm -rf $RPM_BUILD_ROOT |
303be384 JR |
330 | install -d $RPM_BUILD_ROOT/etc/{init,sysconfig,logrotate.d,rc.d/init.d} \ |
331 | $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/patterndb.d \ | |
cd6284ba | 332 | $RPM_BUILD_ROOT/var/{log,lib/%{name}/xsd} |
db55bc6c | 333 | |
1fe2e76c | 334 | %{__make} -j1 install \ |
80a5deba | 335 | pkgconfigdir=%{_pkgconfigdir} \ |
4d7c194a | 336 | DESTDIR=$RPM_BUILD_ROOT |
db55bc6c | 337 | |
544d8db5 | 338 | %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng |
306cd2c9 ER |
339 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf |
340 | cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng | |
db55bc6c | 341 | |
306cd2c9 | 342 | for n in daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog; do |
3fb60e3b JR |
343 | > $RPM_BUILD_ROOT/var/log/$n |
344 | done | |
2a14aff2 | 345 | touch $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
db55bc6c | 346 | |
bb38cad4 | 347 | %{__rm} $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}/loggen* |
04316877 | 348 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la |
bb38cad4 | 349 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/syslog-ng/*.la |
f2972fae | 350 | |
306cd2c9 | 351 | %if "%{pld_release}" == "th" |
59aab0b4 | 352 | %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE6} > $RPM_BUILD_ROOT/etc/init/%{name}.conf |
306cd2c9 | 353 | %endif |
c3d7f31f | 354 | |
80a87a81 JB |
355 | %clean |
356 | rm -rf $RPM_BUILD_ROOT | |
357 | ||
db55bc6c | 358 | %post |
1519c9ad ER |
359 | if [ "$1" = "1" ]; then |
360 | # disable /proc/kmsg from config on first install on vserver | |
361 | { | |
362 | while read f ctx; do | |
363 | [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break | |
364 | done </proc/self/status | |
365 | } 2>/dev/null | |
366 | if [ -z "$ctx" -o "$ctx" = "0" ]; then | |
367 | VSERVER=no | |
368 | else | |
369 | VSERVER=yes | |
370 | fi | |
371 | if [ "$VSERVER" = "yes" ]; then | |
372 | %{__sed} -i -e '/\/proc\/kmsg/ s/^[^#]/#&/' %{_sysconfdir}/%{name}/%{name}.conf | |
373 | fi | |
374 | fi | |
375 | ||
0b833f9b | 376 | /sbin/chkconfig --add syslog-ng |
da4f5bde | 377 | %service syslog-ng restart "syslog-ng daemon" |
db55bc6c | 378 | |
34031399 JR |
379 | %systemd_post syslog-ng.service |
380 | ||
db55bc6c | 381 | %preun |
0b833f9b | 382 | if [ "$1" = "0" ]; then |
da4f5bde | 383 | %service syslog-ng stop |
0b833f9b | 384 | /sbin/chkconfig --del syslog-ng |
385 | fi | |
34031399 JR |
386 | %systemd_preun syslog-ng.service |
387 | ||
388 | %postun | |
389 | %systemd_reload | |
390 | ||
391 | %triggerpostun -- syslog-ng < 3.3.4-3 | |
392 | %systemd_trigger syslog-ng.service | |
db55bc6c | 393 | |
31446e62 | 394 | %triggerun -- syslog-ng < 3.0 |
60bdc15a | 395 | sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
396 | sed -i -e 's#pipe ("/proc/kmsg"#file ("/proc/kmsg"#g' /etc/syslog-ng/syslog-ng.conf |
397 | sed -i -e 's#log_prefix#program_override#g' /etc/syslog-ng/syslog-ng.conf | |
398 | sed -i -e 's#^destination #destination d_#g' /etc/syslog-ng/syslog-ng.conf | |
399 | sed -i -e 's#destination(#destination(d_#g' /etc/syslog-ng/syslog-ng.conf | |
01113c19 | 400 | sed -i -e 's,\bstats\b,stats_freq,' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
401 | 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 |
402 | sed -i -e "1 s#\(.*\)\$#@version: 3.0\n\1#g" /etc/syslog-ng/syslog-ng.conf | |
403 | rm -f %{_var}/lib/%{name}/syslog-ng.persist | |
e3a52627 | 404 | %service -q syslog-ng restart |
31446e62 AM |
405 | exit 0 |
406 | ||
cc1675a4 JB |
407 | %post upstart |
408 | %upstart_post %{name} | |
409 | ||
410 | %postun upstart | |
411 | %upstart_postun %{name} | |
412 | ||
413 | %triggerun upstart -- syslog-ng-upstart < 3.2.4-3 | |
414 | # use SERVICE_syslog=y in upstart job environment instead of SERVICE=syslog | |
415 | %{__sed} -i -e 's,SERVICE=syslog,SERVICE_syslog=y,' /etc/init/*.conf || : | |
416 | ||
417 | %post libs -p /sbin/ldconfig | |
418 | %postun libs -p /sbin/ldconfig | |
419 | ||
db55bc6c | 420 | %files |
a25388f3 | 421 | %defattr(644,root,root,755) |
0091ccbb | 422 | %doc AUTHORS ChangeLog NEWS debian/syslog-ng.conf* contrib/relogger.pl |
04316877 | 423 | %doc contrib/syslog-ng.conf.{doc,simple,RedHat} |
887b46ca | 424 | %doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-ose-v3.4-guide-admin.pdf |
2a14aff2 | 425 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
a25388f3 | 426 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng |
303be384 | 427 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng/patterndb.d |
bb38cad4 | 428 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/scl.conf |
cc4597b5 ER |
429 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/syslog-ng.conf |
430 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng | |
a25388f3 | 431 | %attr(754,root,root) /etc/rc.d/init.d/syslog-ng |
34031399 | 432 | %{systemdunitdir}/syslog-ng.service |
bb38cad4 | 433 | %dir %{_libdir}/syslog-ng |
887b46ca | 434 | %attr(755,root,root) %{_libdir}/syslog-ng/libafamqp.so |
4c650c71 JB |
435 | %attr(755,root,root) %{_libdir}/syslog-ng/libaffile.so |
436 | %attr(755,root,root) %{_libdir}/syslog-ng/libafprog.so | |
887b46ca | 437 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsmtp.so |
ceea8d15 JB |
438 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsocket.so |
439 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsocket-notls.so | |
440 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsocket-tls.so | |
4c650c71 JB |
441 | %attr(755,root,root) %{_libdir}/syslog-ng/libafuser.so |
442 | %attr(755,root,root) %{_libdir}/syslog-ng/libbasicfuncs.so | |
443 | %attr(755,root,root) %{_libdir}/syslog-ng/libconfgen.so | |
887b46ca | 444 | %attr(755,root,root) %{_libdir}/syslog-ng/libcryptofuncs.so |
4c650c71 | 445 | %attr(755,root,root) %{_libdir}/syslog-ng/libcsvparser.so |
ceea8d15 | 446 | %attr(755,root,root) %{_libdir}/syslog-ng/libdbparser.so |
4c650c71 JB |
447 | %attr(755,root,root) %{_libdir}/syslog-ng/libpacctformat.so |
448 | %attr(755,root,root) %{_libdir}/syslog-ng/libsyslog-ng-crypto.so | |
449 | %attr(755,root,root) %{_libdir}/syslog-ng/libsyslogformat.so | |
887b46ca | 450 | %attr(755,root,root) %{_libdir}/syslog-ng/libsystem-source.so |
24e8f380 | 451 | %attr(755,root,root) %{_libdir}/syslog-ng/libtfgeoip.so |
302dff3f | 452 | %attr(755,root,root) %{_sbindir}/syslog-ng |
bb38cad4 | 453 | %attr(755,root,root) %{_sbindir}/syslog-ng-ctl |
ceea8d15 | 454 | %attr(755,root,root) %{_bindir}/pdbtool |
303be384 | 455 | %attr(755,root,root) %{_bindir}/update-patterndb |
a0237816 | 456 | |
a0237816 JR |
457 | %dir %{_datadir}/syslog-ng/include |
458 | %dir %{_datadir}/syslog-ng/include/scl | |
459 | %dir %{_datadir}/syslog-ng/include/scl/pacct | |
460 | %{_datadir}/syslog-ng/include/scl/pacct/plugin.conf | |
461 | %dir %{_datadir}/syslog-ng/include/scl/syslogconf | |
462 | %{_datadir}/syslog-ng/include/scl/syslogconf/README | |
463 | %attr(755,root,root) %{_datadir}/syslog-ng/include/scl/syslogconf/convert-syslogconf.awk | |
464 | %{_datadir}/syslog-ng/include/scl/syslogconf/plugin.conf | |
465 | %dir %{_datadir}/syslog-ng/include/scl/system | |
a0237816 JR |
466 | %{_datadir}/syslog-ng/include/scl/system/plugin.conf |
467 | %dir %{_datadir}/syslog-ng/xsd | |
468 | %{_datadir}/syslog-ng/xsd/patterndb-*.xsd | |
469 | ||
4d910d4c | 470 | %dir %{_var}/lib/%{name} |
cd6284ba | 471 | %dir %{_var}/lib/%{name}/xsd |
ceea8d15 | 472 | %{_mandir}/man1/pdbtool.1* |
bb38cad4 | 473 | %{_mandir}/man1/syslog-ng-ctl.1* |
81f47e04 JB |
474 | %{_mandir}/man5/syslog-ng.conf.5* |
475 | %{_mandir}/man8/syslog-ng.8* | |
822b8fbf | 476 | |
cc1675a4 JB |
477 | %attr(640,root,root) %ghost /var/log/daemon |
478 | %attr(640,root,root) %ghost /var/log/debug | |
479 | %attr(640,root,root) %ghost /var/log/iptables | |
480 | %attr(640,root,root) %ghost /var/log/kernel | |
481 | %attr(640,root,root) %ghost /var/log/lpr | |
482 | %attr(640,root,root) %ghost /var/log/maillog | |
483 | %attr(640,root,root) %ghost /var/log/messages | |
484 | %attr(640,root,root) %ghost /var/log/secure | |
485 | %attr(640,root,root) %ghost /var/log/spooler | |
486 | %attr(640,root,root) %ghost /var/log/syslog | |
487 | %attr(640,root,root) %ghost /var/log/user | |
488 | %attr(640,root,root) %ghost /var/log/xferlog | |
c3d7f31f | 489 | |
306cd2c9 | 490 | %if "%{pld_release}" == "th" |
c3d7f31f JK |
491 | %files upstart |
492 | %defattr(644,root,root,755) | |
493 | %config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf | |
306cd2c9 | 494 | %endif |
cc1675a4 | 495 | |
18bd7ab6 | 496 | %if %{with mongodb} |
4c650c71 JB |
497 | %files module-afmongodb |
498 | %defattr(644,root,root,755) | |
4c650c71 | 499 | %attr(755,root,root) %{_libdir}/syslog-ng/libafmongodb.so |
18bd7ab6 | 500 | %endif |
4c650c71 | 501 | |
24e8f380 MK |
502 | %if %{with smtp} |
503 | %files module-afsmtp | |
504 | %defattr(644,root,root,755) | |
505 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsmtp.so | |
506 | %endif | |
507 | ||
5f709b4d | 508 | %if %{with sql} |
4c650c71 JB |
509 | %files module-afsql |
510 | %defattr(644,root,root,755) | |
511 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsql.so | |
5f709b4d | 512 | %endif |
4c650c71 | 513 | |
18bd7ab6 | 514 | %if %{with json} |
24e8f380 | 515 | %files module-json-plugin |
4c650c71 | 516 | %defattr(644,root,root,755) |
887b46ca | 517 | %attr(755,root,root) %{_libdir}/syslog-ng/libjson-plugin.so |
18bd7ab6 | 518 | %endif |
4c650c71 | 519 | |
cc1675a4 JB |
520 | %files libs |
521 | %defattr(644,root,root,755) | |
522 | %attr(755,root,root) %{_libdir}/libsyslog-ng-%{version}.so | |
523 | %dir %{_datadir}/syslog-ng | |
524 | ||
525 | %files devel | |
526 | %defattr(644,root,root,755) | |
527 | %attr(755,root,root) %{_libdir}/libsyslog-ng.so | |
528 | %{_includedir}/syslog-ng | |
529 | %{_datadir}/syslog-ng/tools | |
530 | %{_pkgconfigdir}/syslog-ng.pc |