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