## START: Set by rpmautospec
## (rpmautospec version 0.6.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 3;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%bcond check 1


%global forgeurl https://github.com/cowsql/cowsql
Version:        1.15.6
%forgemeta

Name:           cowsql
Release:        %autorelease
Summary:        Embeddable, replicated and fault tolerant SQL engine
License:        LGPL-3.0-only WITH LGPL-3.0-linking-exception
URL:            %{forgeurl}
Source0:        %{forgesource}

BuildRequires:  gcc
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(libuv)
BuildRequires:  pkgconfig(raft)

%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 files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains development files for %{name}.

%prep
%forgeautosetup -p1

%build
autoreconf -i
%configure --disable-static
%make_build

%install
%make_install

%if %{with check}
%check
make check
%endif


%files
%license LICENSE
%doc README.md
%{_libdir}/libcowsql.so.0*

%files devel
%{_libdir}/libcowsql.so
%{_libdir}/pkgconfig/cowsql.pc
%{_includedir}/cowsql.h
%exclude %{_libdir}/*.la


%changelog
## START: Generated by rpmautospec
* Wed Jun 12 2024 Neil Hanlon <neil@shrug.pw> - 1.15.6-3
- build for epel9 (fedora#2290603)

* Mon Apr 01 2024 topazus <topazus@outlook.com> - 1.15.6-2
- Only enable packit on Fedora rawhide

* Sat Mar 30 2024 Packit <hello@packit.dev> - 1.15.6-1
- [packit] 1.15.6 upstream release
- Resolves: rhbz#2272284

* Fri Jan 26 2024 topazus <topazus@outlook.com> - 1.15.4-1
- initial import; rhbz#2259103
## END: Generated by rpmautospec