Skip to content

Commit

Permalink
rpm: fix building rpm using packpack
Browse files Browse the repository at this point in the history
Starting with fedora 33, the cmake build strategy has been changed
to "out-of-source builds" by default (see [1]). Let's add support
for the new behavior.

Added `prebuild.sh` script with installation of Tarantool repo.

`Packpack` performs building rpm packages in a clean docker container.
The container must contain `luatest` to perform testing during the
build as it was set by `-DCMAKE_BUILD_TYPE=RelWithDebInfo` cmake var.
This cmake var was removed in this commit as well as `%check` phase.

It's quite challenging to set up `luacheck` while the package is
building and a bit useless because the module is tested in another job.

[1] https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds

Closes #165
  • Loading branch information
artembo committed Jul 19, 2022
1 parent e3b35bf commit 28ee321
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions rpm/prebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -e -o pipefail

curl -LsSf https://www.tarantool.io/release/1.10/installer.sh | sudo bash
17 changes: 11 additions & 6 deletions rpm/tarantool-http.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ This package provides a HTTP server for Tarantool.
%setup -q -n %{name}-%{version}

%build
%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo
make %{?_smp_mflags}

%check
make %{?_smp_mflags} luatest
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 8
%cmake_build
%else
%make_build
%endif

%install
%make_install
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 8
%cmake_install
%else
%make_install
%endif

%files
%{_libdir}/tarantool/*/
Expand Down

0 comments on commit 28ee321

Please sign in to comment.