Skip to content

Commit

Permalink
build: add zypper makefile for SuSE
Browse files Browse the repository at this point in the history
Added makefile to build the SuSE based packages.

Part of #4562
  • Loading branch information
avtikhon committed Oct 21, 2019
1 parent 399899a commit 63545a4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
28 changes: 21 additions & 7 deletions rpm/tarantool.spec
@@ -1,13 +1,13 @@
# Enable systemd for on RHEL >= 7 and Fedora >= 15
%if (0%{?fedora} >= 15 || 0%{?rhel} >= 7)
%if (0%{?fedora} >= 15 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500)
%bcond_without systemd
%else
%bcond_with systemd
%endif

BuildRequires: cmake >= 2.8
BuildRequires: make
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7)
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500)
# RHEL 6 requires devtoolset
BuildRequires: gcc >= 4.5
BuildRequires: gcc-c++ >= 4.5
Expand Down Expand Up @@ -64,7 +64,7 @@ BuildRequires: libunwind-devel
%endif

# For tests
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7)
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500)
BuildRequires: python >= 2.7
BuildRequires: python-six >= 1.9.0
BuildRequires: python-gevent >= 1.0
Expand All @@ -90,7 +90,7 @@ Requires: /etc/services
# Deps for built-in package manager
# https://github.com/tarantool/tarantool/issues/2612
Requires: openssl
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 8)
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 8 || 0%{?sle_version} >= 1500)
# RHEL <= 7 doesn't support Recommends:
Recommends: tarantool-devel
Recommends: git-core
Expand Down Expand Up @@ -126,7 +126,14 @@ C and Lua/C modules.

%build
# RHBZ #1301720: SYSCONFDIR an LOCALSTATEDIR must be specified explicitly
%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
%if (0%{?sle_version} >= 1500)
# SuSE uses only out-of-source builds in its macros
%cmake .. \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
%else
%cmake . \
%endif
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \
-DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \
%if %{with backtrace}
Expand All @@ -142,19 +149,26 @@ C and Lua/C modules.
-DENABLE_DIST:BOOL=ON
make %{?_smp_mflags}

%if (0%{?sle_version} == 0)
%install
%endif
%make_install
# %%doc and %%license macroses are used instead
rm -rf %{buildroot}%{_datarootdir}/doc/tarantool/

%check
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7)
%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500)
# https://github.com/tarantool/tarantool/issues/1227
echo "self.skip = True" > ./test/app/socket.skipcond
# https://github.com/tarantool/tarantool/issues/1322
echo "self.skip = True" > ./test/app/digest.skipcond
# run a safe subset of the test suite
cd test && ./test-run.py --force -j 1 unit/ app/ app-tap/ box/ box-tap/ engine/ vinyl/
%if (0%{?sle_version} >= 1500)
# SuSE uses only out-of-source builds always at build/ subdir in its macros
cd build && TEST_RUN_EXCLUDE_TESTS='replication/' make test-force
%else
cd test && ./test-run.py --force --exclude replication/
%endif
%endif

%pre
Expand Down
1 change: 1 addition & 0 deletions test/app-tap/CMakeLists.txt
@@ -1 +1,2 @@
SET(CMAKE_SHARED_LINKER_FLAGS "")
build_module(module_api module_api.c)
1 change: 1 addition & 0 deletions test/app/CMakeLists.txt
@@ -1 +1,2 @@
SET(CMAKE_SHARED_LINKER_FLAGS "")
build_module(loaderslib loaderslib.c)
6 changes: 6 additions & 0 deletions test/box-tap/cfg.skipcond
@@ -1,8 +1,14 @@
import os
import platform

# Disabled on FreeBSD due to fail #4271:
# Data segment size exceeds process limit
if platform.system() == 'FreeBSD':
self.skip = 1
try:
if os.popen('lsb_release -i').read().split(':')[1].strip() == 'openSUSE':
self.skip = 1
except IndexError:
pass

# vim: set ft=python:
1 change: 1 addition & 0 deletions test/box/CMakeLists.txt
@@ -1,3 +1,4 @@
SET(CMAKE_SHARED_LINKER_FLAGS "")
include_directories(${MSGPUCK_INCLUDE_DIRS})
build_module(function1 function1.c)
build_module(reload1 reload1.c)
Expand Down

0 comments on commit 63545a4

Please sign in to comment.