]>
Commit | Line | Data |
---|---|---|
88d746d2 ER |
1 | # TODO |
2 | # - consider moving snmp, db, ... libs to subpackage, so main pkg would be without extra deps | |
3 | # - without gssapi still generates dep on heimdal-libs | |
4 | # - klogd? remove if this daemon does not have standalone klogd daemon at all | |
5997e750 SP |
5 | # |
6 | # Conditional build: | |
73b56bd9 | 7 | %bcond_without gssapi # GSSAPI Kerberos 5 support |
88d746d2 | 8 | %bcond_without mysql # MySQL database support |
73b56bd9 JB |
9 | %bcond_without pgsql # PostgreSQL database support |
10 | %bcond_without snmp # SNMP support | |
88d746d2 | 11 | |
284a559d PG |
12 | Summary: Linux system and kernel logger |
13 | Summary(de.UTF-8): Linux-System- und Kerner-Logger | |
14 | Summary(es.UTF-8): Registrador de log del sistema linux | |
15 | Summary(fr.UTF-8): Le système Linux et le logger du noyau | |
16 | Summary(pl.UTF-8): Programy logujące zdarzenia w systemie i jądrze Linuksa | |
17 | Summary(pt_BR.UTF-8): Registrador de log do sistema linux | |
18 | Summary(tr.UTF-8): Linux sistem ve çekirdek kayıt süreci | |
19 | Name: rsyslog | |
85a9b2b1 | 20 | Version: 5.6.5 |
e6ad1447 | 21 | Release: 2 |
8b647ddd | 22 | License: GPL v3+ |
284a559d | 23 | Group: Daemons |
d7a7c8fb | 24 | Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz |
85a9b2b1 | 25 | # Source0-md5: ab675f5856a35f6aa0cd6ab057443ead |
a097ef7f SP |
26 | Source1: %{name}.init |
27 | Source2: %{name}.conf | |
28 | Source3: %{name}.sysconfig | |
5b253f29 | 29 | Source4: %{name}.logrotate |
f0da554a | 30 | URL: http://www.rsyslog.com/ |
2bf17689 | 31 | %{?with_gssapi:BuildRequires: heimdal-devel} |
73b56bd9 JB |
32 | %{?with_mysql:BuildRequires: mysql-devel} |
33 | %{?with_snmp:BuildRequires: net-snmp-devel} | |
d594a7b2 | 34 | BuildRequires: pkgconfig |
73b56bd9 | 35 | %{?with_pgsql:BuildRequires: postgresql-devel} |
284a559d PG |
36 | Requires(post): fileutils |
37 | Requires(post,preun): /sbin/chkconfig | |
38 | Requires(post,preun): rc-scripts >= 0.2.0 | |
39 | Requires(postun): /usr/sbin/groupdel | |
40 | Requires(postun): /usr/sbin/userdel | |
284a559d PG |
41 | Requires(pre): /bin/id |
42 | Requires(pre): /usr/bin/getgid | |
707ea13f | 43 | Requires(pre): /usr/lib/rpm/user_group.sh |
284a559d PG |
44 | Requires(pre): /usr/sbin/groupadd |
45 | Requires(pre): /usr/sbin/useradd | |
46 | Requires(pre): /usr/sbin/usermod | |
47 | Requires(triggerpostun): sed >= 4.0 | |
48 | # for vservers we don't need klogd and syslog works without klogd | |
49 | # (just it doesn't log kernel buffer into syslog) | |
50 | # Requires: klogd | |
51 | Requires: logrotate >= 3.2-3 | |
52 | Requires: psmisc >= 20.1 | |
53 | Provides: group(syslog) | |
54 | Provides: syslogdaemon | |
55 | Provides: user(syslog) | |
56 | Obsoletes: msyslog | |
57 | Obsoletes: sysklogd | |
58 | Obsoletes: syslog-ng | |
3714e2e4 | 59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
284a559d | 60 | |
3714e2e4 | 61 | %description |
707ea13f SP |
62 | Rsyslog is an enhanced multi-threaded syslogd supporting, among |
63 | others, MySQL, syslog/tcp, RFC 3195, permitted sender lists, filtering | |
64 | on any message part, and fine grain output format control. It is quite | |
65 | compatible to stock sysklogd and can be used as a drop-in replacement. | |
66 | Its advanced features make it suitable for enterprise-class, | |
67 | encryption protected syslog relay chains while at the same time being | |
68 | very easy to setup for the novice user. | |
284a559d | 69 | |
73b56bd9 JB |
70 | %description -l pl.UTF-8 |
71 | rsyslog to zaawansowany, wielowątkowy syslogd obsługujący m.in. | |
72 | MySQL-a, syslog/tcp, RFC 3195, listy dopuszczalnych nadawców, | |
0ca0cfed ER |
73 | filtrowanie po częściach komunikatów i szczegółową kontrolę formatu |
74 | wyjściowego. Jest w miarę kompatybilny ze zwykłym sysklogd i może być | |
75 | używany jako jego zamiennik. Jego zaawansowane możliwości czynią go | |
76 | odpowiednim do produkcyjnych, szyfrowanych łańcuchów przekazywania | |
77 | logów, a jednocześnie jest przy tym łatwy do skonfigurowania dla | |
78 | początkującego użytkownika. | |
73b56bd9 | 79 | |
3714e2e4 | 80 | %package klogd |
284a559d PG |
81 | Summary: Linux kernel logger |
82 | Summary(de.UTF-8): Linux-Kerner-Logger | |
83 | Summary(pl.UTF-8): Program logujący zdarzenia w jądrze Linuksa | |
84 | Group: Daemons | |
85 | Requires(post,preun): /sbin/chkconfig | |
86 | Requires(post,preun): rc-scripts >= 0.2.0 | |
87 | Requires(postun): /usr/sbin/groupdel | |
88 | Requires(postun): /usr/sbin/userdel | |
284a559d PG |
89 | Requires(pre): /bin/id |
90 | Requires(pre): /usr/bin/getgid | |
707ea13f | 91 | Requires(pre): /usr/lib/rpm/user_group.sh |
284a559d PG |
92 | Requires(pre): /usr/sbin/groupadd |
93 | Requires(pre): /usr/sbin/useradd | |
94 | Requires(pre): /usr/sbin/usermod | |
95 | Provides: group(syslog) | |
96 | Provides: user(syslog) | |
97 | Obsoletes: sysklogd | |
98 | ||
3714e2e4 | 99 | %description klogd |
284a559d PG |
100 | This is the Linux kernel logging program. It is run as a daemon |
101 | (background process) to log messages from kernel. | |
102 | ||
73b56bd9 | 103 | %description klogd -l pl.UTF-8 |
0ca0cfed ER |
104 | Pakiet ten zawiera program, który jest uruchamiany jako demon i służy |
105 | do logowania komunikatów jądra Linuksa. | |
284a559d | 106 | |
4fffed3f | 107 | %package mysql |
f0da554a | 108 | Summary: MySQL support for rsyslog |
73b56bd9 | 109 | Summary(pl.UTF-8): Obsługa MySQL-a do rsysloga |
f0da554a | 110 | Group: Daemons |
d820c9a0 | 111 | Requires: %{name} = %{version}-%{release} |
4fffed3f SP |
112 | |
113 | %description mysql | |
f0da554a SP |
114 | The rsyslog-mysql package contains a dynamic shared object that will |
115 | add MySQL database support to rsyslog. | |
4fffed3f | 116 | |
73b56bd9 | 117 | %description mysql -l pl.UTF-8 |
0ca0cfed ER |
118 | Pakiet rsyslog-mysql zawiera moduł dynamiczny dodający obsługę bazy |
119 | danych MySQL do rsysloga. | |
73b56bd9 | 120 | |
4fffed3f | 121 | %package pgsql |
f0da554a | 122 | Summary: PostgresSQL support for rsyslog |
73b56bd9 | 123 | Summary(pl.UTF-8): Obsługa PostgreSQL-a dla rsysloga |
f0da554a | 124 | Group: Daemons |
d820c9a0 | 125 | Requires: %{name} = %{version}-%{release} |
4fffed3f SP |
126 | |
127 | %description pgsql | |
f0da554a SP |
128 | The rsyslog-pgsql package contains a dynamic shared object that will |
129 | add PostgreSQL database support to rsyslog. | |
4fffed3f | 130 | |
73b56bd9 | 131 | %description pgsql -l pl.UTF-8 |
0ca0cfed ER |
132 | Pakiet rsyslog-pgsql zawiera moduł dynamiczny dodający obsługę bazy |
133 | danych PostgreSQL do rsysloga. | |
73b56bd9 | 134 | |
4fffed3f | 135 | %package gssapi |
f0da554a | 136 | Summary: GSSAPI authentication and encryption support for rsyslog |
73b56bd9 | 137 | Summary(pl.UTF-8): Obsługa uwierzytelniania GSSAPI i szyfrowania dla rsysloga |
f0da554a | 138 | Group: Daemons |
d820c9a0 | 139 | Requires: %{name} = %{version}-%{release} |
4fffed3f SP |
140 | |
141 | %description gssapi | |
f0da554a SP |
142 | The rsyslog-gssapi package contains the rsyslog plugins which support |
143 | GSSAPI authentication and secure connections. GSSAPI is commonly used | |
144 | for Kerberos authentication. | |
4fffed3f | 145 | |
73b56bd9 JB |
146 | %description gssapi -l pl.UTF-8 |
147 | Pakiet rsyslog-gssapi zawiera wtyczki rsysloga obsługujące | |
148 | uwierzytelnianie GSSAPI i bezpieczne połączenia. GSSAPI jest | |
149 | powszechnie używane do uwierzytelniania Kerberos. | |
150 | ||
284a559d PG |
151 | %prep |
152 | %setup -q | |
284a559d PG |
153 | |
154 | %build | |
5997e750 | 155 | %configure \ |
ec96f36f | 156 | --enable-imfile \ |
73b56bd9 JB |
157 | %{?with_gssapi:--enable-gssapi-krb5} \ |
158 | %{?with_mysql:--enable-mysql} \ | |
159 | %{?with_pgsql:--enable-pgsql} \ | |
160 | %{?with_snmp:--enable-snmp} | |
5997e750 | 161 | |
3714e2e4 | 162 | %{__make} |
284a559d PG |
163 | |
164 | %install | |
165 | rm -rf $RPM_BUILD_ROOT | |
f16b19a4 | 166 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d,logrotate.d,rsyslog.d} \ |
284a559d PG |
167 | $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},%{_bindir}} \ |
168 | $RPM_BUILD_ROOT/{dev,var/log} | |
169 | ||
170 | %{__make} install \ | |
4fffed3f | 171 | DESTDIR=$RPM_BUILD_ROOT |
284a559d | 172 | |
88d746d2 ER |
173 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/rsyslog |
174 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rsyslog.conf | |
175 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/rsyslog | |
176 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/rsyslog | |
a097ef7f | 177 | |
88d746d2 | 178 | for n in debug kernel maillog messages secure syslog user spooler lpr daemon; do |
284a559d PG |
179 | > $RPM_BUILD_ROOT/var/log/$n |
180 | done | |
181 | ||
00340333 JB |
182 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/rsyslog/*.la |
183 | ||
184 | %clean | |
185 | rm -rf $RPM_BUILD_ROOT | |
186 | ||
3714e2e4 | 187 | %pre |
284a559d PG |
188 | %groupadd -P syslog -g 18 syslog |
189 | %useradd -P syslog -u 18 -g syslog -c "Syslog User" syslog | |
190 | %addusertogroup syslog logs | |
191 | ||
3714e2e4 | 192 | %post |
284a559d PG |
193 | for n in /var/log/{cron,daemon,debug,kernel,lpr,maillog,messages,secure,spooler,syslog,user}; do |
194 | if [ -f $n ]; then | |
ec96f36f | 195 | chown root:logs $n |
284a559d PG |
196 | continue |
197 | else | |
198 | touch $n | |
199 | chmod 000 $n | |
ec96f36f | 200 | chown root:logs $n |
284a559d PG |
201 | chmod 640 $n |
202 | fi | |
203 | done | |
204 | ||
3714e2e4 | 205 | /sbin/chkconfig --add %{name} |
f16b19a4 | 206 | %service rsyslog restart "%{name} daemon" |
3714e2e4 | 207 | %service -q %{name}-klogd restart |
284a559d | 208 | |
3714e2e4 | 209 | %preun |
284a559d | 210 | if [ "$1" = "0" ]; then |
3714e2e4 PG |
211 | %service %{name} stop |
212 | /sbin/chkconfig --del %{name} | |
284a559d PG |
213 | fi |
214 | ||
3714e2e4 | 215 | %postun |
284a559d PG |
216 | if [ "$1" = "0" ]; then |
217 | %userremove syslog | |
218 | %groupremove syslog | |
219 | fi | |
220 | ||
3714e2e4 | 221 | %pre klogd |
284a559d PG |
222 | %groupadd -P klogd -g 18 syslog |
223 | %useradd -P klogd -u 18 -g syslog -c "Syslog User" syslog | |
224 | %addusertogroup syslog logs | |
225 | ||
3714e2e4 PG |
226 | %post klogd |
227 | /sbin/chkconfig --add %{name}-klogd | |
228 | %service %{name}-klogd restart "kernel logger daemon" | |
284a559d | 229 | |
3714e2e4 | 230 | %preun klogd |
284a559d | 231 | if [ "$1" = "0" ]; then |
3714e2e4 PG |
232 | %service %{name}-klogd stop |
233 | /sbin/chkconfig --del %{name}-klogd | |
284a559d PG |
234 | fi |
235 | ||
3714e2e4 | 236 | %postun klogd |
284a559d PG |
237 | if [ "$1" = "0" ]; then |
238 | %userremove syslog | |
239 | %groupremove syslog | |
240 | fi | |
241 | ||
242 | %triggerpostun -- inetutils-syslogd | |
243 | /sbin/chkconfig --del syslog | |
244 | /sbin/chkconfig --add syslog | |
245 | if [ -f /etc/syslog.conf.rpmsave ]; then | |
246 | mv -f /etc/syslog.conf{,.rpmnew} | |
247 | mv -f /etc/syslog.conf{.rpmsave,} | |
248 | echo "Moved /etc/syslog.conf.rpmsave to /etc/syslog.conf" | |
249 | echo "Original file from package is available as /etc/syslog.conf.rpmnew" | |
250 | fi | |
251 | ||
3714e2e4 | 252 | %files |
284a559d | 253 | %defattr(644,root,root,755) |
5997e750 | 254 | %doc AUTHORS ChangeLog NEWS README |
f16b19a4 | 255 | %dir %{_sysconfdir}/rsyslog.d |
ec96f36f | 256 | %attr(640,root,syslog) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rsyslog.conf |
a097ef7f SP |
257 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rsyslog |
258 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/rsyslog | |
259 | %attr(754,root,root) /etc/rc.d/init.d/rsyslog | |
284a559d | 260 | %attr(640,root,root) %ghost /var/log/* |
3714e2e4 | 261 | %attr(755,root,root) %{_sbindir}/rsyslogd |
d30c8748 | 262 | %dir %{_libdir}/rsyslog |
ec96f36f | 263 | %attr(755,root,root) %{_libdir}/rsyslog/imfile.so |
73b56bd9 JB |
264 | %attr(755,root,root) %{_libdir}/rsyslog/imklog.so |
265 | %attr(755,root,root) %{_libdir}/rsyslog/immark.so | |
266 | %attr(755,root,root) %{_libdir}/rsyslog/imtcp.so | |
267 | %attr(755,root,root) %{_libdir}/rsyslog/imudp.so | |
268 | %attr(755,root,root) %{_libdir}/rsyslog/imuxsock.so | |
73b56bd9 | 269 | %attr(755,root,root) %{_libdir}/rsyslog/lmnet.so |
5b253f29 AM |
270 | %attr(755,root,root) %{_libdir}/rsyslog/lmnetstrms.so |
271 | %attr(755,root,root) %{_libdir}/rsyslog/lmnsd_ptcp.so | |
73b56bd9 | 272 | %attr(755,root,root) %{_libdir}/rsyslog/lmregexp.so |
17f8b5ba | 273 | %attr(755,root,root) %{_libdir}/rsyslog/lmstrmsrv.so |
73b56bd9 JB |
274 | %attr(755,root,root) %{_libdir}/rsyslog/lmtcpclt.so |
275 | %attr(755,root,root) %{_libdir}/rsyslog/lmtcpsrv.so | |
17f8b5ba | 276 | %attr(755,root,root) %{_libdir}/rsyslog/lmzlibw.so |
22573281 | 277 | %attr(755,root,root) %{_libdir}/rsyslog/omruleset.so |
ec96f36f | 278 | %attr(755,root,root) %{_libdir}/rsyslog/omsnmp.so |
73b56bd9 | 279 | %attr(755,root,root) %{_libdir}/rsyslog/omtesting.so |
4fffed3f SP |
280 | %{_mandir}/man5/* |
281 | %{_mandir}/man8/* | |
284a559d | 282 | |
73b56bd9 JB |
283 | #%files klogd |
284 | #%defattr(644,root,root,755) | |
3714e2e4 PG |
285 | #%attr(754,root,root) /etc/rc.d/init.d/klogd |
286 | #%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/klogd | |
287 | #%attr(755,root,root) %{_sbindir}/klogd | |
4fffed3f | 288 | |
bd9b9208 | 289 | %if %{with mysql} |
4fffed3f SP |
290 | %files mysql |
291 | %defattr(644,root,root,755) | |
292 | %doc plugins/ommysql/createDB.sql | |
73b56bd9 | 293 | %attr(755,root,root) %{_libdir}/rsyslog/ommysql.so |
bd9b9208 | 294 | %endif |
4fffed3f | 295 | |
bd9b9208 | 296 | %if %{with pgsql} |
4fffed3f SP |
297 | %files pgsql |
298 | %defattr(644,root,root,755) | |
299 | %doc plugins/ompgsql/createDB.sql | |
73b56bd9 | 300 | %attr(755,root,root) %{_libdir}/rsyslog/ompgsql.so |
bd9b9208 | 301 | %endif |
4fffed3f | 302 | |
bd9b9208 | 303 | %if %{with gssapi} |
4fffed3f SP |
304 | %files gssapi |
305 | %defattr(644,root,root,755) | |
73b56bd9 | 306 | %attr(755,root,root) %{_libdir}/rsyslog/imgssapi.so |
c1934518 | 307 | %attr(755,root,root) %{_libdir}/rsyslog/lmgssutil.so |
73b56bd9 | 308 | %attr(755,root,root) %{_libdir}/rsyslog/omgssapi.so |
bd9b9208 | 309 | %endif |