]> git.pld-linux.org Git - packages/syslog-ng.git/blame - syslog-ng.spec
- up to 3.0.9 (bug-15 was fixed in a different way, so this patch is obsolete)
[packages/syslog-ng.git] / syslog-ng.spec
CommitLineData
5aa38709 1#
8eca2e89 2# Conditional build:
808ca97e 3%bcond_with dynamic # link dynamically with glib, eventlog, pcre, openssl
306cd2c9
ER
4%if "%{pld_release}" == "ac"
5%bcond_with sql # build with support for logging to SQL DB
6%else
808ca97e 7%bcond_without sql # build without support for logging to SQL DB
306cd2c9 8%endif
f3688193 9%bcond_without tests
5461d50b 10
306cd2c9
ER
11%if "%{pld_release}" == "ac"
12%define glib2_ver 2.16.0
13%else
5461d50b 14%define glib2_ver 2.24.0
306cd2c9 15%endif
80a87a81 16Summary: Syslog-ng - new generation of the system logger
f7affeae
ER
17Summary(pl.UTF-8): Syslog-ng - zamiennik syskloga
18Summary(pt_BR.UTF-8): Daemon de log nova geração
db55bc6c 19Name: syslog-ng
0f932194
AM
20Version: 3.0.9
21Release: 1
2cb1bc96 22License: GPL v2
db55bc6c 23Group: Daemons
f6baa24a 24Source0: http://www.balabit.com/downloads/files/syslog-ng/sources/%{version}/source/%{name}_%{version}.tar.gz
0f932194 25# Source0-md5: 481e5dedcf355268bf4c95bddcae9e55
70c1937a 26Source1: %{name}.init
27Source2: %{name}.conf
e0f9b227 28Source3: %{name}.logrotate
0872fe7c 29Source4: http://www.balabit.com/dl/guides/%{name}-v3.0-guide-admin-en.pdf
f6baa24a 30# Source4-md5: 1a801f138a9a2245009ecb617be4338b
0872fe7c 31Source5: %{name}-simple.conf
c3d7f31f 32Source6: %{name}.upstart
489ceddf 33Patch0: %{name}-link.patch
4d910d4c 34Patch1: %{name}-datadir.patch
ab164ac9 35Patch2: %{name}-pyssl.patch
0f932194
AM
36Patch3: fix-unix-stream-caps.patch
37Patch4: fix-dac_override.patch
34c905de 38URL: http://www.balabit.com/products/syslog_ng/
96ef1ac7 39BuildRequires: autoconf >= 2.53
53500332 40BuildRequires: automake
c807fdfe 41BuildRequires: bison
ac9ca8e0 42BuildRequires: flex
bf8c4b27 43BuildRequires: pkgconfig
306cd2c9 44BuildRequires: rpm >= 4.4.9-56
1337adb4 45BuildRequires: rpmbuild(macros) >= 1.561
24642adc 46BuildRequires: which
bc708ef6 47%if %{with tests}
306cd2c9 48%{?with_sql:BuildRequires: libdbi-drivers-sqlite3}
24642adc 49BuildRequires: python
50BuildRequires: python-modules
bc708ef6
AF
51BuildRequires: tzdata
52%endif
8eca2e89 53%if %{with dynamic}
60232b55 54BuildRequires: eventlog-devel >= 0.2
5461d50b 55BuildRequires: glib2-devel >= 1:%{glib2_ver}
808ca97e 56BuildRequires: libcap-devel
24642adc 57%{?with_sql:BuildRequires: libdbi-devel >= 0.8.3-2}
422b3485
JB
58BuildRequires: libnet-devel >= 1:1.1.2.1-3
59BuildRequires: libwrap-devel
306cd2c9 60BuildRequires: openssl-devel
808ca97e 61BuildRequires: pcre-devel
8eca2e89 62%else
60232b55 63BuildRequires: eventlog-static >= 0.2
5461d50b 64BuildRequires: glib2-static >= 1:%{glib2_ver}
808ca97e
JR
65BuildRequires: glibc-static
66BuildRequires: libcap-static
24642adc 67%{?with_sql:BuildRequires: libdbi-static >= 0.8.3-2}
422b3485
JB
68BuildRequires: libnet-static >= 1:1.1.2.1-3
69BuildRequires: libwrap-static
306cd2c9 70BuildRequires: openssl-static
808ca97e
JR
71BuildRequires: pcre-static
72BuildRequires: zlib-static
8eca2e89 73%endif
768882cc 74Requires(post): fileutils
cc4597b5 75Requires(post,preun): /sbin/chkconfig
5461d50b 76Requires: glib2 >= 1:%{glib2_ver}
0471c4e3 77Requires: psmisc >= 20.1
622aa91c 78Requires: rc-scripts >= 0.4.3.0
18a2d4ea 79Provides: syslogdaemon
5db3c127 80Conflicts: klogd
1a409b7d 81Conflicts: msyslog
0baee825 82Conflicts: syslog
8a78073d 83BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
db55bc6c 84
db55bc6c 85%description
a42dcc7c 86syslog-ng is a syslogd replacement for Unix and Unix-like systems. It
70c1937a 87has been tested on Solaris, BSDi and Linux, and were found to run
88reliably. syslog-ng gives you a much enhanced configuration scheme,
89which lets you filter messages based on not only priority/facility
90pairs, but also on message content. You can use regexps to direct log
91stream to different destinations. A destination can be anything from a
92simple file to a network connection. syslog-ng supports TCP
93logforwarding, together with hashing to prevent unauthorized
94modification on the line.
db55bc6c 95
6ab9000c
JR
96%description -l pl.UTF-8
97Syslog-ng jest zamiennikiem dla standardowo używanych programów typu
a42dcc7c 98syslog. Działa w systemie SunOS, BSD, Linux. Daje znacznie większe
6ab9000c 99możliwości logowania i kontrolowania zbieranych informacji.
db55bc6c 100
6ab9000c
JR
101%description -l pt_BR.UTF-8
102Syslog-ng é um substituto para o syslog tradicional, mas com diversas
02e7b20a 103melhorias, como, por exemplo, a habilidade de filtrar mensagens de log
6ab9000c 104por seu conteúdo (usando expressões regulares) e não apenas pelo par
02e7b20a 105facility/prioridade como o syslog original.
106
c3d7f31f
JK
107%package upstart
108Summary: Upstart job description for syslog-ng
1337adb4 109Summary(pl.UTF-8): Opis zadania Upstart dla syslog-ng
c3d7f31f
JK
110Group: Daemons
111Requires: %{name} = %{version}-%{release}
112Requires: upstart >= 0.6
113
114%description upstart
115Upstart job description for syslog-ng.
116
117%description upstart -l pl.UTF-8
1337adb4 118Opis zadania Upstart dla syslog-ng.
c3d7f31f 119
db55bc6c 120%prep
40b3220e 121%setup -q
489ceddf 122%patch0 -p1
4d910d4c 123%patch1 -p1
831a39da
JR
124%patch2 -p1
125%patch3 -p1
ed6fb0bc 126%patch4 -p1
0872fe7c 127cp -a %{SOURCE4} doc
f83d4749 128cp -a %{SOURCE5} contrib/syslog-ng.conf.simple
b6fee34c 129
db55bc6c 130%build
9bb26796 131%{__aclocal}
4ce65bfa 132%{__autoconf}
133%{__automake}
c67bc54f 134%configure \
8eca2e89 135 --sysconfdir=%{_sysconfdir}/syslog-ng \
808ca97e
JR
136 --with-timezone-dir=%{_datadir}/zoneinfo \
137 --with-pidfile-dir=/var/run \
138 --enable-ssl \
139 --enable-ipv6 \
140 --enable-tcp-wrapper \
141 --enable-spoof-source \
142 --enable-linux-caps \
143 --enable-pcre \
144%if %{with sql}
145 --enable-sql \
146%endif
8eca2e89
JB
147%if %{with dynamic}
148 --enable-dynamic-linking
149%endif
4298f6c0 150
84ad47e7 151%{__make}
db55bc6c 152
f3688193
AM
153%{?with_tests:%{__make} check}
154
db55bc6c 155%install
db55bc6c 156rm -rf $RPM_BUILD_ROOT
c3d7f31f 157install -d $RPM_BUILD_ROOT{/etc/{init,sysconfig,logrotate.d,rc.d/init.d},%{_sysconfdir}/syslog-ng} \
4d910d4c 158 $RPM_BUILD_ROOT/var/{log,lib/%{name}}
db55bc6c 159
4d7c194a
PG
160%{__make} install \
161 DESTDIR=$RPM_BUILD_ROOT
db55bc6c 162
306cd2c9
ER
163install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog-ng
164cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/syslog-ng.conf
165cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/syslog-ng
db55bc6c 166
306cd2c9 167for n in daemon debug iptables kernel lpr maillog messages secure spooler syslog user xferlog; do
3fb60e3b
JR
168 > $RPM_BUILD_ROOT/var/log/$n
169done
2a14aff2 170touch $RPM_BUILD_ROOT/etc/sysconfig/%{name}
db55bc6c 171
f2972fae
ER
172rm $RPM_BUILD_ROOT%{_bindir}/loggen
173
306cd2c9
ER
174%if "%{pld_release}" == "th"
175cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/init/%{name}.conf
176%endif
c3d7f31f 177
80a87a81
JB
178%clean
179rm -rf $RPM_BUILD_ROOT
180
db55bc6c 181%post
1519c9ad
ER
182if [ "$1" = "1" ]; then
183 # disable /proc/kmsg from config on first install on vserver
184 {
185 while read f ctx; do
186 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
187 done </proc/self/status
188 } 2>/dev/null
189 if [ -z "$ctx" -o "$ctx" = "0" ]; then
190 VSERVER=no
191 else
192 VSERVER=yes
193 fi
194 if [ "$VSERVER" = "yes" ]; then
195 %{__sed} -i -e '/\/proc\/kmsg/ s/^[^#]/#&/' %{_sysconfdir}/%{name}/%{name}.conf
196 fi
197fi
198
0b833f9b 199/sbin/chkconfig --add syslog-ng
da4f5bde 200%service syslog-ng restart "syslog-ng daemon"
db55bc6c 201
202%preun
0b833f9b 203if [ "$1" = "0" ]; then
da4f5bde 204 %service syslog-ng stop
0b833f9b 205 /sbin/chkconfig --del syslog-ng
206fi
db55bc6c 207
c3d7f31f
JK
208%post upstart
209%upstart_post %{name}
210
211%postun upstart
212%upstart_postun %{name}
213
31446e62 214%triggerun -- syslog-ng < 3.0
60bdc15a 215sed -i -e 's#sync(\(.*\))#flush_lines(\1)#g' /etc/syslog-ng/syslog-ng.conf
31446e62
AM
216sed -i -e 's#pipe ("/proc/kmsg"#file ("/proc/kmsg"#g' /etc/syslog-ng/syslog-ng.conf
217sed -i -e 's#log_prefix#program_override#g' /etc/syslog-ng/syslog-ng.conf
218sed -i -e 's#^destination #destination d_#g' /etc/syslog-ng/syslog-ng.conf
219sed -i -e 's#destination(#destination(d_#g' /etc/syslog-ng/syslog-ng.conf
01113c19 220sed -i -e 's,\bstats\b,stats_freq,' /etc/syslog-ng/syslog-ng.conf
31446e62
AM
221sed -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
222sed -i -e "1 s#\(.*\)\$#@version: 3.0\n\1#g" /etc/syslog-ng/syslog-ng.conf
223rm -f %{_var}/lib/%{name}/syslog-ng.persist
e3a52627 224%service -q syslog-ng restart
31446e62
AM
225exit 0
226
db55bc6c 227%files
a25388f3 228%defattr(644,root,root,755)
0091ccbb 229%doc AUTHORS ChangeLog NEWS debian/syslog-ng.conf* contrib/relogger.pl
f83d4749 230%doc doc/examples/syslog-ng.conf.sample contrib/syslog-ng.conf.{doc,simple,RedHat}
0872fe7c 231%doc contrib/{apparmor,selinux,syslog2ng} doc/syslog-ng-v3.0-guide-admin-en.pdf
2a14aff2 232%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
a25388f3 233%attr(750,root,root) %dir %{_sysconfdir}/syslog-ng
cc4597b5
ER
234%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/syslog-ng/syslog-ng.conf
235%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/syslog-ng
a25388f3 236%attr(754,root,root) /etc/rc.d/init.d/syslog-ng
302dff3f 237%attr(755,root,root) %{_sbindir}/syslog-ng
4d910d4c 238%dir %{_var}/lib/%{name}
81f47e04
JB
239%{_mandir}/man5/syslog-ng.conf.5*
240%{_mandir}/man8/syslog-ng.8*
822b8fbf 241
3fb60e3b 242%attr(640,root,root) %ghost /var/log/*
c3d7f31f 243
306cd2c9 244%if "%{pld_release}" == "th"
c3d7f31f
JK
245%files upstart
246%defattr(644,root,root,755)
247%config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf
306cd2c9 248%endif
This page took 0.140527 seconds and 4 git commands to generate.