]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - without gssapi still generates dep on heimdal-libs | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_without dbi # database support via libdbi | |
6 | %bcond_without gssapi # GSSAPI Kerberos 5 support | |
7 | %bcond_without mysql # MySQL database support | |
8 | %bcond_without pgsql # PostgreSQL database support | |
9 | %bcond_without snmp # SNMP support | |
10 | ||
11 | Summary: Linux system and kernel logger | |
12 | Summary(de.UTF-8): Linux-System- und Kerner-Logger | |
13 | Summary(es.UTF-8): Registrador de log del sistema linux | |
14 | Summary(fr.UTF-8): Le système Linux et le logger du noyau | |
15 | Summary(pl.UTF-8): Programy logujące zdarzenia w systemie i jądrze Linuksa | |
16 | Summary(pt_BR.UTF-8): Registrador de log do sistema linux | |
17 | Summary(tr.UTF-8): Linux sistem ve çekirdek kayıt süreci | |
18 | Name: rsyslog | |
19 | Version: 5.10.1 | |
20 | Release: 2 | |
21 | License: GPL v3+ | |
22 | Group: Daemons | |
23 | Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz | |
24 | # Source0-md5: a28c99e05888c977672db6e254694208 | |
25 | Source1: %{name}.init | |
26 | Source2: %{name}.conf | |
27 | Source3: %{name}.sysconfig | |
28 | Source4: %{name}.logrotate | |
29 | Patch0: rsyslog-systemd.patch | |
30 | URL: http://www.rsyslog.com/ | |
31 | %{?with_gssapi:BuildRequires: heimdal-devel} | |
32 | BuildRequires: libdbi-devel | |
33 | %{?with_mysql:BuildRequires: mysql-devel} | |
34 | %{?with_snmp:BuildRequires: net-snmp-devel} | |
35 | BuildRequires: pkgconfig | |
36 | %{?with_pgsql:BuildRequires: postgresql-devel} | |
37 | BuildRequires: libnet-devel | |
38 | BuildRequires: gnutls-devel | |
39 | BuildRequires: rpmbuild(macros) >= 1.626 | |
40 | Requires(post): fileutils | |
41 | Requires(post,preun): /sbin/chkconfig | |
42 | Requires(post,preun): rc-scripts >= 0.2.0 | |
43 | Requires(postun): /usr/sbin/groupdel | |
44 | Requires(postun): /usr/sbin/userdel | |
45 | Requires(pre): /bin/id | |
46 | Requires(pre): /usr/bin/getgid | |
47 | Requires(pre): /usr/lib/rpm/user_group.sh | |
48 | Requires(pre): /usr/sbin/groupadd | |
49 | Requires(pre): /usr/sbin/useradd | |
50 | Requires(pre): /usr/sbin/usermod | |
51 | Requires(post,preun,postun): systemd-units >= 38 | |
52 | Requires(triggerpostun): sed >= 4.0 | |
53 | # for vservers we don't need klogd and syslog works without klogd | |
54 | # (just it doesn't log kernel buffer into syslog) | |
55 | # Requires: klogd | |
56 | Requires: logrotate >= 3.2-3 | |
57 | Requires: psmisc >= 20.1 | |
58 | Requires: systemd-units >= 38 | |
59 | Provides: group(syslog) | |
60 | Provides: service(klogd) | |
61 | Provides: service(syslog) | |
62 | Provides: syslogdaemon | |
63 | Provides: user(syslog) | |
64 | Obsoletes: msyslog | |
65 | Obsoletes: rsyslog-systemd | |
66 | Obsoletes: sysklogd | |
67 | Obsoletes: syslog-ng | |
68 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
69 | ||
70 | %description | |
71 | Rsyslog is an enhanced multi-threaded syslogd supporting, among | |
72 | others, MySQL, syslog/tcp, RFC 3195, permitted sender lists, filtering | |
73 | on any message part, and fine grain output format control. It is quite | |
74 | compatible to stock sysklogd and can be used as a drop-in replacement. | |
75 | Its advanced features make it suitable for enterprise-class, | |
76 | encryption protected syslog relay chains while at the same time being | |
77 | very easy to setup for the novice user. | |
78 | ||
79 | %description -l pl.UTF-8 | |
80 | rsyslog to zaawansowany, wielowątkowy syslogd obsługujący m.in. | |
81 | MySQL-a, syslog/tcp, RFC 3195, listy dopuszczalnych nadawców, | |
82 | filtrowanie po częściach komunikatów i szczegółową kontrolę formatu | |
83 | wyjściowego. Jest w miarę kompatybilny ze zwykłym sysklogd i może być | |
84 | używany jako jego zamiennik. Jego zaawansowane możliwości czynią go | |
85 | odpowiednim do produkcyjnych, szyfrowanych łańcuchów przekazywania | |
86 | logów, a jednocześnie jest przy tym łatwy do skonfigurowania dla | |
87 | początkującego użytkownika. | |
88 | ||
89 | %package mysql | |
90 | Summary: MySQL support for rsyslog | |
91 | Summary(pl.UTF-8): Obsługa MySQL-a do rsysloga | |
92 | Group: Daemons | |
93 | Requires: %{name} = %{version}-%{release} | |
94 | ||
95 | %description mysql | |
96 | The rsyslog-mysql package contains a dynamic shared object that will | |
97 | add MySQL database support to rsyslog. | |
98 | ||
99 | %description mysql -l pl.UTF-8 | |
100 | Pakiet rsyslog-mysql zawiera moduł dynamiczny dodający obsługę bazy | |
101 | danych MySQL do rsysloga. | |
102 | ||
103 | %package pgsql | |
104 | Summary: PostgresSQL support for rsyslog | |
105 | Summary(pl.UTF-8): Obsługa PostgreSQL-a dla rsysloga | |
106 | Group: Daemons | |
107 | Requires: %{name} = %{version}-%{release} | |
108 | ||
109 | %description pgsql | |
110 | The rsyslog-pgsql package contains a dynamic shared object that will | |
111 | add PostgreSQL database support to rsyslog. | |
112 | ||
113 | %description pgsql -l pl.UTF-8 | |
114 | Pakiet rsyslog-pgsql zawiera moduł dynamiczny dodający obsługę bazy | |
115 | danych PostgreSQL do rsysloga. | |
116 | ||
117 | %package gssapi | |
118 | Summary: GSSAPI authentication and encryption support for rsyslog | |
119 | Summary(pl.UTF-8): Obsługa uwierzytelniania GSSAPI i szyfrowania dla rsysloga | |
120 | Group: Daemons | |
121 | Requires: %{name} = %{version}-%{release} | |
122 | ||
123 | %description gssapi | |
124 | The rsyslog-gssapi package contains the rsyslog plugins which support | |
125 | GSSAPI authentication and secure connections. GSSAPI is commonly used | |
126 | for Kerberos authentication. | |
127 | ||
128 | %description gssapi -l pl.UTF-8 | |
129 | Pakiet rsyslog-gssapi zawiera wtyczki rsysloga obsługujące | |
130 | uwierzytelnianie GSSAPI i bezpieczne połączenia. GSSAPI jest | |
131 | powszechnie używane do uwierzytelniania Kerberos. | |
132 | ||
133 | %package dbi | |
134 | Summary: libdbi database support for rsyslog | |
135 | Group: Daemons | |
136 | Requires: %{name} = %{version}-%{release} | |
137 | ||
138 | %description dbi | |
139 | This module supports a large number of database systems via | |
140 | libdbi. Libdbi abstracts the database layer and provides drivers for | |
141 | many systems. Drivers are available via the libdbi-drivers project. | |
142 | ||
143 | %package udpspoof | |
144 | Summary: Provides the omudpspoof module | |
145 | Group: Daemons | |
146 | Requires: %{name} = %{version}-%{release} | |
147 | ||
148 | %description udpspoof | |
149 | This module is similar to the regular UDP forwarder, but permits to | |
150 | spoof the sender address. Also, it enables to circle through a number | |
151 | of source ports. | |
152 | ||
153 | %package snmp | |
154 | Summary: SNMP protocol support for rsyslog | |
155 | Group: Daemons | |
156 | Requires: %{name} = %{version}-%{release} | |
157 | ||
158 | %description snmp | |
159 | The rsyslog-snmp package contains the rsyslog plugin that provides the | |
160 | ability to send syslog messages as SNMPv1 and SNMPv2c traps. | |
161 | ||
162 | %package gnutls | |
163 | Summary: TLS protocol support for rsyslog | |
164 | Group: Daemons | |
165 | Requires: %{name} = %{version}-%{release} | |
166 | ||
167 | %description gnutls | |
168 | The rsyslog-gnutls package contains the rsyslog plugins that provide the | |
169 | ability to receive syslog messages via upcoming syslog-transport-tls | |
170 | IETF standard protocol. | |
171 | ||
172 | %prep | |
173 | %setup -q | |
174 | %patch0 -p1 | |
175 | ||
176 | %build | |
177 | %configure \ | |
178 | --disable-silent-rules \ | |
179 | --enable-gnutls \ | |
180 | --enable-imdiag \ | |
181 | --enable-imfile \ | |
182 | --enable-impstats \ | |
183 | --enable-imptcp \ | |
184 | --enable-imtemplate \ | |
185 | --enable-mail \ | |
186 | --enable-mmsnmptrapd \ | |
187 | --enable-omdbalerting \ | |
188 | --enable-omprog \ | |
189 | --enable-omstdout \ | |
190 | --enable-omtemplate \ | |
191 | --enable-omudpspoof \ | |
192 | --enable-omuxsock \ | |
193 | --enable-pmaixforwardedfrom \ | |
194 | --enable-pmcisconames \ | |
195 | --enable-pmlastmsg \ | |
196 | --enable-pmrfc3164sd \ | |
197 | --enable-pmsnare \ | |
198 | --enable-smcustbindcdr \ | |
199 | --enable-unlimited-select \ | |
200 | %{?with_gssapi:--enable-gssapi-krb5} \ | |
201 | %{?with_mysql:--enable-mysql} \ | |
202 | %{?with_pgsql:--enable-pgsql} \ | |
203 | %{?with_snmp:--enable-snmp} \ | |
204 | %{?with_dbi:--enable-libdbi} \ | |
205 | --with-systemdsystemunitdir=/lib/systemd/system | |
206 | ||
207 | %{__make} | |
208 | ||
209 | %install | |
210 | rm -rf $RPM_BUILD_ROOT | |
211 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d,logrotate.d,rsyslog.d} \ | |
212 | $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},%{_bindir}} \ | |
213 | $RPM_BUILD_ROOT/{dev,var/log} | |
214 | ||
215 | %{__make} install \ | |
216 | DESTDIR=$RPM_BUILD_ROOT | |
217 | ||
218 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/rsyslog | |
219 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rsyslog.conf | |
220 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/rsyslog | |
221 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/rsyslog | |
222 | ||
223 | for n in debug kernel maillog messages secure syslog user spooler lpr daemon; do | |
224 | > $RPM_BUILD_ROOT/var/log/$n | |
225 | done | |
226 | ||
227 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/rsyslog/*.la | |
228 | ||
229 | %clean | |
230 | rm -rf $RPM_BUILD_ROOT | |
231 | ||
232 | %pre | |
233 | %groupadd -P syslog -g 18 syslog | |
234 | %useradd -P syslog -u 18 -g syslog -c "Syslog User" syslog | |
235 | %addusertogroup syslog logs | |
236 | ||
237 | %post | |
238 | for n in /var/log/{cron,daemon,debug,kernel,lpr,maillog,messages,secure,spooler,syslog,user}; do | |
239 | if [ -f $n ]; then | |
240 | chown root:logs $n | |
241 | continue | |
242 | else | |
243 | touch $n | |
244 | chmod 000 $n | |
245 | chown root:logs $n | |
246 | chmod 640 $n | |
247 | fi | |
248 | done | |
249 | ||
250 | /sbin/chkconfig --add %{name} | |
251 | %service rsyslog restart "%{name} daemon" | |
252 | ||
253 | %systemd_post rsyslog.service | |
254 | ln -sf /lib/systemd/system/rsyslog.service /etc/systemd/system/syslog.service || : | |
255 | ||
256 | %preun | |
257 | if [ "$1" = "0" ]; then | |
258 | %service %{name} stop | |
259 | /sbin/chkconfig --del %{name} | |
260 | fi | |
261 | %systemd_preun rsyslog.service | |
262 | ||
263 | %postun | |
264 | if [ "$1" = "0" ]; then | |
265 | %userremove syslog | |
266 | %groupremove syslog | |
267 | fi | |
268 | %systemd_reload | |
269 | ||
270 | %triggerpostun -- %{name} < 5.8.6-4 | |
271 | %systemd_trigger rsyslog.service | |
272 | ||
273 | %triggerpostun -- inetutils-syslogd | |
274 | /sbin/chkconfig --del syslog | |
275 | /sbin/chkconfig --add syslog | |
276 | if [ -f /etc/syslog.conf.rpmsave ]; then | |
277 | mv -f /etc/syslog.conf{,.rpmnew} | |
278 | mv -f /etc/syslog.conf{.rpmsave,} | |
279 | echo "Moved /etc/syslog.conf.rpmsave to /etc/syslog.conf" | |
280 | echo "Original file from package is available as /etc/syslog.conf.rpmnew" | |
281 | fi | |
282 | ||
283 | %files | |
284 | %defattr(644,root,root,755) | |
285 | %doc AUTHORS ChangeLog NEWS README | |
286 | %dir %{_sysconfdir}/rsyslog.d | |
287 | %attr(640,root,syslog) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rsyslog.conf | |
288 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rsyslog | |
289 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/rsyslog | |
290 | %attr(754,root,root) /etc/rc.d/init.d/rsyslog | |
291 | %attr(640,root,root) %ghost /var/log/* | |
292 | /lib/systemd/system/rsyslog.service | |
293 | %attr(755,root,root) %{_sbindir}/rsyslogd | |
294 | %dir %{_libdir}/rsyslog | |
295 | %attr(755,root,root) %{_libdir}/rsyslog/imfile.so | |
296 | %attr(755,root,root) %{_libdir}/rsyslog/imklog.so | |
297 | %attr(755,root,root) %{_libdir}/rsyslog/immark.so | |
298 | %attr(755,root,root) %{_libdir}/rsyslog/imtcp.so | |
299 | %attr(755,root,root) %{_libdir}/rsyslog/imudp.so | |
300 | %attr(755,root,root) %{_libdir}/rsyslog/imuxsock.so | |
301 | %attr(755,root,root) %{_libdir}/rsyslog/lmnet.so | |
302 | %attr(755,root,root) %{_libdir}/rsyslog/lmnetstrms.so | |
303 | %attr(755,root,root) %{_libdir}/rsyslog/lmnsd_ptcp.so | |
304 | %attr(755,root,root) %{_libdir}/rsyslog/lmregexp.so | |
305 | %attr(755,root,root) %{_libdir}/rsyslog/lmstrmsrv.so | |
306 | %attr(755,root,root) %{_libdir}/rsyslog/lmtcpclt.so | |
307 | %attr(755,root,root) %{_libdir}/rsyslog/lmtcpsrv.so | |
308 | %attr(755,root,root) %{_libdir}/rsyslog/lmzlibw.so | |
309 | %attr(755,root,root) %{_libdir}/rsyslog/omruleset.so | |
310 | %attr(755,root,root) %{_libdir}/rsyslog/omtesting.so | |
311 | %attr(755,root,root) %{_libdir}/rsyslog/imdiag.so | |
312 | %attr(755,root,root) %{_libdir}/rsyslog/impstats.so | |
313 | %attr(755,root,root) %{_libdir}/rsyslog/imptcp.so | |
314 | %attr(755,root,root) %{_libdir}/rsyslog/imtemplate.so | |
315 | %attr(755,root,root) %{_libdir}/rsyslog/mmsnmptrapd.so | |
316 | %attr(755,root,root) %{_libdir}/rsyslog/omdbalerting.so | |
317 | %attr(755,root,root) %{_libdir}/rsyslog/ommail.so | |
318 | %attr(755,root,root) %{_libdir}/rsyslog/omprog.so | |
319 | %attr(755,root,root) %{_libdir}/rsyslog/omstdout.so | |
320 | %attr(755,root,root) %{_libdir}/rsyslog/omtemplate.so | |
321 | %attr(755,root,root) %{_libdir}/rsyslog/omuxsock.so | |
322 | %attr(755,root,root) %{_libdir}/rsyslog/pmaixforwardedfrom.so | |
323 | %attr(755,root,root) %{_libdir}/rsyslog/pmcisconames.so | |
324 | %attr(755,root,root) %{_libdir}/rsyslog/pmlastmsg.so | |
325 | %attr(755,root,root) %{_libdir}/rsyslog/pmrfc3164sd.so | |
326 | %attr(755,root,root) %{_libdir}/rsyslog/pmsnare.so | |
327 | %attr(755,root,root) %{_libdir}/rsyslog/sm_cust_bindcdr.so | |
328 | %{_mandir}/man5/* | |
329 | %{_mandir}/man8/* | |
330 | ||
331 | %if %{with mysql} | |
332 | %files mysql | |
333 | %defattr(644,root,root,755) | |
334 | %doc plugins/ommysql/createDB.sql | |
335 | %attr(755,root,root) %{_libdir}/rsyslog/ommysql.so | |
336 | %endif | |
337 | ||
338 | %if %{with pgsql} | |
339 | %files pgsql | |
340 | %defattr(644,root,root,755) | |
341 | %doc plugins/ompgsql/createDB.sql | |
342 | %attr(755,root,root) %{_libdir}/rsyslog/ompgsql.so | |
343 | %endif | |
344 | ||
345 | %if %{with gssapi} | |
346 | %files gssapi | |
347 | %defattr(644,root,root,755) | |
348 | %attr(755,root,root) %{_libdir}/rsyslog/imgssapi.so | |
349 | %attr(755,root,root) %{_libdir}/rsyslog/lmgssutil.so | |
350 | %attr(755,root,root) %{_libdir}/rsyslog/omgssapi.so | |
351 | %endif | |
352 | ||
353 | %if %{with dbi} | |
354 | %files dbi | |
355 | %defattr(644,root,root,755) | |
356 | %attr(755,root,root) %{_libdir}/rsyslog/omlibdbi.so | |
357 | %endif | |
358 | ||
359 | %files udpspoof | |
360 | %defattr(644,root,root,755) | |
361 | %attr(755,root,root) %{_libdir}/rsyslog/omudpspoof.so | |
362 | ||
363 | %if %{with snmp} | |
364 | %files snmp | |
365 | %defattr(644,root,root,755) | |
366 | %attr(755,root,root) %{_libdir}/rsyslog/omsnmp.so | |
367 | %endif | |
368 | ||
369 | %files gnutls | |
370 | %defattr(644,root,root,755) | |
371 | %attr(755,root,root) %{_libdir}/rsyslog/lmnsd_gtls.so |