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