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