cowsql/cowsql.spec
2023-10-31 21:53:38 -04:00

132 lines
2.8 KiB
RPMSpec

# adapted with love from sqlite
%bcond_without check
%bcond_with docs
%bcond_without static
%global gittagversion 1.15.3
%global gittag v%{?gittagversion}
Name: cowsql
Version: %{gittagversion}
Release: %autorelease
Summary: Embeddable, replicated and fault tolerant SQL engine
License: LGPL-3.0-only
URL: https://github.com/cowsql/cowsql/
Source: %{url}/archive/%{gittag}/%{name}-%{version}.tar.gz
Provides: libcowsql
ExcludeArch: s390x
# tool requirements
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: make
# cowsql
BuildRequires: libuv-devel
BuildRequires: raft-devel
BuildRequires: sqlite-devel
# docs
%if %{with docs}
BuildRequires: python-sphinx
BuildRequires: python-mock
BuildRequires: python-alabaster
BuildRequires: python-commonmark
BuildRequires: python-sphinx-rtd-theme
BuildRequires: python-recommonmark
%endif
%description
cowsql is a C library that implements an embeddable and
replicated SQL database engine with high availability and automatic failover.
cowsql extends SQLite with a network protocol that can connect together various
instances of your application and have them act as a highly-available cluster,
with no dependency on external databases.
The name "cowsql" loosely refers to the "pets vs. cattle" concept, since it's
generaly fine to delete or rebuild a particular node of an application that
uses cowsql for data storage.
%package devel
Summary: Development tools for the cowsql embeddable SQL database engine
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
Provides: lib%{name}-devel
%description devel
This package contains the header files and development documentation
for %{name}. If you like to develop programs using %{name}, you will need
to install %{name}-devel.
%if %{with docs}
%package doc
Summary: Documentation for libcowsql
BuildArch: noarch
%description doc
This package contains most of the static HTML files that comprise the
cowsql.dev website
%endif
%prep
%autosetup -p1 -n %{name}-%{version}
autoreconf -iv
%build
%configure
%make_build
%if %{with docs}
sphinx-build -a docs docs-build
%endif
%install
%make_install
%if ! %{with static}
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.{la,a}
%endif
%if %{with docs}
pushd docs-build
for d in **/*; do
install -Dpm 644 -t %{buildroot}/usr/share/doc/cowsql/ $d
done
popd
%endif
%if %{with check}
%check
make check
%endif
%files
%license LICENSE
%{_libdir}/lib%{name}.so.0
%{_libdir}/lib%{name}.so.0.*
%files devel
%{_includedir}/%{name}.h
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/cowsql.pc
%if %{with static}
%{_libdir}/lib%{name}.a
%exclude %{_libdir}/*.la
%endif
%if %{with docs}
%files doc
%doc /usr/share/doc/cowsql
%endif
%changelog
%autochangelog