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