rsyslog/rsyslog.spec
Marius Tomaschewski 5056b75bc1 - Updated to rsyslog version 4.4.1 (v4-stable), a bug-fixing release,
providing some important fixes for issues that have only been
  detected after the beta phase. Some of them are serious (like a
  segfault when UDP messageforwarding is activated), so users of
  4.4.0 are urged to upgrade to this release. Changelog for 4.4.1:
  * features requiring Java are automatically disabled if Java
    is not present (thanks to Michael Biebl for his help!)
  * bugfix: invalid double-quoted PRI, among others in outgoing
    messages. This causes grief with all receivers.
    Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=147
  * bugfix: Java testing tools were required, even if testbench
    was disabled. This resulted in build errors if no Java was
    present on the build system, even though none of the selected
    option actually required Java. (I forgot to backport a similar
    fix to newer releases).
  * bugfix (backport): omfwd segfault. Note that the orginal (higher
    version) patch states this happens only when debugging mode is
    turned on. That statement is wrong: if debug mode is turned off,
    the message is not being emitted, but the division by zero in
    the actual parameters still happens.
- Removed jave2-devel-packages from build requires again

OBS-URL: https://build.opensuse.org/package/show/Base:System/rsyslog?expand=0&rev=6
2009-09-02 18:30:18 +00:00

472 lines
14 KiB
RPMSpec

#
# spec file for package rsyslog (Version 4.4.1)
#
# Copyright (c) 2009 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
%define upstream_version 4.4.1
%define rsyslog_docdir %{_docdir}/%{name}
%define install_all_modules_in_lib 0
Version: 4.4.1
Release: 1
License: GPL v3 or later
Group: System/Daemons
Summary: Rsyslog, the enhanced syslogd for Linux and Unix
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
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
%define _sbindir /sbin
%define _libdir /%_lib
%define rsyslogdocdir %{_docdir}/%{name}
%define additional_sockets %{_localstatedir}/run/rsyslog/additional-log-sockets.conf
%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.
Authors:
--------
Rainer Gerhards <rgerhards@adiscon.com>, Adiscon GmbH
Michael Meckelein <mmeckelein@hq.adiscon.com>, Adiscon GmbH
%package doc
License: GPL v3 or later
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.
Authors:
--------
Rainer Gerhards <rgerhards@adiscon.com>, Adiscon GmbH
Michael Meckelein <mmeckelein@hq.adiscon.com>, Adiscon GmbH
%package module-gssapi
License: GPL v3 or later
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.
Authors:
--------
Rainer Gerhards <rgerhards@adiscon.com>, Adiscon GmbH
Michael Meckelein <mmeckelein@hq.adiscon.com>, Adiscon GmbH
%package module-mysql
License: GPL v3 or later
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.
Authors:
--------
Rainer Gerhards <rgerhards@adiscon.com>, Adiscon GmbH
Michael Meckelein <mmeckelein@hq.adiscon.com>, Adiscon GmbH
%package module-pgsql
License: GPL v3 or later
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.
Authors:
--------
Rainer Gerhards <rgerhards@adiscon.com>, Adiscon GmbH
Michael Meckelein <mmeckelein@hq.adiscon.com>, Adiscon GmbH
%package module-snmp
License: GPL v3 or later
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.
Authors:
--------
Rainer Gerhards <rgerhards@adiscon.com>, Adiscon GmbH
Michael Meckelein <mmeckelein@hq.adiscon.com>, Adiscon GmbH
%package module-gtls
License: GPL v3 or later
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).
Authors:
--------
Rainer Gerhards <rgerhards@adiscon.com>, Adiscon GmbH
Michael Meckelein <mmeckelein@hq.adiscon.com>, Adiscon GmbH
%prep
%setup -q -n %{name}-%{upstream_version}
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
autoreconf -fi
%configure \
%if ! 0%{install_all_modules_in_lib}
--with-moddirs=%{_prefix}%{_libdir}/rsyslog/ \
%endif
--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 \
--disable-static
make %{?_smp_mflags:%{_smp_mflags}}
%install
make install DESTDIR="%{buildroot}"
#
rm -f %{buildroot}%{_libdir}/rsyslog/*.la
#
%if ! 0%{install_all_modules_in_lib}
# move all modules linking libraries in /usr to /usr/%_lib
# the user has to specify them with full path then...
install -d -m0755 %{buildroot}%{_prefix}%{_libdir}/rsyslog
for mod in omgssapi.so imgssapi.so lmgssutil.so ommysql.so \
ompgsql.so omsnmp.so lmnsd_gtls.so ;
do
mv -f %{buildroot}%{_libdir}/rsyslog/$mod \
%{buildroot}%{_prefix}%{_libdir}/rsyslog/
done
%endif
#
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
install -m0600 %{_sourcedir}/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
#
%{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}"
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 %{_libdir}/rsyslog
%{_libdir}/rsyslog/imfile.so
%{_libdir}/rsyslog/imklog.so
%{_libdir}/rsyslog/immark.so
%{_libdir}/rsyslog/imtcp.so
%{_libdir}/rsyslog/imtemplate.so
%{_libdir}/rsyslog/imudp.so
%{_libdir}/rsyslog/imuxsock.so
%{_libdir}/rsyslog/lmnet.so
%{_libdir}/rsyslog/lmnetstrms.so
%{_libdir}/rsyslog/lmnsd_ptcp.so
%{_libdir}/rsyslog/lmregexp.so
%{_libdir}/rsyslog/lmstrmsrv.so
%{_libdir}/rsyslog/lmtcpclt.so
%{_libdir}/rsyslog/lmtcpsrv.so
%{_libdir}/rsyslog/ommail.so
%{_libdir}/rsyslog/omprog.so
%{_libdir}/rsyslog/omtemplate.so
%{_libdir}/rsyslog/omtesting.so
%if ! 0%{install_all_modules_in_lib}
%dir %{_prefix}%{_libdir}/rsyslog
%endif
%{_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}/run/rsyslog
%dir %{_localstatedir}/spool/rsyslog
/var/adm/fillup-templates/sysconfig.syslog-rsyslog
%files doc
%defattr(-,root,root)
%dir %{rsyslogdocdir}
%doc %{rsyslogdocdir}/doc
%files module-gssapi
%defattr(-,root,root)
%if 0%{install_all_modules_in_lib}
%dir %{_libdir}/rsyslog
%{_libdir}/rsyslog/omgssapi.so
%{_libdir}/rsyslog/imgssapi.so
%{_libdir}/rsyslog/lmgssutil.so
%else
%dir %{_prefix}%{_libdir}/rsyslog
%{_prefix}%{_libdir}/rsyslog/omgssapi.so
%{_prefix}%{_libdir}/rsyslog/imgssapi.so
%{_prefix}%{_libdir}/rsyslog/lmgssutil.so
%endif
%files module-mysql
%defattr(-,root,root)
%doc %{rsyslogdocdir}/mysql-createDB.sql
%if 0%{install_all_modules_in_lib}
%dir %{_libdir}/rsyslog
%{_libdir}/rsyslog/ommysql.so
%else
%dir %{_prefix}%{_libdir}/rsyslog
%{_prefix}%{_libdir}/rsyslog/ommysql.so
%endif
%files module-pgsql
%defattr(-,root,root)
%doc %{rsyslogdocdir}/pgsql-createDB.sql
%if 0%{install_all_modules_in_lib}
%dir %{_libdir}/rsyslog
%{_libdir}/rsyslog/ompgsql.so
%else
%dir %{_prefix}%{_libdir}/rsyslog
%{_prefix}%{_libdir}/rsyslog/ompgsql.so
%endif
%files module-snmp
%defattr(-,root,root)
%if 0%{install_all_modules_in_lib}
%dir %{_libdir}/rsyslog
%{_libdir}/rsyslog/omsnmp.so
%else
%dir %{_prefix}%{_libdir}/rsyslog
%{_prefix}%{_libdir}/rsyslog/omsnmp.so
%endif
%files module-gtls
%defattr(-,root,root)
%if 0%{install_all_modules_in_lib}
%dir %{_libdir}/rsyslog
%{_libdir}/rsyslog/lmnsd_gtls.so
%else
%dir %{_prefix}%{_libdir}/rsyslog
%{_prefix}%{_libdir}/rsyslog/lmnsd_gtls.so
%endif
%changelog