diff --git a/.cvsignore b/.cvsignore index e69de29..4da26ec 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1,2 @@ +rsyslog-1.17.0.tar.gz +rsyslog.init diff --git a/rsyslog-1.17.0-cleanup.patch b/rsyslog-1.17.0-cleanup.patch new file mode 100644 index 0000000..031f3c9 --- /dev/null +++ b/rsyslog-1.17.0-cleanup.patch @@ -0,0 +1,96 @@ +--- rsyslog-1.17.0/srUtils.c.cleanup 2007-07-17 17:02:23.000000000 +0400 ++++ rsyslog-1.17.0/srUtils.c 2007-07-18 11:46:45.000000000 +0400 +@@ -153,6 +153,7 @@ int makeFileParentDirs(uchar *szFile, si + *p = '/'; + } + free(pszWork); ++ return 0; + } + /* + * vi:set ai: +--- rsyslog-1.17.0/Makefile.am.cleanup 2007-07-18 11:46:59.000000000 +0400 ++++ rsyslog-1.17.0/Makefile.am 2007-07-18 11:47:28.000000000 +0400 +@@ -1,14 +1,14 @@ + +-sbin_PROGRAMS=klogd rfc3195d syslogd ++sbin_PROGRAMS=rklogd rfc3195d rsyslogd + +-klogd_SOURCES=klogd.c syslog.c pidfile.c ksym.c ksym_mod.c klogd.h ksyms.h pidfile.h module.h ++rklogd_SOURCES=klogd.c syslog.c pidfile.c ksym.c ksym_mod.c klogd.h ksyms.h pidfile.h module.h + + rfc3195d_SOURCES=rfc3195d.c rsyslog.h + + man_MANS = rfc3195d.8 rklogd.8 rsyslogd.8 rsyslog.conf.5 + +-syslogd_SOURCES=syslogd.c pidfile.c template.c outchannel.c stringbuf.c srUtils.c parse.c syslogd-types.h template.h outchannel.h syslogd.h stringbuf.h parse.h srUtils.h liblogging-stub.h net.h +-syslogd_CPPFLAGS=$(mysql_includes) +-syslogd_LDADD=$(mysql_libs) $(zlib_libs) $(pthreads_libs) ++rsyslogd_SOURCES=syslogd.c pidfile.c template.c outchannel.c stringbuf.c srUtils.c parse.c syslogd-types.h template.h outchannel.h syslogd.h stringbuf.h parse.h srUtils.h liblogging-stub.h net.h ++rsyslogd_CPPFLAGS=$(mysql_includes) ++rsyslogd_LDADD=$(mysql_libs) $(zlib_libs) $(pthreads_libs) + + EXTRA_DIST = doc/bugs.html doc/features.html doc/generic_design.html doc/history.html doc/how2help.html doc/install.html doc/ipv6.html doc/manual.html doc/property_replacer.html doc/rsyslog_conf.html doc/rsyslog_mysql.html doc/rsyslog_packages.html doc/rsyslog_php_syslog_ng.html doc/rsyslog_recording_pri.html doc/rsyslog_stunnel.html doc/status.html doc/syslog-protocol.html doc/version_naming.html doc/contributors.html redhat/rsyslog.conf redhat/rsyslog.init redhat/rsyslog.log redhat/rsyslog.sysconfig debian/rsyslogd freebsd/rsyslogd slackware/rc.rsyslogd rfc3195d.8 rklogd.8 rsyslogd.8 rsyslog.conf.5 +--- rsyslog-1.17.0/syslogd.c.cleanup 2007-07-17 18:05:52.000000000 +0400 ++++ rsyslog-1.17.0/syslogd.c 2007-07-18 11:46:45.000000000 +0400 +@@ -888,7 +888,7 @@ static rsRetVal AddAllowedSenderEntry(st + static rsRetVal AddAllowedSender(struct AllowedSenders **ppRoot, struct AllowedSenders **ppLast, + struct NetAddr *iAllow, uint8_t iSignificantBits) + { +- rsRetVal iRet; ++ rsRetVal iRet = RS_RET_OK; + + assert(ppRoot != NULL); + assert(ppLast != NULL); +@@ -1571,7 +1571,7 @@ static void TCPSessAccept(int fd) + int iSess; + struct sockaddr_storage addr; + socklen_t addrlen = sizeof(struct sockaddr_storage); +- int lenHostName; ++ size_t lenHostName; + uchar fromHost[NI_MAXHOST]; + uchar fromHostFQDN[NI_MAXHOST]; + char *pBuf; +@@ -7452,7 +7452,6 @@ static int doParseOnOffOption(uchar **pp + { + char *pOptStart; + uchar szOpt[32]; +- int iRet = -1; + + assert(pp != NULL); + assert(*pp != NULL); +@@ -7462,7 +7461,7 @@ static int doParseOnOffOption(uchar **pp + + if(getSubString(pp, (char*) szOpt, sizeof(szOpt) / sizeof(uchar), ' ') != 0) { + logerror("Invalid $-configline - could not extract on/off option"); +- return; ++ return -1; + } + + if(!strcmp(szOpt, "on")) { +@@ -8921,12 +8920,11 @@ static rsRetVal cfline(char *line, regis + + f->f_un.f_forw.port = NULL; + if(*p == ':') { /* process port */ +- register int i = 0; + uchar * tmp; + + *p = '\0'; /* trick to obtain hostname (later)! */ + tmp = ++p; +- for( ; *p && isdigit((int) *p) ; ++p, ++i) ++ for(i=0 ; *p && isdigit((int) *p) ; ++p, ++i) + /* SKIP AND COUNT */; + f->f_un.f_forw.port = malloc(i + 1); + if(f->f_un.f_forw.port == NULL) { +--- rsyslog-1.17.0/configure.ac.cleanup 2007-07-17 18:39:59.000000000 +0400 ++++ rsyslog-1.17.0/configure.ac 2007-07-18 11:46:45.000000000 +0400 +@@ -10,7 +10,9 @@ AC_CONFIG_HEADER([config.h]) + # Checks for programs. + AC_PROG_CC + AM_PROG_CC_C_O +- ++if test "$GCC" = "yes" ++then CFLAGS="$CFLAGS -W -Wall -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g" ++fi + AC_CANONICAL_HOST + + case "${host}" in diff --git a/rsyslog.spec b/rsyslog.spec new file mode 100644 index 0000000..1cc8fe6 --- /dev/null +++ b/rsyslog.spec @@ -0,0 +1,148 @@ +%define with_db 0 +%define sbindir /sbin + +Summary: Enhanced system logging and kernel message trapping daemons +Name: rsyslog +Version: 1.17.0 +Release: 1%{?dist} +License: GPL +Group: System Environment/Daemons +URL: http://www.rsyslog.com/ +Source0: http://download.adiscon.com/rsyslog/%{name}-%{version}.tar.gz +Source1: rsyslog.init +Patch1: rsyslog-1.17.0-cleanup.patch +Conflicts: logrotate < 3.5.2 +%if %{with_db} +BuildRequires: mysql-devel >= 4.0 +%endif +BuildRequires: zlib-devel +BuildRequires: autoconf, automake +Requires: logrotate +Requires: bash >= 2.0 +Requires(post): /sbin/chkconfig coreutils +Requires(preun): /sbin/chkconfig /sbin/chkconfig +Requires(postun): /sbin/service +Provides: syslog +Obsoletes: sysklogd +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%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. + + +%prep +%setup -q +%patch1 -p1 -b .cleanup + +autoreconf + +%build +%configure --sbindir=%{sbindir} +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +make install DESTDIR=$RPM_BUILD_ROOT + +install -d -m 755 $RPM_BUILD_ROOT%{_initrddir} +install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d +install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/rsyslog +install -p -m 644 redhat/rsyslog.conf $RPM_BUILD_ROOT%{_sysconfdir}/rsyslog.conf +install -p -m 644 redhat/rsyslog.log $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/rsyslog +install -p -m 644 redhat/rsyslog.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/rsyslog + +%clean +rm -rf $RPM_BUILD_ROOT + +%pretrans +#use sysklogd configuration file +[ -f /etc/syslog.conf ] && cp -a /etc/syslog.conf /etc/rsyslog.conf >/dev/null 2>&1 ||: +[ -f /etc/sysconfig/syslog ] && cp -a /etc/sysconfig/syslog /etc/sysconfig/rsyslog >/dev/null 2>&1 ||: + +%post +if [ $1 = 1 ]; then + /sbin/chkconfig --add rsyslog +fi +for n in /var/log/{messages,secure,maillog,spooler} +do + [ -f $n ] && continue + umask 066 && touch $n +done + +%preun +if [ $1 = 0 ]; then + service rsyslog stop >/dev/null 2>&1 ||: + /sbin/chkconfig --del rsyslog +fi + +%postun +if [ "$1" -ge "1" ]; then + service rsyslog condrestart > /dev/null 2>&1 ||: +fi + +%files +%defattr(-,root,root,-) +%doc AUTHORS COPYING INSTALL NEWS README +%config(noreplace) %{_sysconfdir}/rsyslog.conf +%config(noreplace) %{_sysconfdir}/sysconfig/rsyslog +%config(noreplace) %{_sysconfdir}/logrotate.d/rsyslog +%{_initrddir}/rsyslog +%{sbindir}/rsyslogd +%{sbindir}/rklogd +%{sbindir}/rfc3195d +%{_mandir}/*/* + +%changelog +* Thu Jul 17 2007 Peter Vrabec 1.17.0-1 +- feature rich upstream release + +* Thu Jul 12 2007 Peter Vrabec 1.15.1-2 +- use obsoletes and hadle old config files + +* Wed Jul 11 2007 Peter Vrabec 1.15.1-1 +- new upstream bugfix release + +* Tue Jul 10 2007 Peter Vrabec 1.15.0-1 +- new upstream release introduce capability to generate output + file names based on templates + +* Tue Jul 03 2007 Peter Vrabec 1.14.2-1 +- new upstream bugfix release + +* Mon Jul 02 2007 Peter Vrabec 1.14.1-1 +- new upstream release with IPv6 support + +* Tue Jun 26 2007 Peter Vrabec 1.13.5-3 +- add BuildRequires for zlib compression feature + +* Mon Jun 25 2007 Peter Vrabec 1.13.5-2 +- some spec file adjustments. +- fix syslog init script error codes (#245330) + +* Fri Jun 22 2007 Peter Vrabec 1.13.5-1 +- new upstream release + +* Fri Jun 22 2007 Peter Vrabec 1.13.4-2 +- some spec file adjustments. + +* Mon Jun 18 2007 Peter Vrabec 1.13.4-1 +- upgrade to new upstream release + +* Wed Jun 13 2007 Peter Vrabec 1.13.2-2 +- DB support off + +* Tue Jun 12 2007 Peter Vrabec 1.13.2-1 +- new upstream release based on redhat patch + +* Fri Jun 08 2007 Peter Vrabec 1.13.1-2 +- rsyslog package provides its own kernel log. daemon (rklogd) + +* Mon Jun 04 2007 Peter Vrabec 1.13.1-1 +- Initial rpm build diff --git a/sources b/sources index e69de29..2140cbd 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +bf138b47f6474d3c2d2320945ba9ac28 rsyslog-1.17.0.tar.gz +26932048c2b297a1fb7bbb6d0a1edb41 rsyslog.init