Control: tags -1 patch Hi!
On Sun, 2012-11-11 at 21:01:16 +0100, Michael Biebl wrote: > Package: src:rsyslog > Version: 7.2.1-1 > Severity: serious > User: debian-...@lists.debian.org > Usertags: kfreebsd > the current version of rsyslog from experimental (7.2.1) FTBFS on > kfreebsd-*. > It would be great if the kfreebsd porters would have a look and provide > a patch. Attached a patch fixing the issues in the code, only build tested on GNU/kFreeBSD though (w/ the db code disabled). The imptcp module seems like has never been available in anything non-Linux, so I've restricted its build in the rules file; the ideal solution here would be to port it to use kqueue which would make it work on most BSDs (that's why I've not bothered with a configure check for epoll). The <sys/klog.h> conditional inclusion should be dependant on the presence of the file, but because I saw another module checking based on OS_LINUX, I just used that instead. The ideal fix for the uptime code would be to use clock_gettime(CLOCK_UPTIME) on FreeBSD and GNU/kFreeBSD, and sysctl kern.boottime on OpenBSD, NetBSD and DragonFlyBSD. In any case when trying to build rsyslog on GNU/kFreeBSD, it failed to build the libgrammar convenience library, because it seems the local libtool script ends up getting truncated during generation. I've not investigated why that is, but an «autoreconf -f -i» solved the issue. And something that looked suspicious is that the previous libtool support was coming from an Ubuntu version, so maybe that's broken and is the reason. thanks, guillem
diff --git a/configure.ac b/configure.ac index 331c77b..2930fa1 100644 --- a/configure.ac +++ b/configure.ac @@ -115,7 +115,7 @@ AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_STRERROR_R AC_FUNC_VPRINTF -AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync lseek64]) +AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul sysinfo uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync lseek64]) # the check below is probably ugly. If someone knows how to do it in a better way, please # let me know! -- rgerhards, 2010-10-06 diff --git a/debian/rsyslog.install b/debian/rsyslog.install index f0233a2..51e0055 100644 --- a/debian/rsyslog.install +++ b/debian/rsyslog.install @@ -6,8 +6,7 @@ usr/lib/rsyslog/imfile.so usr/lib/rsyslog/imklog.so usr/lib/rsyslog/imkmsg.so usr/lib/rsyslog/immark.so -usr/lib/rsyslog/impstats.so -usr/lib/rsyslog/imptcp.so +usr/lib/rsyslog/imp*.so usr/lib/rsyslog/imtcp.so usr/lib/rsyslog/imudp.so usr/lib/rsyslog/imuxsock.so diff --git a/debian/rules b/debian/rules index 5324d77..16b1951 100755 --- a/debian/rules +++ b/debian/rules @@ -3,17 +3,23 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) + %: dh $@ --with autotools_dev +ifeq ($(DEB_HOST_ARCH_OS), linux) +confflags += --enable-imptcp +endif + override_dh_auto_configure: dh_auto_configure -- \ + $(confflags) \ --enable-mysql \ --enable-pgsql \ --enable-ommongodb \ --enable-mail \ --enable-imfile \ - --enable-imptcp \ --enable-impstats \ --enable-kmsg \ --enable-klog \ diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c index 9ad98da..b771d68 100644 --- a/plugins/imkmsg/kmsg.c +++ b/plugins/imkmsg/kmsg.c @@ -32,7 +32,9 @@ #include <errno.h> #include <string.h> #include <ctype.h> +#ifdef OS_LINUX #include <sys/klog.h> +#endif #include <json/json.h> #include "rsyslog.h" diff --git a/runtime/msg.c b/runtime/msg.c index d874178..7da1443 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2875,7 +2875,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, *pbMustBeFreed = 0; break; case PROP_SYS_UPTIME: -# ifdef OS_SOLARIS - pRes = (uchar*) "UPTIME NOT available under Solaris"; +# ifndef HAVE_SYSINFO + pRes = (uchar*) "UPTIME NOT available on this system"; *pbMustBeFreed = 0; # else