[syslog-ng] Building 3.4.1 RPM

Xuri Nagarin secsubs at gmail.com
Sat Jun 1 10:41:21 CEST 2013


I am trying to build a 3.4.1 RPM for CentOS 6.

I already built the eventlog RPM and upgraded the one provided by EPEL repo.

If I compile straight after untarring the source by running "./configure"
(with options same as listed in the SPEC file below) and "make check", the
tests runs ok and I get the syslog-ng binaries.

But if I build a RPM from the SPEC file below, build fails with the
following error.

------- error ---------------
Input is not valid utf8, glob match requires utf8 input, thus it never
matches in this case;
value='\xe1rv\xedzt\xfbr\xf5t\xfck\xf6rf\xfar\xf3g\xe9p'
PASS: test_matcher
PASS: test_clone_logmsg
PASS: test_serialize
PASS: test_msgparse
PASS: test_template
/bin/sh: line 5: 31254 Segmentation fault      (core dumped) ${dir}$tst
FAIL: test_template_speed
One "invalid regular expression" message is to be expected
Error compiling regular expression; re='((', error='Unmatched ( or \('
One "invalid regular expressions" message is to be expected
Error compiling regular expression; re='((', error='Unmatched ( or \('
WARNING: Your configuration file uses an obsoleted regexp option, please
update your configuration; option='(?i)', change='use ignore-case flag
instead of (?i)'
One "invalid regular expression" message is to be expected
Error compiling regular expression; re='((', error='Unmatched ( or \('
One "invalid regular expression" message is to be expected
Error while compiling regular expression; regular_expression='((',
error_at='', error_offset='2', error_message='missing )', error_code='14'
One "invalid regular expressions" message is to be expected
Error while compiling regular expression; regular_expression='((',
error_at='', error_offset='2', error_message='missing )', error_code='14'
One "invalid regular expressions" message is to be expected
Invalid regexp flags; re='(?iana'
One "invalid regular expressions" message is to be expected
Error while compiling regular expression; regular_expression='(?iana',
error_at='ana', error_offset='3', error_message='unrecognized character
after (? or (?-', error_code='12'
One "invalid regular expression" message is to be expected
Error while compiling regular expression; regular_expression='((',
error_at='', error_offset='2', error_message='missing )', error_code='14'
PASS: test_filters
DNS cache speed:  6578947.368 iters/sec
inet_ntop speed:  1589572.405 iters/sec
PASS: test_dnscache
PASS: test_findeom
PASS: test_findcrlf
PASS: test_tags
PASS: test_logwriter
PASS: test_logproto
PASS: test_serialize
Failed to open the time zone file; filename='/usr/share/zoneinfo/Factory',
message='Failed to open file \'/usr/share/zoneinfo/Factory\': open()
failed: No such file or directory'
Bogus timezone spec, must be in the format [+-]HH:MM, offset must be less
than 24:00; value='Factory'
SKIP: Factory
PASS: test_zone
PASS: test_persist_state
PASS: test_value_pairs
====================
1 of 21 tests failed
====================
make[3]: *** [check-TESTS] Error 1
make[3]: Leaving directory
`/home/makerpm/rpmbuild/BUILD/syslog-ng-3.4.1/tests/unit'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory
`/home/makerpm/rpmbuild/BUILD/syslog-ng-3.4.1/tests/unit'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory
`/home/makerpm/rpmbuild/BUILD/syslog-ng-3.4.1/tests'
make: *** [check-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.izm78V (%check)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.izm78V (%check)
----------------------------xxxxxxxxxxxxx-------------------------------------------------------------------------

---------------syslog-ng.SPEC------------------------------------
%global evtlog_ver 0.2.12

%global _sbindir /sbin
%global _libdir /%{_lib}

Name: syslog-ng
Version: 3.4.1
Release: 1%{?dist}
Summary: Next-generation syslog server

Group: System Environment/Daemons
License: GPLv2+
Url: http://www.balabit.com/network-security/syslog-ng
Source0:
http://www.balabit.com/downloads/files?path=/syslog-ng/sources/%{version}/source/%{name}_%{version}.tar.gz
Source1: syslog-ng.conf
Source2: syslog-ng.init.d
Source3: syslog-ng.sysconfig
Source4: syslog-ng.logrotate

#Patch0: syslog-ng-3.2.4-disable-ssl-tests.patch
#Patch1: syslog-ng-3.2.5-tests-functional-control.py.patch
#Patch2: syslog-ng-3.2.5-tests-functional-sql-test.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: pkgconfig
BuildRequires: libtool
BuildRequires: eventlog-devel >= %{evtlog_ver}
BuildRequires: glib2-devel >= 2.10.1
BuildRequires: libdbi-devel
BuildRequires: libnet-devel >= 1.1.4-3
BuildRequires: openssl-devel
BuildRequires: pcre-devel >= 6.1
BuildRequires: tcp_wrappers-devel

# For the test suite
BuildRequires: python
# For the SQL tests
BuildRequires: libdbi-dbd-sqlite

Requires: logrotate
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service

Provides: syslog
# merge separate syslog-vim package into one
Provides: syslog-ng-vim = %{version}-%{release}
Obsoletes: syslog-ng-vim < 2.0.8-1


%description
syslog-ng, as the name shows, is a syslogd replacement, but with new
functionality for the new generation. The original syslogd allows
messages only to be sorted based on priority/facility pairs; syslog-ng
adds the possibility to filter based on message contents using regular
expressions. The new configuration scheme is intuitive and powerful.
Forwarding logs over TCP and remembering all forwarding hops makes it
ideal for firewalled environments.


%package libdbi
Summary: libdbi support for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description libdbi
This module supports a large number of database systems via libdbi.


%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%setup -q
#%patch0 -p1
#%patch1 -p1
#%patch2 -p1

# fix perl path
%{__sed} -i 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl

# fix executable perms on contrib files
%{__chmod} -c a-x contrib/syslog2ng

# fix authors file
/usr/bin/iconv -f iso8859-1 -t utf-8 AUTHORS > AUTHORS.conv && \
    %{__mv} -f AUTHORS.conv AUTHORS


%build
%configure \
    --prefix=/ \
    --libdir=/%{_lib} \
    --includedir=%{_includedir} \
    --sysconfdir=%{_sysconfdir}/%{name} \
    --localstatedir=%{_sharedstatedir}/%{name} \
    --datadir=%{_datadir}/%{name} \
    --with-module-dir=/%{_lib}/%{name} \
    --enable-ipv6 \
    --enable-tcp-wrapper \
    --enable-pcre \
    --enable-ssl \
    --enable-shared \
    --disable-static \
    --enable-dynamic-linking \
    --enable-threads=posix \
    --enable-linux-caps

# remove rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g'
libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{_smp_mflags}


%install
%{__rm} -rf %{buildroot}
make DESTDIR=%{buildroot} install

#%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{name}
%{__install} -p -m 644 %{SOURCE1}
%{buildroot}%{_sysconfdir}/%{name}/syslog-ng.conf

%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/init.d
%{__install} -p -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/%{name}

%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
%{__install} -p -m 644 %{SOURCE3}
%{buildroot}%{_sysconfdir}/sysconfig/%{name}

%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/logrotate.d
%{__install} -p -m 644 %{SOURCE4}
%{buildroot}%{_sysconfdir}/logrotate.d/syslog

# create the local state dir
%{__install} -d -m 755 %{buildroot}/%{_sharedstatedir}/%{name}

# install the main library header files
%{__install} -d -m 755 %{buildroot}%{_includedir}/%{name}
%{__install} -p -m 644 config.h %{buildroot}%{_includedir}/%{name}
%{__install} -p -m 644 lib/*.h %{buildroot}%{_includedir}/%{name}

# install vim files
%{__install} -d -m 755 %{buildroot}%{_datadir}/%{name}
%{__install} -p -m 644 contrib/syslog-ng.vim %{buildroot}%{_datadir}/%{name}
for vimver in 70 71 72 73 ; do
    %{__install} -d -m 755 %{buildroot}%{_datadir}/vim/vim$vimver/syntax
    cd %{buildroot}%{_datadir}/vim/vim$vimver/syntax
    ln -s ../../../%{name}/syslog-ng.vim .
    cd -
done

find %{buildroot} -name "*.la" -exec rm -f {} \;


%check
LD_LIBRARY_PATH=%{buildroot}/%{_lib}:%{buildroot}/%{_lib}/%{name} make check


%clean
rm -rf %{buildroot}


%post
/sbin/ldconfig
/sbin/chkconfig --add %{name}


%preun
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /sbin/service %{name} stop > /dev/null 2>&1
    /sbin/chkconfig --del %{name}
fi


%postun
/sbin/ldconfig
if [ $1 -ge 1 ] ; then
    # Package upgrade, not uninstall
    /sbin/service %{name} condrestart >/dev/null 2>&1
fi


%triggerin -- vim-common
VIMVERNEW=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | tail
-n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
[ -d %{_datadir}/vim/vim${VIMVERNEW}/syntax ] && \
    cd %{_datadir}/vim/vim${VIMVERNEW}/syntax && \
    ln -sf ../../../%{name}/syslog-ng.vim . || :

%triggerun -- vim-common
VIMVEROLD=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | head
-n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
[ $2 = 0 ] && rm -f %{_datadir}/vim/vim${VIMVEROLD}/syntax/syslog-ng.vim ||
:

%triggerpostun -- vim-common
VIMVEROLD=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | head
-n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
VIMVERNEW=`rpm -q --qf='%%{epoch}:%%{version}\n' vim-common | sort | tail
-n 1 | sed -e 's/[0-9]*://' | sed -e 's/\.[0-9]*$//' | sed -e 's/\.//'`
if [ $1 = 1 ]; then
    rm -f %{_datadir}/vim/vim${VIMVEROLD}/syntax/syslog-ng.vim || :
    [ -d %{_datadir}/vim/vim${VIMVERNEW}/syntax ] && \
        cd %{_datadir}/vim/vim${VIMVERNEW}/syntax && \
        ln -sf ../../../%{name}/syslog-ng.vim . || :
fi


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README ChangeLog NEWS
%doc doc/security/*.txt
%doc contrib/{relogger.pl,syslog2ng,syslog-ng.conf.doc}

%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/patterndb.d
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}/modules.conf
%config(noreplace) %{_sysconfdir}/%{name}/scl.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/syslog
%{_sysconfdir}/init.d/%{name}
%dir %{_sharedstatedir}/%{name}
%{_sbindir}/%{name}
%{_sbindir}/syslog-ng-ctl
%{_bindir}/loggen
%{_bindir}/pdbtool
%{_bindir}/update-patterndb
%{_libdir}/lib%{name}.so.*
%{_libdir}/%{name}/*.so
%exclude %{_libdir}/%{name}/libafsql.so

%dir %{_datadir}/%{name}
%{_datadir}/%{name}/syslog-ng.vim
%ghost %{_datadir}/vim/

# scl files
%{_datadir}/%{name}/include/

# uhm, some better places for those?
%{_datadir}/%{name}/xsd/

%{_mandir}/man1/loggen.1*
%{_mandir}/man1/pdbtool.1*
%{_mandir}/man1/syslog-ng-ctl.1*
%{_mandir}/man5/syslog-ng.conf.5*
%{_mandir}/man8/syslog-ng.8*


%files libdbi
%defattr(-,root,root,-)
%{_libdir}/%{name}/libafsql.so


%files devel
%defattr(-,root,root,-)
%{_libdir}/libsyslog-ng.so
%{_includedir}/%{name}/


%changelog
------------------------------------------------------------------------------------------------------------------------



----------/var/tmp/rpm-tmp.izm78V--------------------
#!/bin/sh

  RPM_SOURCE_DIR="/home/makerpm/rpmbuild/SOURCES"
  RPM_BUILD_DIR="/home/makerpm/rpmbuild/BUILD"
  RPM_OPT_FLAGS="-O2 -g"
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
  RPM_DOC_DIR="/usr/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="syslog-ng"
  RPM_PACKAGE_VERSION="3.4.1"
  RPM_PACKAGE_RELEASE="1.el6"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:

RPM_BUILD_ROOT="/home/makerpm/rpmbuild/BUILDROOT/syslog-ng-3.4.1-1.el6.x86_64"
  export RPM_BUILD_ROOT

  PKG_CONFIG_PATH="/lib64/pkgconfig:/usr/share/pkgconfig"
  export PKG_CONFIG_PATH

  set -x
  umask 022
  cd "/home/makerpm/rpmbuild/BUILD"
cd 'syslog-ng-3.4.1'
LD_LIBRARY_PATH=/home/makerpm/rpmbuild/BUILDROOT/syslog-ng-3.4.1-3.el6.x86_64/lib64:/makerpm/rpmbuild/BUILDROOT/syslog-ng-3.4.1-3.el6.x86_64/lib64/syslog-ng
make check

exit 0
-------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20130601/cb49db81/attachment-0001.htm 


More information about the syslog-ng mailing list