Summary:     System logging and kernel message trapping daemons.
Summary(ja): システムとカーネルのログをログ記録するデーモン
Name:        sysklogd
Version:     1.5
Release:     1%{?_dist_release}
License:     GPL
Group:       System Environment/Daemons
URL:         http://www.infodrom.org/projects/sysklogd/
Source:      sysklogd-%{version}.tar.gz
Source1:     sysklogd-%{version}.conf
Source2:     sysklogd-%{version}.init
Source3:     sysklogd-%{version}.logrotate
Source4:     sysklogd-%{version}.sysconfig

BuildRoot:   %{_tmppath}/%{name}-%{version}-root
PreReq:      coreutils /sbin/chkconfig /etc/init.d
Requires:    logrotate bash >= 2.0
Provides:    syslog
Conflicts:   rsyslog, syslog-ng

%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 mail logs, security logs, error logs, etc.

%description -l ja
sysklogd パッケージには syslogd と klogd の 2つのシステムユーティリティが
収められており，システムロギングの機能を提供します．syslogd と klogd は
共にデーモン (バックグラウンドプロセス) として動作し，メイル/セキュリティ/
エラー といった，様々なシステムメッセージを個別のログファイルに出力します．


%prep
%setup -q


%build
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT{/etc,%{_mandir}/man{5,8},/sbin}

make install prefix=$RPM_BUILD_ROOT \
        TOPDIR=$RPM_BUILD_ROOT \
        MANDIR=$RPM_BUILD_ROOT%{_mandir} \
        BINDIR=$RPM_BUILD_ROOT/sbin \
	MAN_USER=`id -nu` MAN_GROUP=`id -ng`

mkdir -p $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig}

install -p -m644 %SOURCE1 $RPM_BUILD_ROOT/%{_sysconfdir}/syslog.conf
install -p -m755 %SOURCE2 $RPM_BUILD_ROOT/etc/rc.d/init.d/syslog
install -p -m644 %SOURCE3 $RPM_BUILD_ROOT/etc/logrotate.d/sysklogd
install -p -m644 %SOURCE4 $RPM_BUILD_ROOT/etc/sysconfig/sysklogd

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

%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/chkconfig --add syslog
for n in /var/log/{messages,secure,maillog,spooler}
do
	[ -f $n ] && continue
	umask 066 && touch $n
done
exit 0

%preun
if [ $1 = 0 ]; then
	[ -f /var/lock/subsys/syslog ] && 
		/sbin/service syslog stop >/dev/null 2>&1 || :
	/sbin/chkconfig --del syslog
fi
exit 0

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

%triggerpostun -- sysklogd < 1.3.31-17
/sbin/chkconfig --add syslog || :

%triggerpostun -- sysklogd < 1.3.33-5
/sbin/chkconfig syslog reset || :

%files
%defattr(-,root,root)
%doc ANNOUNCE CHANGES README* NEWS INSTALL COPYING
%config(noreplace) %{_sysconfdir}/syslog.conf
%config(noreplace) %{_sysconfdir}/sysconfig/sysklogd
%config(noreplace) %{_sysconfdir}/logrotate.d/sysklogd
%{_sysconfdir}/rc.d/init.d/syslog
/sbin/*
%{_mandir}/*/*


%changelog
* Sat Mar 28 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.5-1
- new upstream release
- drop patch2 (merged in upstream)
- add Provides: syslog
- add Conflicts: rsyslog, syslog-ng

* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 1.4.1-13vl5
- applied new versioning policy, spec in utf-8

* Thu Apr 05 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.4.1-13vl3
- rebuilt with current environment
- explicitly PreReq: coreutils instead of fileutils

* Sat Jun 05 2004 NISHIMURA Daisuke <nishi@graco.c.u-tokyo.ac.jp> 1.4.1-13vl2
- bug fix (Patch2) from Mandrake MDKSA-2004:038
- add URL tag
- %%description =~ s/sendmail/mail/

* Sat Sep 20 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.4.1-13vl1
- based on Redhat Rawhide 1.4.1-13
- rebuild with new toolchains
- s/Copyright/License/

* Mon Sep 03 2001 Toru Sagami <sagami@vinelinux.org>
- 1.4-7vl3: put cron logs in /var/log/cron by disabling the patch

* Sat Jun 16 2001 <sagami@vinelinux.org>
- 1.4-7vl2: added patch for duplicate log entry for /var/log/cron

* Mon Jun 11 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
- 1.4-7vl1
- added Japanese summary and description
- removed Requires: /etc/init.d for better compatibility with apt

* Wed Feb  7 2001 Bill Nottingham <notting@redhat.com>
- i18n tweaks

* Tue Jan 23 2001 Bill Nottingham <notting@redhat.com>
- new translation stuff

* Fri Jan 19 2001 Bill Nottingham <notting@redhat.com>
- adapt /etc/sysconfig/syslog for specification of arbitrary options (#23171)
- fix translation string slightly (#24088)

* Mon Dec 18 2000 Bill Nottingham <notting@redhat.com>
- don't set owner/group on manpages on install
- read /etc/sysconfig/syslog if present for some configuration paramters
- fix build with new kernel headers

* Tue Dec 12 2000 Bill Nottingham <notting@redhat.com>
- start klogd with '-2'

* Mon Dec 11 2000 Bill Nottingham <notting@redhat.com>
- update to 1.4

* Fri Dec 01 2000 Bill Nottingham <notting@redhat.com>
- rebuild because of broken fileutils

* Mon Oct 13 2000 Bill Nottingham <notting@redhat.com>
- don't log cron in two separate places (#18122)

* Thu Sep 14 2000 Bill Nottingham <notting@redhat.com>
- more fixes from solar@false.com, dan@debian.org; fix the security fix

* Tue Sep 12 2000 Jakub Jelinek <jakub@redhat.com>
- never ever call syslog with a user supplied string as second argument

* Mon Aug  7 2000 Bill Nottingham <notting@redhat.com>
- put cron logs in /var/log/cron; rotate them

* Wed Aug  2 2000 Bill Nottingham <notting@redhat.com>
- start at position 12, not 30 (we *need* to be before nfslock now)

* Fri Jul 28 2000 Bill Nottingham <notting@redhat.com>
- um, how did %preun get tacked onto %post?
- fix condrestart stuff

* Fri Jul 21 2000 Bill Nottingham <notting@redhat.com>
- add a umask call to the initscript

* Fri Jul 14 2000 Bill Nottingham <notting@redhat.com>
- move initscript back

* Fri Jul 14 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- update to 1.3.33

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Tue Jul 11 2000 Bill Nottingham <notting@redhat.com>
- fix logrotate script (#13698)

* Thu Jul  6 2000 Bill Nottingham <notting@redhat.com>
- prereq /etc/init.d

* Thu Jun 29 2000 Bill Nottingham <notting@redhat.com>
- fix init script

* Tue Jun 27 2000 Bill Nottingham <notting@redhat.com>
- require, not prereq new initscripts

* Mon Jun 26 2000 Bill Nottingham <notting@redhat.com>
- initscript munging

* Wed Jun 14 2000 Nalin Dahyabhai <nalin@redhat.com>
- modify logrotate configuration to use the PID file

* Sun Jun 11 2000 Bill Nottingham <notting@redhat.com>
- rebuild in new environment, FHS fixes

* Mon Mar 27 2000 Bill Nottingham <notting@redhat.com>
- handle bad directories passed to '-a' without behaving strangely (#10363)
- remove compatibility chkconfig links

* Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>
- handle compressed man pages

* Wed Dec  1 1999 Bill Nottingham <notting@redhat.com>
- add patch to fix segfaults in ksym-less cases from HP

* Mon Nov 15 1999 Bill Nottingham <notting@redhat.com>
- fix ECONNRESETs from security patch (olaf)

* Fri Sep 25 1999 Bill Nottingham <notting@redhat.com>
- eek. The security patch broke *two* things...

* Wed Sep 22 1999 Bill Nottingham <notting@redhat.com>
- make klogd actually work.

* Wed Sep  8 1999 Bill Nottingham <notting@redhat.com>
- rotate boot.log

* Tue Sep 07 1999 Cristian Gafton <gafton@redhat.com>
- add patch to fix a possible DoS (thanks Olaf Kirch)

* Mon Aug 16 1999 Bill Nottingham <notting@redhat.com>
- initscript munging

* Mon Aug  9 1999 Bill Nottingham <notting@redhat.com>
- patch to fix non-null terminated stuff in klogd

* Mon Jun 21 1999 Bill Nottingham <notting@redhat.com>
- move (sys|k)logd to /sbin

* Tue Apr 13 1999 Bill Nottingham <notting@redhat.com>
- log boot messages to boot.log
- actually put the sysklogd links in the new place

* Mon Apr 05 1999 Cristian Gafton <gafton@redhat.com>
- disable mark ticks by default

* Thu Apr  1 1999 Bill Nottingham <notting@redhat.com>
- stop klogd/syslogd as late as possible.

* Fri Mar 26 1999 Bill Nottingham <notting@redhat.com>
- twiddle initscript to avoid confusion

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 2)

* 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
