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