]>
Commit | Line | Data |
---|---|---|
5aa38709 | 1 | # |
cec64641 JR |
2 | # TODO: |
3 | # - move SQL module to a separate package | |
3cb74b26 | 4 | # - relies on libs in /usr/ which is wrong |
77ae5051 | 5 | # - use external libivykis [>= 0.18+syslog-ng updates], libmongo_client [>= 0.1.0] |
cec64641 | 6 | # |
8eca2e89 | 7 | # Conditional build: |
808ca97e | 8 | %bcond_with dynamic # link dynamically with glib, eventlog, pcre, openssl |
306cd2c9 | 9 | %if "%{pld_release}" == "ac" |
544d8db5 | 10 | %bcond_with sql # build with support for logging to SQL DB |
306cd2c9 | 11 | %else |
808ca97e | 12 | %bcond_without sql # build without support for logging to SQL DB |
306cd2c9 | 13 | %endif |
f3688193 | 14 | %bcond_without tests |
5461d50b | 15 | |
306cd2c9 ER |
16 | %if "%{pld_release}" == "ac" |
17 | %define glib2_ver 2.16.0 | |
18 | %else | |
5461d50b | 19 | %define glib2_ver 2.24.0 |
306cd2c9 | 20 | %endif |
80a87a81 | 21 | Summary: Syslog-ng - new generation of the system logger |
f7affeae ER |
22 | Summary(pl.UTF-8): Syslog-ng - zamiennik syskloga |
23 | Summary(pt_BR.UTF-8): Daemon de log nova geração | |
db55bc6c | 24 | Name: syslog-ng |
5fe1f11f | 25 | Version: 3.3.1 |
7946d1bb | 26 | Release: 2 |
2cb1bc96 | 27 | License: GPL v2 |
db55bc6c | 28 | Group: Daemons |
5fe1f11f AM |
29 | Source0: http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/%{version}/source/%{name}_%{version}.tar.gz |
30 | # Source0-md5: a3dfe8a49aa8ce1aeb7e1ed5b11af378 | |
70c1937a | 31 | Source1: %{name}.init |
32 | Source2: %{name}.conf | |
e0f9b227 | 33 | Source3: %{name}.logrotate |
5fe1f11f AM |
34 | Source4: http://www.balabit.com/support/documentation/syslog-ng-ose-v3.3-guide-admin-en.pdf |
35 | # Source4-md5: bb23e36a8f44956858f2d622f9d1826d | |
0872fe7c | 36 | Source5: %{name}-simple.conf |
c3d7f31f | 37 | Source6: %{name}.upstart |
35907845 | 38 | Patch0: %{name}-datadir.patch |
5fe1f11f | 39 | Patch1: cap_syslog-vserver-workaround.patch |
34c905de | 40 | URL: http://www.balabit.com/products/syslog_ng/ |
96ef1ac7 | 41 | BuildRequires: autoconf >= 2.53 |
53500332 | 42 | BuildRequires: automake |
4a7ca8b7 | 43 | BuildRequires: bison >= 2.4 |
ac9ca8e0 | 44 | BuildRequires: flex |
4a7ca8b7 | 45 | BuildRequires: libtool >= 2:2.0 |
bf8c4b27 | 46 | BuildRequires: pkgconfig |
306cd2c9 | 47 | BuildRequires: rpm >= 4.4.9-56 |
1337adb4 | 48 | BuildRequires: rpmbuild(macros) >= 1.561 |
24642adc | 49 | BuildRequires: which |
bc708ef6 | 50 | %if %{with tests} |
306cd2c9 | 51 | %{?with_sql:BuildRequires: libdbi-drivers-sqlite3} |
24642adc | 52 | BuildRequires: python |
53 | BuildRequires: python-modules | |
bc708ef6 AF |
54 | BuildRequires: tzdata |
55 | %endif | |
8eca2e89 | 56 | %if %{with dynamic} |
d132f512 | 57 | BuildRequires: eventlog-devel >= 0.2.12 |
5461d50b | 58 | BuildRequires: glib2-devel >= 1:%{glib2_ver} |
4a7ca8b7 | 59 | BuildRequires: json-c-devel >= 0.7 |
808ca97e | 60 | BuildRequires: libcap-devel |
24642adc | 61 | %{?with_sql:BuildRequires: libdbi-devel >= 0.8.3-2} |
752e2969 | 62 | BuildRequires: libmongo-client-devel >= 0.1.0 |
422b3485 JB |
63 | BuildRequires: libnet-devel >= 1:1.1.2.1-3 |
64 | BuildRequires: libwrap-devel | |
585ae33b JB |
65 | BuildRequires: openssl-devel >= 0.9.8 |
66 | BuildRequires: pcre-devel >= 6.1 | |
8eca2e89 | 67 | %else |
d132f512 | 68 | BuildRequires: eventlog-static >= 0.2.12 |
5461d50b | 69 | BuildRequires: glib2-static >= 1:%{glib2_ver} |
808ca97e | 70 | BuildRequires: glibc-static |
4a7ca8b7 | 71 | BuildRequires: json-c-static >= 0.7 |
808ca97e | 72 | BuildRequires: libcap-static |
24642adc | 73 | %{?with_sql:BuildRequires: libdbi-static >= 0.8.3-2} |
752e2969 | 74 | BuildRequires: libmongo-client-static >= 0.1.0 |
422b3485 JB |
75 | BuildRequires: libnet-static >= 1:1.1.2.1-3 |
76 | BuildRequires: libwrap-static | |
585ae33b JB |
77 | BuildRequires: openssl-static >= 0.9.8 |
78 | BuildRequires: pcre-static >= 6.1 | |
808ca97e | 79 | BuildRequires: zlib-static |
8eca2e89 | 80 | %endif |
768882cc | 81 | Requires(post): fileutils |
cc4597b5 | 82 | Requires(post,preun): /sbin/chkconfig |
5461d50b | 83 | Requires: glib2 >= 1:%{glib2_ver} |
0471c4e3 | 84 | Requires: psmisc >= 20.1 |
622aa91c | 85 | Requires: rc-scripts >= 0.4.3.0 |
77ae5051 JB |
86 | %if %{with dynamic} |
87 | Requires: eventlog >= 0.2.12 | |
88 | Requires: json-c >= 0.7 | |
89 | Requires: libdbi >= 0.8.3-2 | |
752e2969 | 90 | Requires: libmongo-client >= 0.1.0 |
77ae5051 JB |
91 | Requires: libnet >= 1:1.1.2.1-7 |
92 | Requires: openssl >= 0.9.8 | |
93 | Requires: pcre >= 6.1 | |
94 | %endif | |
18a2d4ea | 95 | Provides: syslogdaemon |
5db3c127 | 96 | Conflicts: klogd |
1a409b7d | 97 | Conflicts: msyslog |
0baee825 | 98 | Conflicts: syslog |
8a78073d | 99 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
db55bc6c | 100 | |
35907845 AM |
101 | # syslog-ng has really crazy linking rules (see their bugzilla). |
102 | # Some rules, according to syslog-ng devs, are like this: | |
103 | # - libsyslog-ng.so has undefined symbols for third party libraries | |
104 | # and these symbols should go via main syslog-ng binary | |
105 | # - same applies for modules | |
bb38cad4 JR |
106 | %if %{without dynamic} |
107 | %define no_install_post_check_so 1 | |
35907845 AM |
108 | # filterout_ld - see comment few lines above |
109 | %define filterout_ld -Wl,--as-needed -Wl,--no-copy-dt-needed-entries | |
bb38cad4 JR |
110 | %define _sbindir /sbin |
111 | %define _libdir /%{_lib} | |
112 | %endif | |
113 | ||
db55bc6c | 114 | %description |
a42dcc7c | 115 | syslog-ng is a syslogd replacement for Unix and Unix-like systems. It |
70c1937a | 116 | has been tested on Solaris, BSDi and Linux, and were found to run |
117 | reliably. syslog-ng gives you a much enhanced configuration scheme, | |
118 | which lets you filter messages based on not only priority/facility | |
119 | pairs, but also on message content. You can use regexps to direct log | |
120 | stream to different destinations. A destination can be anything from a | |
121 | simple file to a network connection. syslog-ng supports TCP | |
122 | logforwarding, together with hashing to prevent unauthorized | |
123 | modification on the line. | |
db55bc6c | 124 | |
6ab9000c JR |
125 | %description -l pl.UTF-8 |
126 | Syslog-ng jest zamiennikiem dla standardowo używanych programów typu | |
a42dcc7c | 127 | syslog. Działa w systemie SunOS, BSD, Linux. Daje znacznie większe |
6ab9000c | 128 | możliwości logowania i kontrolowania zbieranych informacji. |
db55bc6c | 129 | |
6ab9000c JR |
130 | %description -l pt_BR.UTF-8 |
131 | Syslog-ng é um substituto para o syslog tradicional, mas com diversas | |
02e7b20a | 132 | melhorias, como, por exemplo, a habilidade de filtrar mensagens de log |
6ab9000c | 133 | por seu conteúdo (usando expressões regulares) e não apenas pelo par |
02e7b20a | 134 | facility/prioridade como o syslog original. |
135 | ||
c3d7f31f JK |
136 | %package upstart |
137 | Summary: Upstart job description for syslog-ng | |
4a7ca8b7 | 138 | Summary(pl.UTF-8): Opis zadania Upstart dla demona syslog-ng |
c3d7f31f JK |
139 | Group: Daemons |
140 | Requires: %{name} = %{version}-%{release} | |
141 | Requires: upstart >= 0.6 | |
528e8fc2 JK |
142 | Conflicts: avahi-upstart < 0.6.30-2 |
143 | Conflicts: openssh-server-upstart < 2:5.8p2-2 | |
144 | Conflicts: postgresql-upstart < 9.0.4-2 | |
c3d7f31f JK |
145 | |
146 | %description upstart | |
147 | Upstart job description for syslog-ng. | |
148 | ||
149 | %description upstart -l pl.UTF-8 | |
4a7ca8b7 | 150 | Opis zadania Upstart dla demona syslog-ng. |
c3d7f31f | 151 | |
db55bc6c | 152 | %prep |
40b3220e | 153 | %setup -q |
489ceddf | 154 | %patch0 -p1 |
3b8a2194 | 155 | %patch1 -p1 |
0872fe7c | 156 | cp -a %{SOURCE4} doc |
f83d4749 | 157 | cp -a %{SOURCE5} contrib/syslog-ng.conf.simple |
b6fee34c | 158 | |
cec64641 JR |
159 | %{__sed} -i -e 's|/usr/bin/awk|/bin/awk|' scl/syslogconf/convert-syslogconf.awk |
160 | ||
db55bc6c | 161 | %build |
5fe1f11f AM |
162 | for i in . lib/ivykis; do |
163 | cd $i | |
164 | %{__libtoolize} | |
165 | %{__aclocal} -I m4 | |
166 | %{__autoconf} | |
585ae33b | 167 | %{__autoheader} |
5fe1f11f AM |
168 | %{__automake} |
169 | cd - | |
170 | done | |
c67bc54f | 171 | %configure \ |
8eca2e89 | 172 | --sysconfdir=%{_sysconfdir}/syslog-ng \ |
303be384 | 173 | --datadir=%{_datadir}/syslog-ng \ |
752e2969 | 174 | --with-libmongo-client=system \ |
bb38cad4 | 175 | --with-module-dir=%{_libdir}/syslog-ng \ |
808ca97e | 176 | --with-pidfile-dir=/var/run \ |
4a7ca8b7 JB |
177 | --with-timezone-dir=%{_datadir}/zoneinfo \ |
178 | --disable-systemd \ | |
808ca97e | 179 | --enable-ipv6 \ |
808ca97e | 180 | --enable-linux-caps \ |
1fe2e76c | 181 | --enable-pacct \ |
4a7ca8b7 JB |
182 | --enable-pcre \ |
183 | --enable-spoof-source \ | |
184 | --enable-ssl \ | |
185 | --enable-tcp-wrapper \ | |
808ca97e JR |
186 | %if %{with sql} |
187 | --enable-sql \ | |
188 | %endif | |
8eca2e89 JB |
189 | %if %{with dynamic} |
190 | --enable-dynamic-linking | |
bb38cad4 JR |
191 | %else |
192 | --enable-mixed-linking | |
8eca2e89 | 193 | %endif |
4298f6c0 | 194 | |
84ad47e7 | 195 | %{__make} |
db55bc6c | 196 | |
528e8fc2 | 197 | %{?with_tests:LD_LIBRARY_PATH=$PWD/lib/.libs %{__make} check} |
f3688193 | 198 | |
db55bc6c | 199 | %install |
db55bc6c | 200 | rm -rf $RPM_BUILD_ROOT |
303be384 JR |
201 | install -d $RPM_BUILD_ROOT/etc/{init,sysconfig,logrotate.d,rc.d/init.d} \ |
202 | $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/patterndb.d \ | |
cd6284ba | 203 | $RPM_BUILD_ROOT/var/{log,lib/%{name}/xsd} |
db55bc6c | 204 | |
1fe2e76c | 205 | %{__make} -j1 install \ |
4d7c194a | 206 | DESTDIR=$RPM_BUILD_ROOT |
db55bc6c | 207 | |
544d8db5 | 208 | %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE1} > $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng |
306cd2c9 ER |
209 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf |
210 | cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng | |
db55bc6c | 211 | |
306cd2c9 | 212 | for n in daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog; do |
3fb60e3b JR |
213 | > $RPM_BUILD_ROOT/var/log/$n |
214 | done | |
2a14aff2 | 215 | touch $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
db55bc6c | 216 | |
bb38cad4 | 217 | %{__rm} $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}/loggen* |
04316877 | 218 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la |
bb38cad4 | 219 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/syslog-ng/*.la |
f2972fae | 220 | |
306cd2c9 | 221 | %if "%{pld_release}" == "th" |
59aab0b4 | 222 | %{__sed} -e 's|@@SBINDIR@@|%{_sbindir}|g' %{SOURCE6} > $RPM_BUILD_ROOT/etc/init/%{name}.conf |
306cd2c9 | 223 | %endif |
c3d7f31f | 224 | |
80a87a81 JB |
225 | %clean |
226 | rm -rf $RPM_BUILD_ROOT | |
227 | ||
db55bc6c | 228 | %post |
bb38cad4 | 229 | /sbin/ldconfig |
1519c9ad ER |
230 | if [ "$1" = "1" ]; then |
231 | # disable /proc/kmsg from config on first install on vserver | |
232 | { | |
233 | while read f ctx; do | |
234 | [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break | |
235 | done </proc/self/status | |
236 | } 2>/dev/null | |
237 | if [ -z "$ctx" -o "$ctx" = "0" ]; then | |
238 | VSERVER=no | |
239 | else | |
240 | VSERVER=yes | |
241 | fi | |
242 | if [ "$VSERVER" = "yes" ]; then | |
243 | %{__sed} -i -e '/\/proc\/kmsg/ s/^[^#]/#&/' %{_sysconfdir}/%{name}/%{name}.conf | |
244 | fi | |
245 | fi | |
246 | ||
0b833f9b | 247 | /sbin/chkconfig --add syslog-ng |
da4f5bde | 248 | %service syslog-ng restart "syslog-ng daemon" |
db55bc6c | 249 | |
250 | %preun | |
0b833f9b | 251 | if [ "$1" = "0" ]; then |
da4f5bde | 252 | %service syslog-ng stop |
0b833f9b | 253 | /sbin/chkconfig --del syslog-ng |
254 | fi | |
db55bc6c | 255 | |
bb38cad4 JR |
256 | %postun -p /sbin/ldconfig |
257 | ||
c3d7f31f JK |
258 | %post upstart |
259 | %upstart_post %{name} | |
260 | ||
261 | %postun upstart | |
262 | %upstart_postun %{name} | |
263 | ||
45e56538 ER |
264 | %triggerun upstart -- syslog-ng-upstart < 3.2.4-3 |
265 | # use SERVICE_syslog=y in upstart job environment instead of SERVICE=syslog | |
266 | %{__sed} -i -e 's,SERVICE=syslog,SERVICE_syslog=y,' /etc/init/*.conf || : | |
267 | ||
31446e62 | 268 | %triggerun -- syslog-ng < 3.0 |
60bdc15a | 269 | sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
270 | sed -i -e 's#pipe ("/proc/kmsg"#file ("/proc/kmsg"#g' /etc/syslog-ng/syslog-ng.conf |
271 | sed -i -e 's#log_prefix#program_override#g' /etc/syslog-ng/syslog-ng.conf | |
272 | sed -i -e 's#^destination #destination d_#g' /etc/syslog-ng/syslog-ng.conf | |
273 | sed -i -e 's#destination(#destination(d_#g' /etc/syslog-ng/syslog-ng.conf | |
01113c19 | 274 | sed -i -e 's,\bstats\b,stats_freq,' /etc/syslog-ng/syslog-ng.conf |
31446e62 AM |
275 | 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 |
276 | sed -i -e "1 s#\(.*\)\$#@version: 3.0\n\1#g" /etc/syslog-ng/syslog-ng.conf | |
277 | rm -f %{_var}/lib/%{name}/syslog-ng.persist | |
e3a52627 | 278 | %service -q syslog-ng restart |
31446e62 AM |
279 | exit 0 |
280 | ||
db55bc6c | 281 | %files |
a25388f3 | 282 | %defattr(644,root,root,755) |
0091ccbb | 283 | %doc AUTHORS ChangeLog NEWS debian/syslog-ng.conf* contrib/relogger.pl |
04316877 AM |
284 | %doc contrib/syslog-ng.conf.{doc,simple,RedHat} |
285 | %doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-ose-v3.3-guide-admin-en.pdf | |
2a14aff2 | 286 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
a25388f3 | 287 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng |
303be384 | 288 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng/patterndb.d |
bb38cad4 JR |
289 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/modules.conf |
290 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/scl.conf | |
cc4597b5 ER |
291 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/syslog-ng.conf |
292 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng | |
a25388f3 | 293 | %attr(754,root,root) /etc/rc.d/init.d/syslog-ng |
04316877 | 294 | %attr(755,root,root) %{_libdir}/libsyslog-ng-%{version}.so |
bb38cad4 JR |
295 | %dir %{_libdir}/syslog-ng |
296 | %attr(755,root,root) %{_libdir}/syslog-ng/lib*.so | |
302dff3f | 297 | %attr(755,root,root) %{_sbindir}/syslog-ng |
bb38cad4 | 298 | %attr(755,root,root) %{_sbindir}/syslog-ng-ctl |
303be384 JR |
299 | %attr(755,root,root) %{_bindir}/pdbtool |
300 | %attr(755,root,root) %{_bindir}/update-patterndb | |
a0237816 JR |
301 | |
302 | %dir %{_datadir}/syslog-ng | |
303 | %dir %{_datadir}/syslog-ng/include | |
304 | %dir %{_datadir}/syslog-ng/include/scl | |
305 | %dir %{_datadir}/syslog-ng/include/scl/pacct | |
306 | %{_datadir}/syslog-ng/include/scl/pacct/plugin.conf | |
307 | %dir %{_datadir}/syslog-ng/include/scl/syslogconf | |
308 | %{_datadir}/syslog-ng/include/scl/syslogconf/README | |
309 | %attr(755,root,root) %{_datadir}/syslog-ng/include/scl/syslogconf/convert-syslogconf.awk | |
310 | %{_datadir}/syslog-ng/include/scl/syslogconf/plugin.conf | |
311 | %dir %{_datadir}/syslog-ng/include/scl/system | |
312 | %attr(755,root,root) %{_datadir}/syslog-ng/include/scl/system/generate-system-source.sh | |
313 | %{_datadir}/syslog-ng/include/scl/system/plugin.conf | |
314 | %dir %{_datadir}/syslog-ng/xsd | |
315 | %{_datadir}/syslog-ng/xsd/patterndb-*.xsd | |
316 | ||
4d910d4c | 317 | %dir %{_var}/lib/%{name} |
cd6284ba | 318 | %dir %{_var}/lib/%{name}/xsd |
303be384 | 319 | %{_mandir}/man1/pdbtool.1* |
bb38cad4 | 320 | %{_mandir}/man1/syslog-ng-ctl.1* |
81f47e04 JB |
321 | %{_mandir}/man5/syslog-ng.conf.5* |
322 | %{_mandir}/man8/syslog-ng.8* | |
822b8fbf | 323 | |
3fb60e3b | 324 | %attr(640,root,root) %ghost /var/log/* |
c3d7f31f | 325 | |
306cd2c9 | 326 | %if "%{pld_release}" == "th" |
c3d7f31f JK |
327 | %files upstart |
328 | %defattr(644,root,root,755) | |
329 | %config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf | |
306cd2c9 | 330 | %endif |