%undefine __cmake_in_source_build %global commit ed83f454cda90a9f1dfa9e4284fa4a8383a687f0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commit_date 20210624 %global asio_commit a4d820dd69b37fb8daee275d20eb162054453414 %global asio_shortcommit %(c=%{asio_commit}; echo ${c:0:7}) Name: restbed Version: 4.7^%{commit_date}g%{shortcommit} Release: 2%{?dist} Summary: RESTful functionality for C++11 applications License: AGPLv3+ URL: https://github.com/Corvusoft/%{name} Source0: %{url}/archive/%{commit}.tar.gz#/%{name}-%{shortcommit}.tar.gz Source1: https://github.com/chriskohlhoff/asio/archive/%{asio_commit}.tar.gz#/asio-%{asio_shortcommit}.tar.gz Patch0: 00-do-not-build-static-libraries.patch %if 0%{?rhel} BuildRequires: gcc-toolset-10 %else BuildRequires: gcc-c++ %endif BuildRequires: cmake BuildRequires: catch-devel BuildRequires: openssl-devel Requires: openssl %description Restbed is a comprehensive and consistent programming model for building applications that require seamless and secure communication over HTTP, with the ability to model a range of business processes, designed to target mobile, tablet, desktop and embedded production environments. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -q -n %{name}-%{commit} %setup -q -D -T -a1 -n %{name}-%{commit} %patch0 -p1 rmdir dependency/asio && ln -s ../asio-%{asio_commit} dependency/asio %build %if 0%{?rhel} scl enable gcc-toolset-10 - << \SCLEOF set -e %endif %cmake3 -DBUILD_TESTS=ON -DBUILD_SSL=ON -DCMAKE_INSTALL_LIBDIR=%{_lib} %cmake_build %if 0%{?rhel} SCLEOF %endif %check %if 0%{?rhel} scl enable gcc-toolset-10 - << \SCLEOF set -e %endif %cmake_build --target test -j %{?_smp_mflags} %if 0%{?rhel} SCLEOF %endif %install %cmake_install %files %license LICENSE %doc README.md %{_libdir}/librestbed.so.* %files devel %{_includedir}/restbed %{_includedir}/corvusoft/ %{_libdir}/librestbed.so %changelog * Tue Jul 6 2021 Levent Demirörs - 4.7^20210624ged83f45-2 - Build with asio version tagged upstream * Tue Jun 29 2021 Levent Demirörs - 4.7-1ed83f45 - Update to commit ed83f454cda90a9f1dfa9e4284fa4a8383a687f0 - Add patch to disable building/linking of static libraries * Mon Jun 28 2021 Levent Demirörs - 4.7-1 - Update library to 4.7 - Update compiler to GCC 10 - Prefer cmake macros