]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with dynamic # link dynamically with glib, eventlog, pcre, openssl | |
4 | %bcond_without sql # build without support for logging to SQL DB | |
5 | %bcond_without tests | |
6 | ||
7 | %define glib2_ver 2.24.0 | |
8 | Summary: Syslog-ng - new generation of the system logger | |
9 | Summary(pl.UTF-8): Syslog-ng - zamiennik syskloga | |
10 | Summary(pt_BR.UTF-8): Daemon de log nova geração | |
11 | Name: syslog-ng | |
12 | Version: 3.0.5 | |
13 | Release: 2 | |
14 | License: GPL v2 | |
15 | Group: Daemons | |
16 | Source0: http://www.balabit.com/downloads/files/syslog-ng/sources/%{version}/source/%{name}_%{version}.tar.gz | |
17 | # Source0-md5: 28f0d9ff2243b330e8cd6311ef9b2f12 | |
18 | Source1: %{name}.init | |
19 | Source2: %{name}.conf | |
20 | Source3: %{name}.logrotate | |
21 | Source4: http://www.balabit.com/dl/guides/%{name}-v3.0-guide-admin-en.pdf | |
22 | # Source4-md5: 1a801f138a9a2245009ecb617be4338b | |
23 | Source5: %{name}-simple.conf | |
24 | Patch0: %{name}-link.patch | |
25 | Patch1: %{name}-datadir.patch | |
26 | Patch2: %{name}-pyssl.patch | |
27 | Patch3: bug-15.patch | |
28 | URL: http://www.balabit.com/products/syslog_ng/ | |
29 | BuildRequires: autoconf >= 2.53 | |
30 | BuildRequires: automake | |
31 | BuildRequires: bison | |
32 | BuildRequires: flex | |
33 | BuildRequires: pkgconfig | |
34 | BuildRequires: rpmbuild(macros) >= 1.268 | |
35 | %if %{with tests} | |
36 | BuildRequires: libdbi-drivers-sqlite3 | |
37 | BuildRequires: tzdata | |
38 | %endif | |
39 | %if %{with dynamic} | |
40 | BuildRequires: eventlog-devel >= 0.2 | |
41 | BuildRequires: glib2-devel >= 1:%{glib2_ver} | |
42 | BuildRequires: libcap-devel | |
43 | %if %{with sql} | |
44 | BuildRequires: libdbi-devel >= 0.8.3-2 | |
45 | %endif | |
46 | BuildRequires: libnet-devel >= 1:1.1.2.1-3 | |
47 | BuildRequires: libwrap-devel | |
48 | BuildRequires: openssl-devel >= 0.9.8 | |
49 | BuildRequires: pcre-devel | |
50 | %else | |
51 | BuildRequires: eventlog-static >= 0.2 | |
52 | BuildRequires: glib2-static >= 1:%{glib2_ver} | |
53 | BuildRequires: glibc-static | |
54 | BuildRequires: libcap-static | |
55 | %if %{with sql} | |
56 | BuildRequires: libdbi-static >= 0.8.3-2 | |
57 | %endif | |
58 | BuildRequires: libnet-static >= 1:1.1.2.1-3 | |
59 | BuildRequires: libwrap-static | |
60 | BuildRequires: openssl-static >= 0.9.8 | |
61 | BuildRequires: pcre-static | |
62 | BuildRequires: zlib-static | |
63 | %endif | |
64 | Requires(post): fileutils | |
65 | Requires(post,preun): /sbin/chkconfig | |
66 | Requires: glib2 >= 1:%{glib2_ver} | |
67 | Requires: psmisc >= 20.1 | |
68 | Requires: rc-scripts >= 0.2.0 | |
69 | Provides: syslogdaemon | |
70 | Conflicts: klogd | |
71 | Conflicts: msyslog | |
72 | Conflicts: syslog | |
73 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
74 | ||
75 | %description | |
76 | syslog-ng is a syslogd replacement for Unix and Unix-like systems. It | |
77 | has been tested on Solaris, BSDi and Linux, and were found to run | |
78 | reliably. syslog-ng gives you a much enhanced configuration scheme, | |
79 | which lets you filter messages based on not only priority/facility | |
80 | pairs, but also on message content. You can use regexps to direct log | |
81 | stream to different destinations. A destination can be anything from a | |
82 | simple file to a network connection. syslog-ng supports TCP | |
83 | logforwarding, together with hashing to prevent unauthorized | |
84 | modification on the line. | |
85 | ||
86 | %description -l pl.UTF-8 | |
87 | Syslog-ng jest zamiennikiem dla standardowo używanych programów typu | |
88 | syslog. Działa w systemie SunOS, BSD, Linux. Daje znacznie większe | |
89 | możliwości logowania i kontrolowania zbieranych informacji. | |
90 | ||
91 | %description -l pt_BR.UTF-8 | |
92 | Syslog-ng é um substituto para o syslog tradicional, mas com diversas | |
93 | melhorias, como, por exemplo, a habilidade de filtrar mensagens de log | |
94 | por seu conteúdo (usando expressões regulares) e não apenas pelo par | |
95 | facility/prioridade como o syslog original. | |
96 | ||
97 | %prep | |
98 | %setup -q | |
99 | %patch0 -p1 | |
100 | %patch1 -p1 | |
101 | %patch2 -p1 | |
102 | %patch3 -p1 | |
103 | cp -a %{SOURCE4} doc | |
104 | cp -a %{SOURCE5} contrib | |
105 | ||
106 | %build | |
107 | %{__aclocal} | |
108 | %{__autoconf} | |
109 | %{__automake} | |
110 | %configure \ | |
111 | --sysconfdir=%{_sysconfdir}/syslog-ng \ | |
112 | --with-timezone-dir=%{_datadir}/zoneinfo \ | |
113 | --with-pidfile-dir=/var/run \ | |
114 | --enable-ssl \ | |
115 | --enable-ipv6 \ | |
116 | --enable-tcp-wrapper \ | |
117 | --enable-spoof-source \ | |
118 | --enable-linux-caps \ | |
119 | --enable-pcre \ | |
120 | %if %{with sql} | |
121 | --enable-sql \ | |
122 | %endif | |
123 | %if %{with dynamic} | |
124 | --enable-dynamic-linking | |
125 | %endif | |
126 | ||
127 | %{__make} | |
128 | ||
129 | %{?with_tests:%{__make} check} | |
130 | ||
131 | %install | |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | install -d $RPM_BUILD_ROOT{/etc/{sysconfig,logrotate.d,rc.d/init.d},%{_sysconfdir}/syslog-ng} \ | |
134 | $RPM_BUILD_ROOT/var/{log,lib/%{name}} | |
135 | ||
136 | %{__make} install \ | |
137 | DESTDIR=$RPM_BUILD_ROOT | |
138 | ||
139 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng | |
140 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf | |
141 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng | |
142 | ||
143 | for n in daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog | |
144 | do | |
145 | > $RPM_BUILD_ROOT/var/log/$n | |
146 | done | |
147 | touch $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
148 | ||
149 | rm $RPM_BUILD_ROOT%{_bindir}/loggen | |
150 | ||
151 | %clean | |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | ||
154 | %post | |
155 | /sbin/chkconfig --add syslog-ng | |
156 | %service syslog-ng restart "syslog-ng daemon" | |
157 | ||
158 | %preun | |
159 | if [ "$1" = "0" ]; then | |
160 | %service syslog-ng stop | |
161 | /sbin/chkconfig --del syslog-ng | |
162 | fi | |
163 | ||
164 | %triggerun -- syslog-ng < 3.0 | |
165 | sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf | |
166 | sed -i -e 's#pipe ("/proc/kmsg"#file ("/proc/kmsg"#g' /etc/syslog-ng/syslog-ng.conf | |
167 | sed -i -e 's#log_prefix#program_override#g' /etc/syslog-ng/syslog-ng.conf | |
168 | sed -i -e 's#^destination #destination d_#g' /etc/syslog-ng/syslog-ng.conf | |
169 | sed -i -e 's#destination(#destination(d_#g' /etc/syslog-ng/syslog-ng.conf | |
170 | sed -i -e 's,\bstats\b,stats_freq,' /etc/syslog-ng/syslog-ng.conf | |
171 | 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 | |
172 | sed -i -e "1 s#\(.*\)\$#@version: 3.0\n\1#g" /etc/syslog-ng/syslog-ng.conf | |
173 | rm -f %{_var}/lib/%{name}/syslog-ng.persist | |
174 | %service -q syslog-ng restart | |
175 | exit 0 | |
176 | ||
177 | %files | |
178 | %defattr(644,root,root,755) | |
179 | %doc AUTHORS ChangeLog NEWS debian/syslog-ng.conf* contrib/{relogger.pl,syslog-ng.vim} | |
180 | %doc doc/examples/syslog-ng.conf.sample contrib/syslog-ng.conf.{doc,RedHat} contrib/syslog-ng-simple.conf | |
181 | %doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-v3.0-guide-admin-en.pdf | |
182 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
183 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng | |
184 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/syslog-ng.conf | |
185 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng | |
186 | %attr(754,root,root) /etc/rc.d/init.d/syslog-ng | |
187 | %attr(755,root,root) %{_sbindir}/syslog-ng | |
188 | %dir %{_var}/lib/%{name} | |
189 | %{_mandir}/man5/syslog-ng.conf.5* | |
190 | %{_mandir}/man8/syslog-ng.8* | |
191 | ||
192 | %attr(640,root,root) %ghost /var/log/* |