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