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