[syslog-ng/el6] Enabled SQL support (subpackage syslog-ng-libdbi) and the SQL test.

Jose Pedro Oliveira jpo at fedoraproject.org
Sun Jan 15 19:34:30 UTC 2012


commit 260e957a40b59c41c113b3d69a263623c9c26071
Author: Jose Pedro Oliveira <jpo at di.uminho.pt>
Date:   Sun Jan 15 19:34:12 2012 +0000

    Enabled SQL support (subpackage syslog-ng-libdbi) and the SQL test.

 ...atch => syslog-ng-3.2.4-disable-ssl-tests.patch |    7 ++--
 syslog-ng-3.2.5-tests-functional-control.py.patch  |   12 +++++++
 syslog-ng-3.2.5-tests-functional-sql-test.patch    |   33 ++++++++++++++++++++
 syslog-ng.spec                                     |   32 +++++++++++++++++--
 4 files changed, 76 insertions(+), 8 deletions(-)
---
diff --git a/syslog-ng-3.2.4-disable-sql-and-ssl-tests.patch b/syslog-ng-3.2.4-disable-ssl-tests.patch
similarity index 83%
rename from syslog-ng-3.2.4-disable-sql-and-ssl-tests.patch
rename to syslog-ng-3.2.4-disable-ssl-tests.patch
index 633fc82..7c29736 100644
--- a/syslog-ng-3.2.4-disable-sql-and-ssl-tests.patch
+++ b/syslog-ng-3.2.4-disable-ssl-tests.patch
@@ -1,6 +1,6 @@
 diff -ruN syslog-ng-3.2.4/tests/functional/func_test.py syslog-ng-3.2.4-modified/tests/functional/func_test.py
 --- syslog-ng-3.2.4/tests/functional/func_test.py	2010-07-09 11:19:27.000000000 +0100
-+++ syslog-ng-3.2.4-modified/tests/functional/func_test.py	2011-05-12 03:23:48.276226460 +0100
++++ syslog-ng-3.2.4-modified/tests/functional/func_test.py	2011-05-16 20:47:48.586752031 +0100
 @@ -60,11 +60,12 @@
  # import test modules
  import test_file_source
@@ -8,12 +8,11 @@ diff -ruN syslog-ng-3.2.4/tests/functional/func_test.py syslog-ng-3.2.4-modified
 -import test_input_drivers
 +#import test_input_drivers
  import test_performance
--import test_sql
-+#import test_sql
+ import test_sql
  
 -tests = (test_input_drivers, test_sql, test_file_source, test_filters, test_performance)
 +#tests = (test_input_drivers, test_sql, test_file_source, test_filters, test_performance)
-+tests = (test_file_source, test_filters, test_performance)
++tests = (test_sql, test_file_source, test_filters, test_performance)
  
  init_env()
  seed_rnd()
diff --git a/syslog-ng-3.2.5-tests-functional-control.py.patch b/syslog-ng-3.2.5-tests-functional-control.py.patch
new file mode 100644
index 0000000..26ef2e2
--- /dev/null
+++ b/syslog-ng-3.2.5-tests-functional-control.py.patch
@@ -0,0 +1,12 @@
+diff -ruN syslog-ng-3.2.5/tests/functional/control.py syslog-ng-3.2.5-modified/tests/functional/control.py
+--- syslog-ng-3.2.5/tests/functional/control.py	2010-11-20 08:47:33.000000000 +0000
++++ syslog-ng-3.2.5-modified/tests/functional/control.py	2012-01-15 04:56:14.948239475 +0000
+@@ -35,7 +35,7 @@
+         for (root, dirs, files) in os.walk(os.path.abspath(os.path.join(os.environ['top_builddir'], 'modules'))):
+             module_path = ':'.join(map(lambda x: root + '/' + x, dirs))
+             break
+-        rc = os.execl('../../syslog-ng/syslog-ng', '../../syslog-ng/syslog-ng', '-f', 'test.conf', '--fd-limit', '1024', '-F', verbose_opt, '-p', 'syslog-ng.pid', '-R', 'syslog-ng.persist', '--no-caps', '--enable-core', '--seed', '--module-path', module_path)
++        rc = os.execl('../../syslog-ng/syslog-ng', '../../syslog-ng/syslog-ng', '-f', 'test.conf', '--fd-limit', '1024', '-F', verbose_opt, '-p', '/var/tmp/syslog-ng.pid', '-c', '/var/tmp/syslog-ng.ctl', '-R', '/var/tmp/syslog-ng.persist', '--no-caps', '--enable-core', '--seed', '--module-path', module_path)
+         sys.exit(rc)
+     time.sleep(5)
+     print_user("Syslog-ng started")
diff --git a/syslog-ng-3.2.5-tests-functional-sql-test.patch b/syslog-ng-3.2.5-tests-functional-sql-test.patch
new file mode 100644
index 0000000..848e2ca
--- /dev/null
+++ b/syslog-ng-3.2.5-tests-functional-sql-test.patch
@@ -0,0 +1,33 @@
+diff -ruN syslog-ng-3.2.5/tests/functional/globals.py syslog-ng-3.2.5-modified/tests/functional/globals.py
+--- syslog-ng-3.2.5/tests/functional/globals.py	2011-10-08 11:34:21.000000000 +0100
++++ syslog-ng-3.2.5-modified/tests/functional/globals.py	2012-01-15 05:34:12.641744234 +0000
+@@ -7,7 +7,7 @@
+     return False
+ 
+ def has_module(module):
+-    avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep ^Available-Modules: ', 'r').read()
++    avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep ^Enable-', 'r').read()
+     if avail_mods.find(module) != -1:
+         return True
+     return False
+diff -ruN syslog-ng-3.2.5/tests/functional/test_sql.py syslog-ng-3.2.5-modified/tests/functional/test_sql.py
+--- syslog-ng-3.2.5/tests/functional/test_sql.py	2011-10-08 11:34:21.000000000 +0100
++++ syslog-ng-3.2.5-modified/tests/functional/test_sql.py	2012-01-15 05:37:56.699303941 +0000
+@@ -28,7 +28,7 @@
+ 
+ def check_env():
+ 
+-    if not has_module('afsql'):
++    if not has_module('SQL'):
+         print 'afsql module is not available, skipping SQL test'
+         return False
+     paths=('/opt/syslog-ng/bin', '/usr/bin', '/usr/local/bin')
+@@ -45,7 +45,7 @@
+         soext='.sl'
+ 
+     found = False
+-    paths = (os.environ.get('dbd_dir', None), '/usr/local/lib/dbd', '/usr/lib/dbd', '/opt/syslog-ng/lib/dbd')
++    paths = (os.environ.get('dbd_dir', None), '/usr/local/lib/dbd', '/usr/lib/dbd', '/usr/lib64/dbd', '/opt/syslog-ng/lib/dbd')
+     for pth in paths:
+         if pth and os.path.isfile('%s/libdbdsqlite3%s' % (pth, soext)):
+             found = True
diff --git a/syslog-ng.spec b/syslog-ng.spec
index 1fb018c..d8cd954 100644
--- a/syslog-ng.spec
+++ b/syslog-ng.spec
@@ -5,7 +5,7 @@
 
 Name: syslog-ng
 Version: 3.2.5
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: Next-generation syslog server
 
 Group: System Environment/Daemons
@@ -17,7 +17,9 @@ Source2: syslog-ng.init.d
 Source3: syslog-ng.sysconfig
 Source4: syslog-ng.logrotate
 
-Patch0: syslog-ng-3.2.4-disable-sql-and-ssl-tests.patch
+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)
 
@@ -25,7 +27,7 @@ BuildRequires: pkgconfig
 BuildRequires: libtool
 BuildRequires: eventlog-devel >= %{evtlog_ver}
 BuildRequires: glib2-devel >= 2.10.1
-#BuildRequires: libdbi-devel
+BuildRequires: libdbi-devel
 BuildRequires: libnet-devel >= 1.1.4-3
 #BuildRequires: openssl-devel
 BuildRequires: pcre-devel >= 6.1
@@ -33,6 +35,8 @@ BuildRequires: tcp_wrappers-devel
 
 # For the test suite
 BuildRequires: python
+# For the SQL tests
+BuildRequires: libdbi-dbd-sqlite
 
 Requires: logrotate
 Requires(post): /sbin/chkconfig
@@ -56,6 +60,15 @@ 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
@@ -69,6 +82,8 @@ 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
@@ -94,7 +109,7 @@ developing applications that use %{name}.
     --enable-tcp-wrapper \
     --enable-pcre \
     --enable-spoof-source \
-    --disable-sql \
+    --enable-sql \
     --disable-ssl \
     --enable-shared \
     --disable-static \
@@ -216,6 +231,7 @@ fi
 %{_bindir}/update-patterndb
 %{_libdir}/lib%{name}.so.*
 %{_libdir}/%{name}/*.so
+%exclude %{_libdir}/%{name}/libafsql.so
 
 %dir %{_datadir}/%{name}
 %{_datadir}/%{name}/syslog-ng.vim
@@ -234,6 +250,11 @@ fi
 %{_mandir}/man8/syslog-ng.8*
 
 
+%files libdbi
+%defattr(-,root,root,-)
+%{_libdir}/%{name}/libafsql.so
+
+
 %files devel
 %defattr(-,root,root,-)
 %{_libdir}/libsyslog-ng.so
@@ -241,6 +262,9 @@ fi
 
 
 %changelog
+* Sun Jan 15 2012 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.5-3
+- Enabled SQL support (subpackage syslog-ng-libdbi) and the SQL test.
+
 * Wed Dec 14 2011 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.5-2
 - Ship the same logrotate file as the one shipped in RHEL 6.2 rsyslog package
   (see #767761 and #683537)


More information about the scm-commits mailing list