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