Sophie

Sophie

distrib > Mandriva > 7.2 > i586 > by-pkgid > 78a9580e3c691c550dc0eb9b23f2f66d > files > 13

sysklogd-1.4-4mdk.src.rpm

%define name sysklogd
%define release 4mdk
%define version 1.4

Summary: System logging and kernel message trapping daemons.
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: GPL
Group: System/Kernel and hardware 
Source: ftp://sunsite.unc.edu/pub/Linux/system/daemons/%{name}-%{version}.tar.bz2
Source1: syslog.conf.mdk.bz2
Source2: syslog.init.bz2
Source3: syslog.log.bz2
Patch1: sysklogd-1.3-alpha.patch.bz2
Patch2: sysklogd-1.3-rh.patch.bz2
Patch3: sysklogd-1.3-utmp-process.patch.bz2
Patch4: sysklogd-1.3-sparc.patch.bz2
# needed for 4.2 alpha
Patch5: sysklogd-1.3-alphafoo.patch.bz2
Patch6: sysklogd-nullterm.patch.bz2

# already included in 1.4
Patch7: sysklogd-fixDoS.patch.bz2

Patch8: sysklogd-dgram.patch.bz2

# already included in 1.4
Patch9: syslogd.patch2.bz2

Patch10: sysklogd-ksyms.patch.bz2
Patch11: sysklogd-baddir.patch.bz2

# correct vulnerability (already applied in 1.4)
Patch12: sysklogd-1.3-31-formatbug.path.bz2

Prereq: fileutils, /sbin/chkconfig
Prereq: initscripts
Requires: logrotate >= 3.3-8mdk
BuildRoot: %{_tmppath}/%{name}-%{version}-root

%description
The sysklogd package contains two system utilities (syslogd and klogd)
which provide support for system logging.  Syslogd and klogd run as
daemons (background processes) and log system messages to different
places, like sendmail logs, security logs, error logs, etc.

%prep
#%setup -q -n %{name}-1.3-33
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
#%patch7 -p1
%patch8 -p1
#%patch9 -p1
%patch10 -p1
%patch11 -p1
# already included in 1.4
#%patch12 -p1

%build
%make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
mkdir -p $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}/logrotate.d}

%makeinstall TOPDIR=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir}

bzcat %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/syslog.conf
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/syslog.conf

bzcat %{SOURCE2} >  $RPM_BUILD_ROOT%{_initrddir}/syslog
chmod 755 $RPM_BUILD_ROOT%{_initrddir}/syslog

bzcat %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/syslog
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/syslog

chmod 755 $RPM_BUILD_ROOT/sbin/syslogd
chmod 755 $RPM_BUILD_ROOT/sbin/klogd

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# Because RPM do not know the difference about a file or a directory,
# We need to verify if there is no file with the same name as the directory
# we want to create for the new logdir architecture.
# If the name is the same and it is a file, rename it to name.old

for file in mail cron kernel lpr news daemons; do
	if [ -f /var/log/$file ]; then 
		mv -f /var/log/$file /var/log/$file.old \
		&& mkdir /var/log/$file && mv /var/log/$file.old /var/log/$file/$file.old  
	fi
done

%post
# Create each log directory with logfiles : info, warnings, errors :
for dir in /var/log/{mail,cron,kernel,lpr,news,daemons}; do
    [ -d $dir ] || mkdir ${dir}
    for file in $dir/{info,warnings,errors}; do
        [ -f $file ] || touch $file && chmod 600 $file
    done
done

# Create standard logfiles if they do not exist:
for file in \
$RPM_BUILD_ROOT/var/log/{auth.log,syslog,user.log,messages,secure,spooler,boot.log};
do
    [ -f $file ] || touch $file && chmod 600 $file
done

/sbin/chkconfig --add syslog
%{_initrddir}/syslog condrestart

%preun
if [ $1 = 0 ]; then
   /sbin/chkconfig --del syslog
   service syslog stop >/dev/null 2>&1
fi

%postun
if [ "$1" -ge "1" ]; then
	service syslog condrestart > /dev/null 2>&1
fi	


%files
%defattr(-,root,root)
%doc ANNOUNCE README* NEWS INSTALL 
%config(noreplace) %{_sysconfdir}/syslog.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/syslog
%config(noreplace) %{_initrddir}/syslog

/sbin/*
%{_mandir}/*/*


%changelog
* Mon Sep 25 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.4-4mdk
- readded requirement for initscripts (but removed sysklogd 
  requirement in initscripts, see initscripts-5.27-27mdk) to 
  ease install.

* Mon Sep 25 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.4-3mdk
- added postun to restart syslog when upgrading
- sylog script relies on /etc/rc.d/init.d/functions so depends from 
  initscripts; starting and stopping syslog relies also on initscripts.
  But /sbin/initlog called by rc.sysinit from initscripts relies on 
  sysklogd... So for now I remove the initscripts requirement here.

* Fri Sep 22 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.4-2mdk
- added prereq on initscripts
- some cleanup

* Fri Sep 22 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.4-1mdk
- new version with several fixes

* Tue Sep 19 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.3.33-8mdk
- removed news.xxx entries also, they're added by inn package

* Tue Sep 19 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.3.33-7mdk
- removed mail.xxx entries in logrotate conf file

* Tue Sep 19 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.3.33-6mdk
- applied "format bug" patch to correct vulnerability (thanks to V.Danen)

* Thu Sep 14 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 1.3.33-5mdk
- modified logrotate.d conf file to avoid using * (see logrotate 3.3-9)

* Wed Sep 13 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 1.3.33-4mdk
- applied patch from Grzegorz Nosek <blackfire@go2.pl>,
  pass the system.map for our kernel version as argument to klogd if possible.

* Tue Sep 05 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 1.3.33-3mdk
- create all log file to avoid syslog warning.

- I was knowing that rpm sucked... Now I know that it suck hard.

  %ghost tag isn't able to create a directory, nor to touch file
  in a newly created by the %dir tag directory.
  So I'm creating all file in %post which is dirty.

  The conclusion of all this is that :
  It is good to make good package, but it's even better if you do it without rpm.
  (Thanks to Frederic Lepied who was as frightened as me when he saw that).

- Due to the new logdir architecture, 
  and that RPM can not distinguish a file and a directory :
    - Search for a file of the same name as the directory we wish to create,
      if such file exist, rename it to file.old and put it in the created
      directory in order for it to be rotated.

- In syslog initscript, created separate start and stop function
  (instead of having them in the case), and added a condrestart case which use them.
  This avoid having to re execute the syslog init script.

* Mon Sep 04 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 1.3.33-2mdk
- Completly rewritten syslog configuration
- Updated logrotate configuration file for new syslog config
  (log rotation recurssion is now avoided by logrotate itself, not
   configuration tweak)
- do not create init script link manually

* Fri Aug 25 2000 Frederic Crozat <fcrozat@mandrakesoft.com> 1.3.33-1mdk
- update to 1.3-33
- Use new initrddir macro 
- Correct logrotate config script to prevent rotating previous files

* Thu Aug 10 2000 Frederic Crozat <fcrozat@mandrakesoft.com> 1.3.31-15mdk
- add noreplace to make rpmlint happy

* Fri Jul 28 2000 Frederic Crozat <fcrozat@mandrakesoft.com> 1.3.31-14mdk
- BM + macroszification
- bzipped config files

* Tue May 17 2000 Yoann Vandoorselaere <yoann@mandrakeosft.com> 1.3.31-13mdk
- correct path to killall in syslog.log

* Thu May 04 2000 Yoann Vandoorselaere <yoann@mandrakeosft.com> 1.3.31-12mdk
- create the mail & news log directory.
- update syslog.log

* Tue May 02 2000 Yoann Vandoorselaere <yoann@mandrakeosft.com> 1.3.31-11mdk
- kern.* is now logged to kern.log
- much more logfile now (cron, syslog, kernel, mail.log, mail.warn, 
  mail.err, mail.info, auth.log, user.log, lpr.log, daemon.log ).
- do not sync() not important logfile everytime an entry is added.
- syslog.conf.rhs -> syslog.conf.mdk
- mail & news log are in their own directory.
- again a little config change.

* Thu Mar 23 2000 Daouda Lo <daouda@mandrakesoft.com> 1.3.31-8mdk
- fix group for the next release 7.1
* Tue Oct 26 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Merge with rh changes.

* Sat Apr 10 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com>
- Mandrake adaptions
- bzip2 man/info pages
- add de locale
- fix handling of RPM_OPT_FLAGS

* Wed Feb 24 1999 Bill Nottingham <notting@redhat.com>
- update to sysklogd-1.3-31
- stop klogd *before* syslogd

* Tue Feb  9 1999 Jeff Johnson <jbj@redhat.com>
- escape naked percent chars in kernel messages (#1088).

* Thu Dec 17 1998 Jeff Johnson <jbj@redhat.com>
- rework last-gasp address-in-module oops trace for both 2.0.x/2.1.x modules.

* Mon Dec  7 1998 Jakub Jelinek <jj@ultra.linux.cz>
- make klogd translate SPARC register dumps and oopses.

* Tue Aug 11 1998 Jeff Johnson <jbj@redhat.com>
- add %clean

* Tue Aug  4 1998 Chris Adams <cadams@ro.com>
- only log to entries that are USER_PROCESS (fix #822)

* Mon Jul 27 1998 Jeff Johnson <jbj@redhat.com>
- remove RPM_BUILD_ROOT from %post

* Wed Apr 29 1998 Cristian Gafton <gafton@redhat.com>
- patch to support Buildroot
- package is now buildrooted

* Wed Apr 29 1998 Michael K. Johnson <johnsonm@redhat.com>
- Added exit patch so that a normal daemon exit is not flagged as an error.

* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Wed Oct 29 1997 Donnie Barnes <djb@redhat.com>
- added (missingok) to init symlinks

* Thu Oct 23 1997 Donnie Barnes <djb@redhat.com>
- added status|restart support to syslog.init
- added chkconfig support
- various spec file cleanups

* Tue Jun 17 1997 Erik Troan <ewt@redhat.com>
- built against glibc