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