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