]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with dynamic # link dynamically with glib, eventlog, pcre, openssl | |
4 | %bcond_without sql # build without support for logging to SQL DB | |
5 | %bcond_without tests | |
6 | ||
7 | %define glib2_ver 2.24.0 | |
8 | Summary: Syslog-ng - new generation of the system logger | |
9 | Summary(pl.UTF-8): Syslog-ng - zamiennik syskloga | |
10 | Summary(pt_BR.UTF-8): Daemon de log nova geração | |
11 | Name: syslog-ng | |
12 | Version: 3.0.5 | |
13 | Release: 3.6 | |
14 | License: GPL v2 | |
15 | Group: Daemons | |
16 | Source0: http://www.balabit.com/downloads/files/syslog-ng/sources/%{version}/source/%{name}_%{version}.tar.gz | |
17 | # Source0-md5: 28f0d9ff2243b330e8cd6311ef9b2f12 | |
18 | Source1: %{name}.init | |
19 | Source2: %{name}.conf | |
20 | Source3: %{name}.logrotate | |
21 | Source4: http://www.balabit.com/dl/guides/%{name}-v3.0-guide-admin-en.pdf | |
22 | # Source4-md5: 1a801f138a9a2245009ecb617be4338b | |
23 | Source5: %{name}-simple.conf | |
24 | Source6: %{name}.upstart | |
25 | Patch0: %{name}-link.patch | |
26 | Patch1: %{name}-datadir.patch | |
27 | Patch2: %{name}-pyssl.patch | |
28 | Patch3: bug-15.patch | |
29 | URL: http://www.balabit.com/products/syslog_ng/ | |
30 | BuildRequires: autoconf >= 2.53 | |
31 | BuildRequires: automake | |
32 | BuildRequires: bison | |
33 | BuildRequires: flex | |
34 | BuildRequires: pkgconfig | |
35 | BuildRequires: rpmbuild(macros) >= 1.561 | |
36 | %if %{with tests} | |
37 | BuildRequires: libdbi-drivers-sqlite3 | |
38 | BuildRequires: tzdata | |
39 | %endif | |
40 | %if %{with dynamic} | |
41 | BuildRequires: eventlog-devel >= 0.2 | |
42 | BuildRequires: glib2-devel >= 1:%{glib2_ver} | |
43 | BuildRequires: libcap-devel | |
44 | %if %{with sql} | |
45 | BuildRequires: libdbi-devel >= 0.8.3-2 | |
46 | %endif | |
47 | BuildRequires: libnet-devel >= 1:1.1.2.1-3 | |
48 | BuildRequires: libwrap-devel | |
49 | BuildRequires: openssl-devel >= 0.9.8 | |
50 | BuildRequires: pcre-devel | |
51 | %else | |
52 | BuildRequires: eventlog-static >= 0.2 | |
53 | BuildRequires: glib2-static >= 1:%{glib2_ver} | |
54 | BuildRequires: glibc-static | |
55 | BuildRequires: libcap-static | |
56 | %if %{with sql} | |
57 | BuildRequires: libdbi-static >= 0.8.3-2 | |
58 | %endif | |
59 | BuildRequires: libnet-static >= 1:1.1.2.1-3 | |
60 | BuildRequires: libwrap-static | |
61 | BuildRequires: openssl-static >= 0.9.8 | |
62 | BuildRequires: pcre-static | |
63 | BuildRequires: zlib-static | |
64 | %endif | |
65 | Requires(post): fileutils | |
66 | Requires(post,preun): /sbin/chkconfig | |
67 | Requires: glib2 >= 1:%{glib2_ver} | |
68 | Requires: psmisc >= 20.1 | |
69 | Requires: rc-scripts >= 0.4.3.0 | |
70 | Provides: syslogdaemon | |
71 | Conflicts: klogd | |
72 | Conflicts: msyslog | |
73 | Conflicts: syslog | |
74 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
75 | ||
76 | %description | |
77 | syslog-ng is a syslogd replacement for Unix and Unix-like systems. It | |
78 | has been tested on Solaris, BSDi and Linux, and were found to run | |
79 | reliably. syslog-ng gives you a much enhanced configuration scheme, | |
80 | which lets you filter messages based on not only priority/facility | |
81 | pairs, but also on message content. You can use regexps to direct log | |
82 | stream to different destinations. A destination can be anything from a | |
83 | simple file to a network connection. syslog-ng supports TCP | |
84 | logforwarding, together with hashing to prevent unauthorized | |
85 | modification on the line. | |
86 | ||
87 | %description -l pl.UTF-8 | |
88 | Syslog-ng jest zamiennikiem dla standardowo używanych programów typu | |
89 | syslog. Działa w systemie SunOS, BSD, Linux. Daje znacznie większe | |
90 | możliwości logowania i kontrolowania zbieranych informacji. | |
91 | ||
92 | %description -l pt_BR.UTF-8 | |
93 | Syslog-ng é um substituto para o syslog tradicional, mas com diversas | |
94 | melhorias, como, por exemplo, a habilidade de filtrar mensagens de log | |
95 | por seu conteúdo (usando expressões regulares) e não apenas pelo par | |
96 | facility/prioridade como o syslog original. | |
97 | ||
98 | %package upstart | |
99 | Summary: Upstart job description for syslog-ng | |
100 | Summary(pl.UTF-8): Opis zadania Upstart dla syslog-ng | |
101 | Group: Daemons | |
102 | Requires: %{name} = %{version}-%{release} | |
103 | Requires: upstart >= 0.6 | |
104 | ||
105 | %description upstart | |
106 | Upstart job description for syslog-ng. | |
107 | ||
108 | %description upstart -l pl.UTF-8 | |
109 | Opis zadania Upstart dla syslog-ng. | |
110 | ||
111 | %prep | |
112 | %setup -q | |
113 | %patch0 -p1 | |
114 | %patch1 -p1 | |
115 | %patch2 -p1 | |
116 | %patch3 -p1 | |
117 | cp -a %{SOURCE4} doc | |
118 | cp -a %{SOURCE5} contrib | |
119 | ||
120 | %build | |
121 | %{__aclocal} | |
122 | %{__autoconf} | |
123 | %{__automake} | |
124 | %configure \ | |
125 | --sysconfdir=%{_sysconfdir}/syslog-ng \ | |
126 | --with-timezone-dir=%{_datadir}/zoneinfo \ | |
127 | --with-pidfile-dir=/var/run \ | |
128 | --enable-ssl \ | |
129 | --enable-ipv6 \ | |
130 | --enable-tcp-wrapper \ | |
131 | --enable-spoof-source \ | |
132 | --enable-linux-caps \ | |
133 | --enable-pcre \ | |
134 | %if %{with sql} | |
135 | --enable-sql \ | |
136 | %endif | |
137 | %if %{with dynamic} | |
138 | --enable-dynamic-linking | |
139 | %endif | |
140 | ||
141 | %{__make} | |
142 | ||
143 | %{?with_tests:%{__make} check} | |
144 | ||
145 | %install | |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | install -d $RPM_BUILD_ROOT{/etc/{init,sysconfig,logrotate.d,rc.d/init.d},%{_sysconfdir}/syslog-ng} \ | |
148 | $RPM_BUILD_ROOT/var/{log,lib/%{name}} | |
149 | ||
150 | %{__make} install \ | |
151 | DESTDIR=$RPM_BUILD_ROOT | |
152 | ||
153 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng | |
154 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf | |
155 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng | |
156 | ||
157 | for n in daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog | |
158 | do | |
159 | > $RPM_BUILD_ROOT/var/log/$n | |
160 | done | |
161 | touch $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
162 | ||
163 | rm $RPM_BUILD_ROOT%{_bindir}/loggen | |
164 | ||
165 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/init/%{name}.conf | |
166 | ||
167 | %clean | |
168 | rm -rf $RPM_BUILD_ROOT | |
169 | ||
170 | %post | |
171 | /sbin/chkconfig --add syslog-ng | |
172 | %service syslog-ng restart "syslog-ng daemon" | |
173 | ||
174 | %preun | |
175 | if [ "$1" = "0" ]; then | |
176 | %service syslog-ng stop | |
177 | /sbin/chkconfig --del syslog-ng | |
178 | fi | |
179 | ||
180 | %post upstart | |
181 | %upstart_post %{name} | |
182 | ||
183 | %postun upstart | |
184 | %upstart_postun %{name} | |
185 | ||
186 | %triggerun -- syslog-ng < 3.0 | |
187 | sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf | |
188 | sed -i -e 's#pipe ("/proc/kmsg"#file ("/proc/kmsg"#g' /etc/syslog-ng/syslog-ng.conf | |
189 | sed -i -e 's#log_prefix#program_override#g' /etc/syslog-ng/syslog-ng.conf | |
190 | sed -i -e 's#^destination #destination d_#g' /etc/syslog-ng/syslog-ng.conf | |
191 | sed -i -e 's#destination(#destination(d_#g' /etc/syslog-ng/syslog-ng.conf | |
192 | sed -i -e 's,\bstats\b,stats_freq,' /etc/syslog-ng/syslog-ng.conf | |
193 | sed -i -e 's#match("IN\=\[A-Za-z0-9\]\* OUT=\[A-Za-z0-9\]\*");#match("IN=[A-Za-z0-9]* OUT=[A-Za-z0-9]*" value("MESSAGE"));#g' /etc/syslog-ng/syslog-ng.conf | |
194 | sed -i -e "1 s#\(.*\)\$#@version: 3.0\n\1#g" /etc/syslog-ng/syslog-ng.conf | |
195 | rm -f %{_var}/lib/%{name}/syslog-ng.persist | |
196 | %service -q syslog-ng restart | |
197 | exit 0 | |
198 | ||
199 | %files | |
200 | %defattr(644,root,root,755) | |
201 | %doc AUTHORS ChangeLog NEWS debian/syslog-ng.conf* contrib/{relogger.pl,syslog-ng.vim} | |
202 | %doc doc/examples/syslog-ng.conf.sample contrib/syslog-ng.conf.{doc,RedHat} contrib/syslog-ng-simple.conf | |
203 | %doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-v3.0-guide-admin-en.pdf | |
204 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
205 | %attr(750,root,root) %dir %{_sysconfdir}/syslog-ng | |
206 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/syslog-ng.conf | |
207 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng | |
208 | %attr(754,root,root) /etc/rc.d/init.d/syslog-ng | |
209 | %attr(755,root,root) %{_sbindir}/syslog-ng | |
210 | %dir %{_var}/lib/%{name} | |
211 | %{_mandir}/man5/syslog-ng.conf.5* | |
212 | %{_mandir}/man8/syslog-ng.8* | |
213 | ||
214 | %attr(640,root,root) %ghost /var/log/* | |
215 | ||
216 | %files upstart | |
217 | %defattr(644,root,root,755) | |
218 | %config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf |