]>
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: |
011ba713 | 7 | %bcond_with dynamic # link dynamically with glib, eventlog, pcre (modules are always linked dynamically) |
306cd2c9 | 8 | %if "%{pld_release}" == "ac" |
011ba713 | 9 | %bcond_with sql # support for logging to SQL DB |
306cd2c9 | 10 | %else |
011ba713 | 11 | %bcond_without sql # support for logging to SQL DB |
306cd2c9 | 12 | %endif |
011ba713 JB |
13 | %bcond_without tests # do not perform "make check" |
14 | %bcond_without json # support for JSON template formatting | |
15 | %bcond_without mongodb # support for mongodb destination | |
16 | %bcond_without redis # support for Redis destination | |
17 | %bcond_without smtp # support for logging into SMTP | |
312323d8 | 18 | %bcond_without geoip # support for GeoIP |
b2e460d3 | 19 | %bcond_with system_libivykis # use system libivykis |
011ba713 | 20 | %bcond_with system_rabbitmq # use system librabbitmq [not supported yet] |
5461d50b | 21 | |
306cd2c9 | 22 | %if "%{pld_release}" == "ac" |
4c650c71 | 23 | %define glib2_ver 1:2.16.0 |
306cd2c9 | 24 | %else |
4c650c71 | 25 | %define glib2_ver 1:2.24.0 |
306cd2c9 | 26 | %endif |
80a87a81 | 27 | Summary: Syslog-ng - new generation of the system logger |
cc1675a4 | 28 | Summary(pl.UTF-8): Syslog-ng - systemowy demon logujący nowej generacji |
f7affeae | 29 | Summary(pt_BR.UTF-8): Daemon de log nova geração |
db55bc6c | 30 | Name: syslog-ng |
2ddf1f86 | 31 | Version: 3.5.2 |
53722489 | 32 | Release: 2 |
4c650c71 | 33 | License: GPL v2+ with OpenSSL exception |
db55bc6c | 34 | Group: Daemons |
5fe1f11f | 35 | Source0: http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/%{version}/source/%{name}_%{version}.tar.gz |
2ddf1f86 | 36 | # Source0-md5: a54cbbe077363f112e5f6ff1ffd34fdb |
70c1937a | 37 | Source1: %{name}.init |
38 | Source2: %{name}.conf | |
e0f9b227 | 39 | Source3: %{name}.logrotate |
2ddf1f86 AM |
40 | 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 |
41 | # Source4-md5: 4c3c7f679e430373375752534e61abee | |
0872fe7c | 42 | Source5: %{name}-simple.conf |
c3d7f31f | 43 | Source6: %{name}.upstart |
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 | ||
c3d7f31f JK |
151 | %package upstart |
152 | Summary: Upstart job description for syslog-ng | |
4a7ca8b7 | 153 | Summary(pl.UTF-8): Opis zadania Upstart dla demona syslog-ng |
c3d7f31f JK |
154 | Group: Daemons |
155 | Requires: %{name} = %{version}-%{release} | |
156 | Requires: upstart >= 0.6 | |
528e8fc2 JK |
157 | Conflicts: avahi-upstart < 0.6.30-2 |
158 | Conflicts: openssh-server-upstart < 2:5.8p2-2 | |
159 | Conflicts: postgresql-upstart < 9.0.4-2 | |
c3d7f31f JK |
160 | |
161 | %description upstart | |
162 | Upstart job description for syslog-ng. | |
163 | ||
164 | %description upstart -l pl.UTF-8 | |
4a7ca8b7 | 165 | Opis zadania Upstart dla demona syslog-ng. |
c3d7f31f | 166 | |
4c650c71 JB |
167 | %package module-afmongodb |
168 | Summary: MongoDB destination support module for syslog-ng | |
169 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazie MongoDB | |
170 | Group: Libraries | |
171 | Requires: %{name} = %{version}-%{release} | |
06e66789 | 172 | Requires: libmongo-client >= 0.1.6 |
4c650c71 JB |
173 | |
174 | %description module-afmongodb | |
175 | MongoDB destination support module for syslog-ng. | |
176 | ||
177 | %description module-afmongodb -l pl.UTF-8 | |
178 | Moduł sysloga-ng do obsługi zapisu logów w bazie MongoDB. | |
179 | ||
24e8f380 MK |
180 | %package module-afsmtp |
181 | Summary: SMTP output support module for syslog-ng | |
182 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi wysyłania logów do serwerów SMTP | |
183 | Group: Libraries | |
184 | Requires: %{name} = %{version}-%{release} | |
24e8f380 MK |
185 | Requires: openssl >= 0.9.8 |
186 | ||
187 | %description module-afsmtp | |
af6a2653 | 188 | SMTP output support module for syslog-ng. |
24e8f380 MK |
189 | |
190 | %description module-afsmtp -l pl.UTF-8 | |
af6a2653 | 191 | Moduł sysloga-ng do obsługi wysyłania logów do serwerów SMTP. |
24e8f380 | 192 | |
4c650c71 JB |
193 | %package module-afsql |
194 | Summary: SQL destination support module for syslog-ng | |
195 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazach SQL | |
196 | Group: Libraries | |
197 | Requires: %{name} = %{version}-%{release} | |
198 | Requires: libdbi >= 0.8.3-2 | |
199 | Requires: openssl >= 0.9.8 | |
200 | ||
201 | %description module-afsql | |
202 | SQL destination support module for syslog-ng (via libdbi). | |
203 | ||
204 | %description module-afsql -l pl.UTF-8 | |
205 | Moduł sysloga-ng do obsługi zapisu logów w bazach SQL (poprzez | |
206 | libdbi). | |
207 | ||
24e8f380 | 208 | %package module-json-plugin |
4c650c71 JB |
209 | Summary: JSON formatting template function for syslog-ng |
210 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON | |
211 | Group: Libraries | |
212 | Requires: %{name} = %{version}-%{release} | |
887b46ca MK |
213 | Requires: json-c >= 0.9 |
214 | Obsoletes: syslog-ng-module-tfjson | |
4c650c71 | 215 | |
24e8f380 | 216 | %description module-json-plugin |
4c650c71 JB |
217 | JSON formatting template function for syslog-ng. |
218 | ||
24e8f380 | 219 | %description module-json-plugin -l pl.UTF-8 |
4c650c71 JB |
220 | Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON. |
221 | ||
011ba713 JB |
222 | %package module-redis |
223 | Summary: Redis destination support module for syslog-ng | |
224 | Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazie Redis | |
225 | Group: Libraries | |
226 | Requires: %{name} = %{version}-%{release} | |
227 | ||
228 | %description module-redis | |
229 | Redis destination support module for syslog-ng (via libhiredis). | |
230 | ||
231 | %description module-redis -l pl.UTF-8 | |
232 | Moduł sysloga-ng do obsługi zapisu logów w bazie Redis (poprzez | |
233 | libhiredis). | |
234 | ||
06e66789 JB |
235 | %package module-tfgeoip |
236 | Summary: syslog-ng template function module to get GeoIP info from an IPv4 addresses | |
237 | Summary(pl.UTF-8): Moduł funkcji szablonu sysloga-ng do pobierania informacji GeoIP z adresów IPv4 | |
238 | Group: Libraries | |
239 | Requires: %{name} = %{version}-%{release} | |
240 | Requires: GeoIP-libs >= 1.5.1 | |
241 | ||
242 | %description module-tfgeoip | |
243 | syslog-ng template function module to get GeoIP info from an IPv4 | |
244 | addresses. | |
245 | ||
246 | %description module-tfgeoip -l pl.UTF-8 | |
247 | Moduł funkcji szablonu sysloga-ng do pobierania informacji GeoIP z | |
248 | adresów IPv4. | |
249 | ||
cc1675a4 JB |
250 | %package libs |
251 | Summary: Shared library for syslog-ng | |
252 | Summary(pl.UTF-8): Biblioteka współdzielona sysloga-ng | |
253 | Group: Libraries | |
254 | %if %{with dynamic} | |
255 | Requires: eventlog >= 0.2.12 | |
4c650c71 | 256 | Requires: glib2 >= %{glib2_ver} |
c6011c69 | 257 | %{?with_system_libivykis:Requires: libivykis >= 0.36.1} |
cc1675a4 JB |
258 | Requires: pcre >= 6.1 |
259 | %endif | |
260 | Conflicts: syslog-ng < 3.3.1-3 | |
261 | ||
262 | %description libs | |
263 | Shared library for syslog-ng. | |
264 | ||
265 | %description libs -l pl.UTF-8 | |
266 | Biblioteka współdzielona sysloga-ng. | |
267 | ||
268 | %package devel | |
269 | Summary: Header files for syslog-ng modules development | |
270 | Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia modułów dla sysloga-ng | |
271 | Group: Development/Libraries | |
272 | Requires: %{name}-libs = %{version}-%{release} | |
273 | %if %{with dynamic} | |
274 | Requires: eventlog-devel >= 0.2.12 | |
4c650c71 | 275 | Requires: glib2-devel >= %{glib2_ver} |
c6011c69 | 276 | %{?with_system_libivykis:Requires: libivykis-devel >= 0.36.1} |
cc1675a4 JB |
277 | Requires: pcre-devel >= 6.1 |
278 | %endif | |
279 | ||
280 | %description devel | |
281 | Header files for syslog-ng modules development. | |
282 | ||
283 | %description devel -l pl.UTF-8 | |
284 | Pliki nagłówkowe do tworzenia modułów dla sysloga-ng. | |
285 | ||
db55bc6c | 286 | %prep |
40b3220e | 287 | %setup -q |
489ceddf | 288 | %patch0 -p1 |
3b8a2194 | 289 | %patch1 -p1 |
38883b2f | 290 | %patch2 -p1 |
17524264 | 291 | %patch3 -p1 |
cd31ca9b | 292 | %patch4 -p1 |
db1b62f6 ER |
293 | cp -p %{SOURCE4} doc |
294 | cp -p %{SOURCE5} contrib/syslog-ng.conf.simple | |
b6fee34c | 295 | |
cec64641 JR |
296 | %{__sed} -i -e 's|/usr/bin/awk|/bin/awk|' scl/syslogconf/convert-syslogconf.awk |
297 | ||
db55bc6c | 298 | %build |
5fe1f11f AM |
299 | for i in . lib/ivykis; do |
300 | cd $i | |
301 | %{__libtoolize} | |
4b94cfad | 302 | %{__aclocal} `[ -d m4 ] && echo '-I m4'` |
5fe1f11f | 303 | %{__autoconf} |
585ae33b | 304 | %{__autoheader} |
5fe1f11f AM |
305 | %{__automake} |
306 | cd - | |
307 | done | |
c67bc54f | 308 | %configure \ |
8eca2e89 | 309 | --sysconfdir=%{_sysconfdir}/syslog-ng \ |
303be384 | 310 | --datadir=%{_datadir}/syslog-ng \ |
db1b62f6 | 311 | --disable-silent-rules \ |
7e54a951 | 312 | --with-default-modules=affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat \ |
18bd7ab6 JK |
313 | %if %{with mongodb} |
314 | --enable-mongodb \ | |
752e2969 | 315 | --with-libmongo-client=system \ |
18bd7ab6 JK |
316 | %else |
317 | --disable-mongodb \ | |
318 | %endif | |
c6011c69 | 319 | %if %{with system_libivykis} |
4c3de3cf | 320 | --with-ivykis=system \ |
c6011c69 MK |
321 | %else |
322 | --with-ivykis=internal \ | |
323 | %endif | |
8fd1a6f4 | 324 | %{?with_system_rabbitmq:--with-librabbitmq-client=system} \ |
bb38cad4 | 325 | --with-module-dir=%{_libdir}/syslog-ng \ |
808ca97e | 326 | --with-pidfile-dir=/var/run \ |
4a7ca8b7 | 327 | --with-timezone-dir=%{_datadir}/zoneinfo \ |
17524264 | 328 | --enable-systemd \ |
6d708cb5 | 329 | --with-systemdsystemunitdir=%{systemdunitdir} \ |
887b46ca | 330 | --enable-amqp \ |
312323d8 | 331 | --enable-geoip%{!?with_geoip:=no} \ |
808ca97e | 332 | --enable-ipv6 \ |
06e66789 | 333 | --enable-json%{!?with_json:=no} \ |
808ca97e | 334 | --enable-linux-caps \ |
1fe2e76c | 335 | --enable-pacct \ |
4a7ca8b7 | 336 | --enable-pcre \ |
011ba713 | 337 | --enable-redis%{!?with_redis:=no} \ |
06e66789 | 338 | --enable-smtp%{!?with_smtp:=no} \ |
4a7ca8b7 JB |
339 | --enable-spoof-source \ |
340 | --enable-ssl \ | |
341 | --enable-tcp-wrapper \ | |
808ca97e JR |
342 | %if %{with sql} |
343 | --enable-sql \ | |
344 | %endif | |
8eca2e89 JB |
345 | %if %{with dynamic} |
346 | --enable-dynamic-linking | |
bb38cad4 JR |
347 | %else |
348 | --enable-mixed-linking | |
8eca2e89 | 349 | %endif |
4298f6c0 | 350 | |
cd31ca9b ER |
351 | %{__make} \ |
352 | XSL_STYLESHEET=%{xsl_stylesheets_dir}/manpages/docbook.xsl | |
db55bc6c | 353 | |
cc1675a4 | 354 | %if %{with tests} |
b7fea326 AM |
355 | LD_LIBRARY_PATH=$(find $PWD -name '*.so*' -printf "%h:") |
356 | PYTHONPATH=$(pwd)/tests/functional | |
357 | export LD_LIBRARY_PATH PYTHONPATH | |
cc1675a4 JB |
358 | %{__make} check |
359 | %endif | |
f3688193 | 360 | |
db55bc6c | 361 | %install |
db55bc6c | 362 | rm -rf $RPM_BUILD_ROOT |
db1b62f6 | 363 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d,init} \ |
303be384 | 364 | $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/patterndb.d \ |
cd6284ba | 365 | $RPM_BUILD_ROOT/var/{log,lib/%{name}/xsd} |
db55bc6c | 366 | |
1fe2e76c | 367 | %{__make} -j1 install \ |
80a5deba | 368 | pkgconfigdir=%{_pkgconfigdir} \ |
4d7c194a | 369 | DESTDIR=$RPM_BUILD_ROOT |
db55bc6c | 370 | |
544d8db5 | 371 | %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng |
db1b62f6 ER |
372 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf |
373 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng | |
db55bc6c | 374 | |
306cd2c9 | 375 | for n in daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog; do |
3fb60e3b JR |
376 | > $RPM_BUILD_ROOT/var/log/$n |
377 | done | |
2a14aff2 | 378 | touch $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
db55bc6c | 379 | |
04316877 | 380 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la |
bb38cad4 | 381 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/syslog-ng/*.la |
f2972fae | 382 | |
306cd2c9 | 383 | %if "%{pld_release}" == "th" |
59aab0b4 | 384 | %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE6} > $RPM_BUILD_ROOT/etc/init/%{name}.conf |
306cd2c9 | 385 | %endif |
c3d7f31f | 386 | |
80a87a81 JB |
387 | %clean |
388 | rm -rf $RPM_BUILD_ROOT | |
389 | ||
db55bc6c | 390 | %post |
1519c9ad ER |
391 | if [ "$1" = "1" ]; then |
392 | # disable /proc/kmsg from config on first install on vserver | |
393 | { | |
394 | while read f ctx; do | |
395 | [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break | |
396 | done </proc/self/status | |
397 | } 2>/dev/null | |
398 | if [ -z "$ctx" -o "$ctx" = "0" ]; then | |
399 | VSERVER=no | |
400 | else | |
401 | VSERVER=yes | |
402 | fi | |
403 | if [ "$VSERVER" = "yes" ]; then | |
404 | %{__sed} -i -e '/\/proc\/kmsg/ s/^[^#]/#&/' %{_sysconfdir}/%{name}/%{name}.conf | |
405 | fi | |
406 | fi | |
407 | ||
0b833f9b | 408 | /sbin/chkconfig --add syslog-ng |
da4f5bde | 409 | %service syslog-ng restart "syslog-ng daemon" |
db55bc6c | 410 | |
34031399 JR |
411 | %systemd_post syslog-ng.service |
412 | ||
db55bc6c | 413 | %preun |
0b833f9b | 414 | if [ "$1" = "0" ]; then |
da4f5bde | 415 | %service syslog-ng stop |
0b833f9b | 416 | /sbin/chkconfig --del syslog-ng |
417 | fi | |
34031399 JR |
418 | %systemd_preun syslog-ng.service |
419 | ||
420 | %postun | |
421 | %systemd_reload | |
422 | ||
423 | %triggerpostun -- syslog-ng < 3.3.4-3 | |
424 | %systemd_trigger syslog-ng.service | |
db55bc6c | 425 | |
31446e62 | 426 | %triggerun -- syslog-ng < 3.0 |
60bdc15a | 427 | sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
428 | sed -i -e 's#pipe ("/proc/kmsg"#file ("/proc/kmsg"#g' /etc/syslog-ng/syslog-ng.conf |
429 | sed -i -e 's#log_prefix#program_override#g' /etc/syslog-ng/syslog-ng.conf | |
430 | sed -i -e 's#^destination #destination d_#g' /etc/syslog-ng/syslog-ng.conf | |
431 | sed -i -e 's#destination(#destination(d_#g' /etc/syslog-ng/syslog-ng.conf | |
01113c19 | 432 | sed -i -e 's,\bstats\b,stats_freq,' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
433 | 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 |
434 | sed -i -e "1 s#\(.*\)\$#@version: 3.0\n\1#g" /etc/syslog-ng/syslog-ng.conf | |
435 | rm -f %{_var}/lib/%{name}/syslog-ng.persist | |
e3a52627 | 436 | %service -q syslog-ng restart |
31446e62 AM |
437 | exit 0 |
438 | ||
cc1675a4 JB |
439 | %post upstart |
440 | %upstart_post %{name} | |
441 | ||
442 | %postun upstart | |
443 | %upstart_postun %{name} | |
444 | ||
445 | %triggerun upstart -- syslog-ng-upstart < 3.2.4-3 | |
446 | # use SERVICE_syslog=y in upstart job environment instead of SERVICE=syslog | |
447 | %{__sed} -i -e 's,SERVICE=syslog,SERVICE_syslog=y,' /etc/init/*.conf || : | |
448 | ||
449 | %post libs -p /sbin/ldconfig | |
450 | %postun libs -p /sbin/ldconfig | |
451 | ||
db55bc6c | 452 | %files |
a25388f3 | 453 | %defattr(644,root,root,755) |
db1b62f6 | 454 | %doc AUTHORS NEWS debian/syslog-ng.conf* contrib/relogger.pl |
04316877 | 455 | %doc contrib/syslog-ng.conf.{doc,simple,RedHat} |
2ddf1f86 | 456 | %doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-ose-v3.5-guide-admin.pdf |
2a14aff2 | 457 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
a25388f3 | 458 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng |
303be384 | 459 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng/patterndb.d |
bb38cad4 | 460 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/scl.conf |
cc4597b5 ER |
461 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/syslog-ng.conf |
462 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng | |
a25388f3 | 463 | %attr(754,root,root) /etc/rc.d/init.d/syslog-ng |
34031399 | 464 | %{systemdunitdir}/syslog-ng.service |
bb38cad4 | 465 | %dir %{_libdir}/syslog-ng |
887b46ca | 466 | %attr(755,root,root) %{_libdir}/syslog-ng/libafamqp.so |
4c650c71 JB |
467 | %attr(755,root,root) %{_libdir}/syslog-ng/libaffile.so |
468 | %attr(755,root,root) %{_libdir}/syslog-ng/libafprog.so | |
ceea8d15 JB |
469 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsocket.so |
470 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsocket-notls.so | |
471 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsocket-tls.so | |
2ddf1f86 | 472 | %attr(755,root,root) %{_libdir}/syslog-ng/libafstomp.so |
4c650c71 JB |
473 | %attr(755,root,root) %{_libdir}/syslog-ng/libafuser.so |
474 | %attr(755,root,root) %{_libdir}/syslog-ng/libbasicfuncs.so | |
475 | %attr(755,root,root) %{_libdir}/syslog-ng/libconfgen.so | |
887b46ca | 476 | %attr(755,root,root) %{_libdir}/syslog-ng/libcryptofuncs.so |
4c650c71 | 477 | %attr(755,root,root) %{_libdir}/syslog-ng/libcsvparser.so |
ceea8d15 | 478 | %attr(755,root,root) %{_libdir}/syslog-ng/libdbparser.so |
2ddf1f86 | 479 | %attr(755,root,root) %{_libdir}/syslog-ng/liblinux-kmsg-format.so |
4c650c71 JB |
480 | %attr(755,root,root) %{_libdir}/syslog-ng/libpacctformat.so |
481 | %attr(755,root,root) %{_libdir}/syslog-ng/libsyslog-ng-crypto.so | |
482 | %attr(755,root,root) %{_libdir}/syslog-ng/libsyslogformat.so | |
887b46ca | 483 | %attr(755,root,root) %{_libdir}/syslog-ng/libsystem-source.so |
302dff3f | 484 | %attr(755,root,root) %{_sbindir}/syslog-ng |
bb38cad4 | 485 | %attr(755,root,root) %{_sbindir}/syslog-ng-ctl |
31da20fc | 486 | %attr(755,root,root) %{_bindir}/loggen |
ceea8d15 | 487 | %attr(755,root,root) %{_bindir}/pdbtool |
303be384 | 488 | %attr(755,root,root) %{_bindir}/update-patterndb |
a0237816 | 489 | |
a0237816 JR |
490 | %dir %{_datadir}/syslog-ng/include |
491 | %dir %{_datadir}/syslog-ng/include/scl | |
492 | %dir %{_datadir}/syslog-ng/include/scl/pacct | |
493 | %{_datadir}/syslog-ng/include/scl/pacct/plugin.conf | |
2ddf1f86 AM |
494 | %dir %{_datadir}/syslog-ng/include/scl/rewrite |
495 | %{_datadir}/syslog-ng/include/scl/rewrite/cc-mask.conf | |
a0237816 JR |
496 | %dir %{_datadir}/syslog-ng/include/scl/syslogconf |
497 | %{_datadir}/syslog-ng/include/scl/syslogconf/README | |
498 | %attr(755,root,root) %{_datadir}/syslog-ng/include/scl/syslogconf/convert-syslogconf.awk | |
499 | %{_datadir}/syslog-ng/include/scl/syslogconf/plugin.conf | |
500 | %dir %{_datadir}/syslog-ng/include/scl/system | |
a0237816 JR |
501 | %{_datadir}/syslog-ng/include/scl/system/plugin.conf |
502 | %dir %{_datadir}/syslog-ng/xsd | |
503 | %{_datadir}/syslog-ng/xsd/patterndb-*.xsd | |
504 | ||
4d910d4c | 505 | %dir %{_var}/lib/%{name} |
cd6284ba | 506 | %dir %{_var}/lib/%{name}/xsd |
31da20fc | 507 | %{_mandir}/man1/loggen.1* |
ceea8d15 | 508 | %{_mandir}/man1/pdbtool.1* |
bb38cad4 | 509 | %{_mandir}/man1/syslog-ng-ctl.1* |
81f47e04 JB |
510 | %{_mandir}/man5/syslog-ng.conf.5* |
511 | %{_mandir}/man8/syslog-ng.8* | |
822b8fbf | 512 | |
cc1675a4 JB |
513 | %attr(640,root,root) %ghost /var/log/daemon |
514 | %attr(640,root,root) %ghost /var/log/debug | |
515 | %attr(640,root,root) %ghost /var/log/iptables | |
516 | %attr(640,root,root) %ghost /var/log/kernel | |
517 | %attr(640,root,root) %ghost /var/log/lpr | |
518 | %attr(640,root,root) %ghost /var/log/maillog | |
519 | %attr(640,root,root) %ghost /var/log/messages | |
520 | %attr(640,root,root) %ghost /var/log/secure | |
521 | %attr(640,root,root) %ghost /var/log/spooler | |
522 | %attr(640,root,root) %ghost /var/log/syslog | |
523 | %attr(640,root,root) %ghost /var/log/user | |
524 | %attr(640,root,root) %ghost /var/log/xferlog | |
c3d7f31f | 525 | |
306cd2c9 | 526 | %if "%{pld_release}" == "th" |
c3d7f31f JK |
527 | %files upstart |
528 | %defattr(644,root,root,755) | |
529 | %config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf | |
306cd2c9 | 530 | %endif |
cc1675a4 | 531 | |
18bd7ab6 | 532 | %if %{with mongodb} |
4c650c71 JB |
533 | %files module-afmongodb |
534 | %defattr(644,root,root,755) | |
4c650c71 | 535 | %attr(755,root,root) %{_libdir}/syslog-ng/libafmongodb.so |
18bd7ab6 | 536 | %endif |
4c650c71 | 537 | |
24e8f380 MK |
538 | %if %{with smtp} |
539 | %files module-afsmtp | |
540 | %defattr(644,root,root,755) | |
541 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsmtp.so | |
542 | %endif | |
543 | ||
5f709b4d | 544 | %if %{with sql} |
4c650c71 JB |
545 | %files module-afsql |
546 | %defattr(644,root,root,755) | |
547 | %attr(755,root,root) %{_libdir}/syslog-ng/libafsql.so | |
5f709b4d | 548 | %endif |
4c650c71 | 549 | |
18bd7ab6 | 550 | %if %{with json} |
24e8f380 | 551 | %files module-json-plugin |
4c650c71 | 552 | %defattr(644,root,root,755) |
887b46ca | 553 | %attr(755,root,root) %{_libdir}/syslog-ng/libjson-plugin.so |
18bd7ab6 | 554 | %endif |
4c650c71 | 555 | |
011ba713 JB |
556 | %if %{with redis} |
557 | %files module-redis | |
558 | %defattr(644,root,root,755) | |
559 | %attr(755,root,root) %{_libdir}/syslog-ng/libredis.so | |
560 | %endif | |
561 | ||
312323d8 | 562 | %if %{with geoip} |
06e66789 JB |
563 | %files module-tfgeoip |
564 | %defattr(644,root,root,755) | |
565 | %attr(755,root,root) %{_libdir}/syslog-ng/libtfgeoip.so | |
312323d8 | 566 | %endif |
06e66789 | 567 | |
cc1675a4 JB |
568 | %files libs |
569 | %defattr(644,root,root,755) | |
570 | %attr(755,root,root) %{_libdir}/libsyslog-ng-%{version}.so | |
571 | %dir %{_datadir}/syslog-ng | |
572 | ||
573 | %files devel | |
574 | %defattr(644,root,root,755) | |
575 | %attr(755,root,root) %{_libdir}/libsyslog-ng.so | |
576 | %{_includedir}/syslog-ng | |
577 | %{_datadir}/syslog-ng/tools | |
578 | %{_pkgconfigdir}/syslog-ng.pc |