take care of sysklogd configuration files in %%post

This commit is contained in:
Peter Vrabec 2007-07-24 15:04:41 +00:00
parent e142fe8ddd
commit dae33bded2

View File

@ -4,7 +4,7 @@
Summary: Enhanced system logging and kernel message trapping daemons Summary: Enhanced system logging and kernel message trapping daemons
Name: rsyslog Name: rsyslog
Version: 1.17.2 Version: 1.17.2
Release: 2%{?dist} Release: 3%{?dist}
License: GPL License: GPL
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://www.rsyslog.com/ URL: http://www.rsyslog.com/
@ -24,7 +24,7 @@ Requires(preun): /sbin/chkconfig /sbin/chkconfig
Requires(postun): /sbin/service Requires(postun): /sbin/service
Provides: syslog Provides: syslog
Provides: sysklogd = 1.4.2.11 Provides: sysklogd = 1.4.2.11
Obsoletes: sysklogd <= 1.4.2-10 Obsoletes: sysklogd < 1.4.2-11
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description %description
@ -59,11 +59,6 @@ install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/rsyslog
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%pretrans
#use sysklogd configuration file
[ -f /etc/syslog.conf ] && cp -a /etc/syslog.conf /etc/rsyslog.conf >/dev/null 2>&1 ||:
[ -f /etc/sysconfig/syslog ] && cp -a /etc/sysconfig/syslog /etc/sysconfig/rsyslog >/dev/null 2>&1 ||:
%post %post
if [ $1 = 1 ]; then if [ $1 = 1 ]; then
/sbin/chkconfig --add rsyslog /sbin/chkconfig --add rsyslog
@ -73,6 +68,15 @@ do
[ -f $n ] && continue [ -f $n ] && continue
umask 066 && touch $n umask 066 && touch $n
done done
#use sysklogd configuration files
if [ -f /etc/syslog.conf ]; then
mv -f /etc/rsyslog.conf /etc/rsyslog.conf.rpmnew
mv -f /etc/syslog.conf /etc/rsyslog.conf
fi
if [ -f /etc/sysconfig/syslog ]; then
mv -f /etc/sysconfig/rsyslog /etc/sysconfig/rsyslog.rpmnew
mv -f /etc/sysconfig/syslog /etc/sysconfig/rsyslog
fi
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
@ -98,6 +102,9 @@ fi
%{_mandir}/*/* %{_mandir}/*/*
%changelog %changelog
* Tue Jul 24 2007 Peter Vrabec <pvrabec@redhat.com> 1.17.2-3
- take care of sysklogd configuration files in %%post
* Tue Jul 24 2007 Peter Vrabec <pvrabec@redhat.com> 1.17.2-2 * Tue Jul 24 2007 Peter Vrabec <pvrabec@redhat.com> 1.17.2-2
- use EVR in provides/obsoletes sysklogd - use EVR in provides/obsoletes sysklogd