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