rsyslog/rsyslog.spec
Marius Tomaschewski 2b04459014 - update to 5.6.1
This release addresses a TLS bug, that has been bothering a lot
  of users lately. It stops rsyslog from looping, thus disabling
  functionality and bearing the risk of unresponsiveness of the
  whole system. Other issues have been fixed for imptcp, failing
  testbench, segfault on empty templates and failed compile.
  For more detailed information, please review the ChangeLog and
    http://bugzilla.adiscon.com/show_bug.cgi?id=194,
    http://bugzilla.adiscon.com/show_bug.cgi?id=204,
    http://bugzilla.adiscon.com/show_bug.cgi?id=206.
- applied systemd integration base patch (without the service and
  socket unit files, because we'll use same for all syslog damons)
  extracted from git master (bnc#656104).

OBS-URL: https://build.opensuse.org/package/show/Base:System/rsyslog?expand=0&rev=29
2010-11-29 11:47:56 +00:00

482 lines
14 KiB
RPMSpec

#
# spec file for package rsyslog (Version 5.6.1)
#
# Copyright (c) 2010 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/
#
# norootforbuild
Name: rsyslog
Summary: The enhanced syslogd for Linux and Unix
Version: 5.6.1
%define upstream_version 5.6.1
Release: 1
# add %define build_with_relp 1 to enable relp on < 11.3, e.g.
# via <topadd>%define build_with_relp 1</topadd> in _link file.
%define with_relp 0%{?suse_version} >= 1130 || 0%{?build_with_relp:1}
%define _sbindir /sbin
%define rsyslogdocdir %{_docdir}/%{name}
%define additional_sockets %{_localstatedir}/run/rsyslog/additional-log-sockets.conf
%define _libdir /%_lib
%define rsyslog_module_dir_nodeps %{_libdir}/rsyslog/
%define rsyslog_module_dir_withdeps %{_prefix}/%{_lib}/rsyslog/
License: GPLv3+
Group: System/Daemons
Url: http://www.rsyslog.com/
AutoReqProv: on
Provides: syslog
PreReq: %insserv_prereq %fillup_prereq /sbin/klogd /etc/init.d/syslog /sbin/checkproc
BuildRequires: klogd
BuildRequires: dos2unix openssl-devel pcre-devel pkgconfig zlib-devel
BuildRequires: krb5-devel mysql-devel net-snmp-devel postgresql-devel
BuildRequires: libgnutls-devel
%if %{?with_relp}
# RELP support
BuildRequires: librelp-devel
%endif
# UDP spoof support
%if 0%{?suse_version} > 1130
BuildRequires: libnet-devel
%else
BuildRequires: libnet
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#Source0: http://download.rsyslog.com/rsyslog/%{name}-%{upstream_version}.tar.gz
Source0: %{name}-%{upstream_version}.tar.bz2
Source1: rsyslog.sysconfig
Source2: rsyslog.conf.in
Source3: rsyslog.early.conf.in
Source4: rsyslog.d.remote.conf.in
Patch1: rsyslog-systemd-integration.bnc656104.diff
%description
Rsyslog is an enhanced multi-threaded syslogd supporting, among others,
MySQL, syslog/tcp, RFC 3195, permitted sender lists, filtering on any
message part, and fine grain output format control. It is quite
compatible to stock sysklogd and can be used as a drop-in replacement.
Its advanced features make it suitable for enterprise-class, encryption
protected syslog relay chains while at the same time being very easy to
setup for the novice user.
%package doc
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: Additional documentation for rsyslog
%description doc
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This package provides additional documentation for rsyslog.
%package diag-tools
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: Diagnostic tools
%description diag-tools
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This package provides additional diagnostic tools (small helpers,
usually not needed).
%package module-gssapi
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: GSS-API support module for rsyslog
%description module-gssapi
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This module provides the support to receive syslog messages from the
network protected via Kerberos 5 encryption and authentication.
%package module-mysql
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: MySQL support module for rsyslog
%description module-mysql
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This package provides a module with the support for logging into MySQL
databases.
%package module-pgsql
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: PostgreSQL support module for rsyslog
%description module-pgsql
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This module provides the support for logging into PostgreSQL databases.
%package module-snmp
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: SNMP support module for rsyslog
%description module-snmp
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This module provides the ability to send syslog messages as an SNMPv1 &
v2c traps.
%package module-gtls
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: TLS encryption support module for rsyslog
%description module-gtls
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This module provides the ability for TLS encrypted TCP logging (based
on current syslog-transport-tls internet drafts).
%if %{?with_relp}
%package module-relp
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: RELP protocol support module for syslog
%description module-relp
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This module provides Reliable Event Logging Protocol support.
%endif
%package module-udpspoof
License: GPLv3+
Group: System/Daemons
Requires: %{name} = %{version}
Summary: UDP spoof support module for syslog
%description module-udpspoof
Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
package.
This module provides a UDP forwarder that allows changing the sender address.
%prep
%setup -q -n %{name}-%{upstream_version}
%patch1 -p1
dos2unix doc/*.html
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -W -Wall"
%if 0%{?suse_version} > 1000 && 0%{?suse_version} < 1030
export CFLAGS="$CFLAGS -fstack-protector"
%endif
# needs liblogging
# --enable-rfc3195 \
# needs java
# --enable-gui \
%configure \
--with-moddirs=%{rsyslog_module_dir_withdeps} \
--enable-option-checking \
--enable-largefile \
--enable-pthreads \
--enable-regexp \
--enable-zlib \
--enable-klog \
--enable-inet \
--enable-gnutls \
--enable-rsyslogd \
--enable-gssapi-krb5 \
--enable-mysql \
--enable-pgsql \
--enable-snmp \
--enable-mail \
--enable-imfile \
--enable-imtemplate \
--enable-omprog \
--enable-omtemplate \
--enable-diagtools \
%if %{?with_relp}
--enable-relp \
%endif
--enable-omudpspoof \
--enable-omstdout \
--disable-static
make %{?_smp_mflags:%{_smp_mflags}} V=1
%install
make install DESTDIR="%{buildroot}" V=1
#
rm -f %{buildroot}%{rsyslog_module_dir_nodeps}/*.la
#
# move all modules linking libraries in /usr to /usr/%_lib
# the user has to specify them with full path then...
install -d -m0755 %{buildroot}%{rsyslog_module_dir_withdeps}
for mod in omgssapi.so imgssapi.so lmgssutil.so ommysql.so \
ompgsql.so omsnmp.so lmnsd_gtls.so \
%if %{?with_relp}
imrelp.so omrelp.so \
%endif
; do
mv -f %{buildroot}%{rsyslog_module_dir_nodeps}/$mod \
%{buildroot}%{rsyslog_module_dir_withdeps}
done
#
install -d -m0755 %{buildroot}%{_sysconfdir}/rsyslog.d
install -d -m0755 %{buildroot}%{_localstatedir}/run/rsyslog
install -d -m0755 %{buildroot}%{_localstatedir}/spool/rsyslog
for file in rsyslog.conf rsyslog.early.conf rsyslog.d.remote.conf ; do
sed \
%ifarch s390 s390x
-e 's;tty10;console;g' \
%endif
-e 's;ADDITIONAL_SOCKETS;%{additional_sockets};g' \
-e 's;ETC_RSYSLOG_D_DIR;%{_sysconfdir}/rsyslog.d;g' \
-e 's;ETC_RSYSLOG_D_GLOB;%{_sysconfdir}/rsyslog.d/*.conf;g' \
-e 's;RSYSLOG_SPOOL_DIR;%{_localstatedir}/spool/rsyslog;g' \
%{_sourcedir}/${file}.in > ${file}.$$
done
install -m0600 rsyslog.conf.$$ \
%{buildroot}%{_sysconfdir}/rsyslog.conf
install -m0600 rsyslog.early.conf.$$ \
%{buildroot}%{_sysconfdir}/rsyslog.early.conf
install -m0600 rsyslog.d.remote.conf.$$ \
%{buildroot}%{_sysconfdir}/rsyslog.d/remote.conf
#
install -d -m0755 %{buildroot}/var/adm/fillup-templates
# native version for the '-c <compat version>' parameter
rsyslogd_version=%{version}
rsyslogd_version=${rsyslogd_version//.*/}
sed -e "s/@RSYSLOGD_VERSION@/${rsyslogd_version}/g" \
< %{_sourcedir}/rsyslog.sysconfig > rsyslog.sysconfig
install -m0600 rsyslog.sysconfig \
%{buildroot}/var/adm/fillup-templates/sysconfig.syslog-rsyslog
#
rm -f doc/Makefile*
install -d -m0755 %{buildroot}%{rsyslogdocdir}/
find ChangeLog README AUTHORS COPYING COPYING.LESSER rsyslog.conf doc \
\( -type d -exec install -m755 -d %{buildroot}%{rsyslogdocdir}/\{\} \; \) \
-o \( -type f -exec install -m644 \{\} %{buildroot}%{rsyslogdocdir}/\{\} \; \)
install -m644 plugins/ommysql/createDB.sql \
%{buildroot}%{rsyslogdocdir}/mysql-createDB.sql
install -m644 plugins/ompgsql/createDB.sql \
%{buildroot}%{rsyslogdocdir}/pgsql-createDB.sql
#
%clean
if [ -n "%{buildroot}" ] && [ "%{buildroot}" != "/" ] ; then
rm -rf "%{buildroot}"
fi
%post
#
# update linker caches
#
/sbin/ldconfig
#
# add syslog variables provided by klogd if needed
#
%{remove_and_set -n syslog RSYSLOGD_NATIVE_VERSION}
%{fillup_and_insserv -ny syslog syslog}
%{fillup_and_insserv -nY syslog earlysyslog}
#
# add RSYSLOGD_* variables if needed
#
%{fillup_only -ns syslog rsyslog}
#
# 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" != "rsyslogd" ; 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="rsyslogd"/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/boot.log; chmod 640 var/log/boot.log
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 -f 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
#
# touch the additional log files we are using
#
touch var/log/acpid; chmod 640 var/log/acpid
touch var/log/firewall; chmod 640 var/log/firewall
touch var/log/NetworkManager; chmod 640 var/log/NetworkManager
#
# touch the additional log sockets config file
#
additional_sockets="%{additional_sockets}"
mkdir -p -m750 ${additional_sockets%/*}
touch "${additional_sockets#/}"
chmod 640 "${additional_sockets#/}"
%preun
#
# stop the rsyslogd daemon when it is running
#
%{stop_on_removal syslog}
%postun
#
# update linker caches
#
/sbin/ldconfig
#
# reset SYSLOG_DAEMON variable
#
if test -f etc/sysconfig/syslog ; then
source etc/sysconfig/syslog
if test "$SYSLOG_DAEMON" == "rsyslogd" ; then
sed -i -e 's/^SYSLOG_DAEMON=.*/SYSLOG_DAEMON=""/g' \
etc/sysconfig/syslog
fi
fi
#
# stop the rsyslogd daemon when it is running
#
%{restart_on_update syslog}
#
# cleanup init scripts
#
%{insserv_cleanup}
%files
%defattr(-,root,root)
%dir %{_sysconfdir}/rsyslog.d
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/rsyslog.conf
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/rsyslog.early.conf
%config(noreplace) %attr(600,root,root) %{_sysconfdir}/rsyslog.d/remote.conf
%{_sbindir}/rsyslogd
%dir %{rsyslog_module_dir_nodeps}
%{rsyslog_module_dir_nodeps}/imfile.so
%{rsyslog_module_dir_nodeps}/imklog.so
%{rsyslog_module_dir_nodeps}/immark.so
%{rsyslog_module_dir_nodeps}/imtcp.so
%{rsyslog_module_dir_nodeps}/imtemplate.so
%{rsyslog_module_dir_nodeps}/imudp.so
%{rsyslog_module_dir_nodeps}/imuxsock.so
%{rsyslog_module_dir_nodeps}/lmnet.so
%{rsyslog_module_dir_nodeps}/lmnetstrms.so
%{rsyslog_module_dir_nodeps}/lmnsd_ptcp.so
%{rsyslog_module_dir_nodeps}/lmregexp.so
%{rsyslog_module_dir_nodeps}/lmstrmsrv.so
%{rsyslog_module_dir_nodeps}/lmtcpclt.so
%{rsyslog_module_dir_nodeps}/lmtcpsrv.so
%{rsyslog_module_dir_nodeps}/lmzlibw.so
%{rsyslog_module_dir_nodeps}/ommail.so
%{rsyslog_module_dir_nodeps}/omprog.so
%{rsyslog_module_dir_nodeps}/omruleset.so
%{rsyslog_module_dir_nodeps}/omtemplate.so
%{rsyslog_module_dir_nodeps}/omtesting.so
%{rsyslog_module_dir_nodeps}/omstdout.so
%dir %{rsyslog_module_dir_withdeps}
%{_mandir}/man5/rsyslog.conf.5*
%{_mandir}/man8/rsyslogd.8*
%dir %{rsyslogdocdir}
%doc %{rsyslogdocdir}/rsyslog.conf
%doc %{rsyslogdocdir}/ChangeLog
%doc %{rsyslogdocdir}/README
%doc %{rsyslogdocdir}/AUTHORS
%doc %{rsyslogdocdir}/COPYING
%doc %{rsyslogdocdir}/COPYING.LESSER
%dir %{_localstatedir}/spool/rsyslog
/var/adm/fillup-templates/sysconfig.syslog-rsyslog
%files doc
%defattr(-,root,root)
%dir %{rsyslogdocdir}
%doc %{rsyslogdocdir}/doc
%files diag-tools
%defattr(-,root,root)
%{_sbindir}/msggen
%{_sbindir}/rsyslog_diag_hostname
%{_sbindir}/zpipe
%files module-gssapi
%defattr(-,root,root)
%{rsyslog_module_dir_withdeps}/omgssapi.so
%{rsyslog_module_dir_withdeps}/imgssapi.so
%{rsyslog_module_dir_withdeps}/lmgssutil.so
%files module-mysql
%defattr(-,root,root)
%doc %{rsyslogdocdir}/mysql-createDB.sql
%{rsyslog_module_dir_withdeps}/ommysql.so
%files module-pgsql
%defattr(-,root,root)
%doc %{rsyslogdocdir}/pgsql-createDB.sql
%{rsyslog_module_dir_withdeps}/ompgsql.so
%files module-snmp
%defattr(-,root,root)
%{rsyslog_module_dir_withdeps}/omsnmp.so
%files module-gtls
%defattr(-,root,root)
%{rsyslog_module_dir_withdeps}/lmnsd_gtls.so
%if %{?with_relp}
%files module-relp
%defattr(-,root,root)
%{rsyslog_module_dir_withdeps}/imrelp.so
%{rsyslog_module_dir_withdeps}/omrelp.so
%endif
%files module-udpspoof
%defattr(-,root,root)
%{rsyslog_module_dir_nodeps}/omudpspoof.so
%changelog