+++ /dev/null
---- sysbench-0.4.12/acinclude.m4~ 2009-03-14 14:35:36.000000000 +0100
-+++ sysbench-0.4.12/acinclude.m4 2018-03-10 23:19:19.161781346 +0100
-@@ -1,9 +1,7 @@
- dnl ---------------------------------------------------------------------------
- dnl Macro: AC_CHECK_MYSQLR
- dnl First check for custom MySQL paths in --with-mysql-* options.
--dnl If some paths are missing, check if mysql_config exists.
--dnl Then check for the libraries and replace -lmysqlclient with
--dnl -lmysqlclient_r, to enable threaded client library.
-+dnl If some paths are missing, check if mysql_config exists.
- dnl ---------------------------------------------------------------------------
-
- AC_DEFUN([AC_CHECK_MYSQLR],[
-@@ -51,7 +49,7 @@
- ac_cv_mysql_libs=`echo ${ac_cv_mysql_libs} | sed -e 's/.libs$//' \
- -e 's+.libs/$++'`
- AC_CACHE_CHECK([MySQL libraries], [ac_cv_mysql_libs], [ac_cv_mysql_libs=""])
-- MYSQL_LIBS="-L$ac_cv_mysql_libs -lmysqlclient_r"
-+ MYSQL_LIBS="-L$ac_cv_mysql_libs -lmysqlclient"
- fi
-
- # If some path is missing, try to autodetermine with mysql_config
-@@ -82,8 +80,7 @@
- if test [ -z "$ac_cv_mysql_libs" ]
- then
- AC_MSG_CHECKING(MySQL linker flags)
-- MYSQL_LIBS=`${mysqlconfig} --libs | sed -e \
-- 's/-lmysqlclient /-lmysqlclient_r /' -e 's/-lmysqlclient$/-lmysqlclient_r/'`
-+ MYSQL_LIBS=`${mysqlconfig} --libs`
- AC_MSG_RESULT($MYSQL_LIBS)
- fi
- fi
+%bcond_without tests
Summary: a system performance benchmark
Name: sysbench
-Version: 0.4.12
-Release: 4
-License: GPL
+Version: 1.0.20
+Release: 1
+License: GPL v2+
Group: Applications/System
-Source0: http://downloads.sourceforge.net/sysbench/%{name}-%{version}.tar.gz
-# Source0-md5: 3a6d54fdd3fe002328e4458206392b9d
-Patch0: no-mysqlclient_r.patch
-URL: http://sysbench.sourceforge.net/
+Source0: https://github.com/akopytov/sysbench/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 756381c6fc4e16af1e0831b5e6a3dcb3
+Patch0: %{name}-1.0.20-fix_deprecated_egrep_call.patch
+Patch1: %{name}-1.0.20-python3.patch
+URL: https://github.com/akopytov/sysbench/
BuildRequires: autoconf
BuildRequires: automake
+BuildRequires: libaio-devel
BuildRequires: libtool
+BuildRequires: libxslt-progs
+BuildRequires: luajit-devel
BuildRequires: mysql-devel
BuildRequires: postgresql-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
+
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\1,' \
+ tests/include/drv_common.sh \
+ tests/include/script_bulk_insert_common.sh \
+ tests/include/script_oltp_common.sh \
+ tests/include/script_oltp_legacy_common.sh \
+ tests/include/script_select_random_common.sh \
+ tests/include/script_select_random_legacy_common.sh \
+ tests/test_run.sh
+
+%{__sed} -E -i -e '1s,#!\s*%{_bindir}/env\s+sysbench(\s|$),#!%{_bindir}/sysbench\1,' \
+ src/lua/bulk_insert.lua \
+ src/lua/oltp_delete.lua \
+ src/lua/oltp_insert.lua \
+ src/lua/oltp_point_select.lua \
+ src/lua/oltp_read_only.lua \
+ src/lua/oltp_read_write.lua \
+ src/lua/oltp_update_index.lua \
+ src/lua/oltp_update_non_index.lua \
+ src/lua/oltp_write_only.lua \
+ src/lua/select_random_points.lua \
+ src/lua/select_random_ranges.lua
+
+rm -r third_party/luajit/luajit/
+#rm -r third_party/concurrency_kit/ck/
+#rm -r third_party/cram/
%build
%{__libtoolize}
%{__automake}
%configure \
--with-mysql \
- --with-pgsql
+ --with-pgsql \
+ --with-system-luajit \
+ --without-gcc-arch \
+ --disable-silent-rules
+# --with-system-ck
%{__make}
+%if %{with tests}
+cd tests
+./test_run.sh
+cd ..
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+rm $RPM_BUILD_ROOT%{_docdir}/sysbench/manual.html
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc ChangeLog README TODO doc/manual.html
+%doc ChangeLog README.md doc/manual.html
%attr(755,root,root) %{_bindir}/%{name}
+%{_datadir}/sysbench