syslogd/syslogd.spec

345 lines
11 KiB
RPMSpec
Raw Normal View History

#
# spec file for package syslogd
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: syslogd
%define omc_prefix /usr/share/omc
%define omc_svcdir %{omc_prefix}/svcinfo.d
BuildRequires: pkg-config
BuildRequires: systemd-devel
Requires(post): %fillup_prereq
Requires(post): %insserv_prereq
Requires(post): permissions
Requires(postun): %insserv_prereq
Requires(prereq): coreutils
Requires(prereq): klogd
Requires(prereq): sed
Requires(prereq): syslog-service
Provides: sysklogd
Provides: syslog
Version: 1.4.1
Release: 0
Summary: The Syslog daemon
License: GPL-2.0+
Group: System/Daemons
Source: sysklogd-1.4.1.tar.bz2
Source1: logrotate.syslog
Source2: sysconfig.syslog
Source3: sysconfig.syslogd
Source4: sysconfig.klogd
Source5: rc.syslog
Source6: rc.earlysyslog
Source7: syslog.xml
Source8: syslog.8
Source9: syslog-service-generator
Source10: klogd.service
Source11: syslog.service
Source12: klog.service
Patch0: sysklogd-1.4.1.dif
Patch1: sysklogd-1.4.1-dgram.patch
Patch2: sysklogd-1.4.1-sparc.patch
Patch3: sysklogd-1.4.1-forw.patch
Patch4: sysklogd-1.4.1-fileleak.patch
Patch5: sysklogd-ipv6.diff
Patch6: sysklogd-1.4.1-klogd24.dif
Patch7: sysklogd-1.4.1-large.patch
Patch8: sysklogd-1.4.1-dns.patch
Patch9: sysklogd-1.4.1-reopen.patch
Patch10: sysklogd-1.4.1-no_SO_BSDCOMPAT.diff
Patch11: sysklogd-1.4.1-owl-crunch_list.diff
Patch12: sysklogd-1.4.1-ksyslogsize.diff
Patch13: sysklogd-1.4.1-unix_sockets.patch
Patch14: sysklogd-1.4.1-showpri.patch
Patch15: sysklogd-1.4.1-preserve_percents.patch
Patch16: sysklogd-1.4.1-utf8.patch
Patch17: sysklogd-1.4.1-ksym.patch
Patch18: sysklogd-1.4.1-dontsleep.patch
Patch19: sysklogd-1.4.1-signal.dif
Patch20: sysklogd-1.4.1-clearing.patch
Patch21: sysklogd-1.4.1-nofortify.patch
Patch22: sysklogd-1.4.1-sysmap-prior-to-2.5.patch
Patch23: sysklogd-1.4.1-reload.dif
Patch24: sysklogd-1.4.1-systemd.dif
Patch25: sysklogd-1.4.1-systemd-multi.dif
Patch26: sysklogd-1.4.1-systemd-sock-name.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{expand: %%global sysdsysunitdir %(pkg-config systemd --variable=systemdsystemunitdir)}
%{expand: %%global sysdsysconfdir %(pkg-config systemd --variable=systemdsystemconfdir)}
%description
The syslogd daemon is the general system logging daemon, which is
responsible for handling requests for syslog services.
This version of syslogd is similar to the standard Berkeley product,
but with a number of compatible extensions.
Authors:
--------
Dr. Greg Wettstein <greg@wind.rmcc.com>
Stephen Tweedie <sct@dcs.ed.ac.uk>
Juha Virtanen <jiivee@hut.fi>
Shane Alderton <shane@scs.apana.org.au>
%package -n klogd
Provides: klogd:/sbin/klogd
Requires(post): %fillup_prereq
Requires(post): %insserv_prereq
Requires(postun): %insserv_prereq
Summary: The kernel log daemon
Group: System/Daemons
%description -n klogd
The klogd daemon 'listens' to kernel log messages, prioritizes them,
and routes them to either output files or to syslog daemon.
This version of klogd will optionally translate kernel addresses to
their symbolic equivalents if provided with a system map.
Authors:
--------
Dr. Greg Wettstein <greg@wind.rmcc.com>
Stephen Tweedie <sct@dcs.ed.ac.uk>
Juha Virtanen <jiivee@hut.fi>
Shane Alderton <shane@scs.apana.org.au>
%package -n syslog-service
Requires(post): %fillup_prereq
Requires(post): %insserv_prereq
Requires(postun): %insserv_prereq
Provides: klogd:/etc/init.d/syslog
Requires: /etc/init.d/network
Requires: logrotate
Summary: Syslog service files & scripts
Group: System/Daemons
BuildArch: noarch
%description -n syslog-service
The package syslog-service provides the service boot
scripts for SysV and the service unit files for systemd.
Authors:
--------
Marius Tomaschewski
Werner Fink
%prep
%setup -n sysklogd-1.4.1
%patch1 -p0 -b .dgram
%patch2 -p0 -b .sparc
%patch3 -p0 -b .forw
%patch4 -p0 -b .fileleak
%patch5 -p0 -b .ipv6
%patch6 -p0 -b .klogd24
%patch7 -p0 -b .large
%patch8 -p0 -b .dns
%patch9 -p0 -b .reopen
%patch10 -p0 -b .sobsd
%patch11 -p0 -b .owlcr
%patch12 -p0 -b .klsize
%patch13 -p0 -b .usock
%patch14 -p0 -b .shprio
%patch15 -p0 -b .presperc
%patch16 -p0 -b .utf8
%patch17 -p0 -b .ksym
%patch18 -p0 -b .sleep
%patch19 -p0 -b .signal
%patch20 -p0 -b .clear
%patch21 -p0 -b .nofortify
%patch22 -p0 -b .sysmap
%patch23 -p0 -b .reload
%patch24 -p0 -b .sd
%patch25 -p0 -b .sd2
%patch26 -p0 -b .sd3
%patch0 -p0
%build
%ifarch s390 s390x
mv sample-s390.conf sample.conf
%endif
# honor the increased LOG_BUF_LEN in kernel/printk.c
make %{?_smp_mflags} LOG_BUFFER_SIZE=-DLOG_BUFFER_SIZE=131072
%install
mkdir -p $RPM_BUILD_ROOT/{sbin,etc}
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man{5,8}
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
mkdir -p $RPM_BUILD_ROOT%{sysdsysunitdir}-generators
mkdir -p $RPM_BUILD_ROOT%{sysdsysunitdir}
mkdir -p -m 0755 $RPM_BUILD_ROOT/var/run/rsyslog
mkdir -p -m 0755 $RPM_BUILD_ROOT/var/run/syslog-ng
make install MANDIR=%{_mandir} DESTDIR=$RPM_BUILD_ROOT
ln -sf ../etc/init.d/syslog $RPM_BUILD_ROOT/sbin/rcsyslog
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/syslog
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 754 %{SOURCE5} $RPM_BUILD_ROOT/etc/init.d/syslog
install -m 754 %{SOURCE6} $RPM_BUILD_ROOT/etc/init.d/earlysyslog
install -d $RPM_BUILD_ROOT/%{omc_svcdir}/
install -m 600 %{SOURCE7} $RPM_BUILD_ROOT/%{omc_svcdir}/
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT/%{_mandir}/man8/syslog.8
install -m 755 %{SOURCE9} $RPM_BUILD_ROOT%{sysdsysunitdir}-generators/
install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{sysdsysunitdir}/
install -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{sysdsysunitdir}/
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{sysdsysunitdir}/
ln -sf /dev/null $RPM_BUILD_ROOT%{sysdsysunitdir}/earlysyslog.service
%ifarch s390 s390x
sed 's/^KERNEL_LOGLEVEL=1/KERNEL_LOGLEVEL=7/' %{SOURCE2} \
> $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.syslog
%endif
%if %{defined verify_permissions}
%verifyscript
%verify_permissions -e /etc/syslog.conf
%endif
%post
%set_permissions /etc/syslog.conf
#
# add syslog variables provided by syslogd if needed
#
%{fillup_only -ns syslog syslog}
#
# check if daemon configured in SYSLOG_DAEMON is
# installed and switch to ourself if it's missed
#
source etc/sysconfig/syslog
replace_syslog=no
if test "$SYSLOG_DAEMON" != "syslogd" ; then
if test -z "$SYSLOG_DAEMON" || \
test ! -x sbin/${SYSLOG_DAEMON} ; then
replace_syslog=yes
fi
fi
if test "$replace_syslog" == "yes" ; then
sed -i -e 's/^SYSLOG_DAEMON=.*/SYSLOG_DAEMON="syslogd"/g' \
etc/sysconfig/syslog
fi
#
# create dirs, touch log default files
#
mkdir -p var/log
touch var/log/messages; chmod 640 var/log/messages
touch var/log/mail; chmod 640 var/log/mail
touch var/log/mail.info; chmod 640 var/log/mail.info
touch var/log/mail.warn; chmod 640 var/log/mail.warn
touch var/log/mail.err; chmod 640 var/log/mail.err
test -f var/log/news && mv var/log/news var/log/news.bak
mkdir -p -m 0750 var/log/news
chown news:news var/log/news
touch var/log/news/news.crit; chmod 640 var/log/news/news.crit
chown news:news var/log/news/news.crit
touch var/log/news/news.err; chmod 640 var/log/news/news.err
chown news:news var/log/news/news.err
touch var/log/news/news.notice; chmod 640 var/log/news/news.notice
chown news:news var/log/news/news.notice
%postun
if test -x /etc/init.d/syslog ; then
%restart_on_update syslog
fi
%{insserv_cleanup}
# reset SYSLOG_DAEMON variable
if test -f etc/sysconfig/syslog ; then
source etc/sysconfig/syslog
if test "$SYSLOG_DAEMON" == "syslogd" ; then
sed -i -e 's/^SYSLOG_DAEMON=.*/SYSLOG_DAEMON=""/g' \
etc/sysconfig/syslog
fi
fi
%post -n syslog-service
#
# add syslog variables provided by klogd if needed
#
%{fillup_and_insserv -ny syslog syslog}
%{fillup_and_insserv -nY syslog earlysyslog}
mkdir -p -m 0755 var/run/rsyslog
mkdir -p -m 0755 var/run/syslog-ng
%preun -n syslog-service
if test -x /etc/init.d/syslog ; then
%stop_on_removal syslog
fi
%postun -n syslog-service
if test -x /etc/init.d/syslog ; then
%restart_on_update syslog
fi
%{insserv_cleanup}
%post -n klogd
#
# add syslog variables provided by klogd if needed
#
%{fillup_only -ns syslog klogd}
if test -x /etc/init.d/syslog ; then
%restart_on_update syslog
fi
%preun -n klogd
if test -x /etc/init.d/syslog ; then
%restart_on_update syslog
fi
%postun -n klogd
if test -x /etc/init.d/syslog ; then
%restart_on_update syslog
fi
%{insserv_cleanup}
%files
%defattr(-,root,root)
/var/adm/fillup-templates/sysconfig.syslogd
%config %verify(not mode) /etc/syslog.conf
%doc %{_mandir}/man5/syslog.conf.5.gz
%doc %{_mandir}/man8/syslogd.8.gz
%doc %{_mandir}/man8/sysklogd.8.gz
/sbin/syslogd
%files -n klogd
%defattr(-,root,root)
/var/adm/fillup-templates/sysconfig.klogd
%config %{sysdsysunitdir}/klogd.service
%doc %{_mandir}/man8/klogd.8.gz
/sbin/klogd
%files -n syslog-service
%defattr(-,root,root)
/var/adm/fillup-templates/sysconfig.syslog
%config(noreplace) /etc/logrotate.d/syslog
%config /etc/init.d/syslog
%config /etc/init.d/earlysyslog
%config %{sysdsysunitdir}/earlysyslog.service
%config %{sysdsysunitdir}/syslog.service
%config %{sysdsysunitdir}/klog.service
%doc %{_mandir}/man8/syslog.8.gz
/sbin/rcsyslog
%attr(0744,root,root) %{sysdsysunitdir}-generators/syslog-service-generator
%attr(0755,root,root) %dir %ghost /var/run/rsyslog
%attr(0755,root,root) %dir %ghost /var/run/syslog-ng
%{omc_svcdir}/syslog.xml
%changelog