## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    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

%global forgeurl https://github.com/zyantific/zycore-c
Version:        1.5.0
%forgemeta

%global sover %{echo %{version} | cut -d '.' -f 1,2}

Name:           zycore-c
Release:        %autorelease
Summary:        Zyan Core Library for C

License:        MIT
URL:            %{forgeurl}
Source0:        %{forgesource}

# https://github.com/zyantific/zycore-c/issues/59
ExcludeArch:    s390x

BuildRequires:  gcc-c++
BuildRequires:  cmake
BuildRequires:  ninja-build
BuildRequires:  gtest-devel
BuildRequires:  doxygen

%description
The Zyan Core Library for C is an internal library providing platform
independent types, macros and a fallback for environments without LibC.

%package        devel
Summary:        Development libraries and header 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}.

%package        doc
Summary:        Documentation for %{name}
BuildArch:      noarch

%description    doc
The %{name}-doc package contains the documentation for %{name}.

%prep
%autosetup -p1

%build
%cmake \
    -GNinja \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DZYCORE_BUILD_SHARED_LIB=ON \
    -DZYCORE_BUILD_TESTS=ON \
    -DZYCORE_BUILD_EXAMPLES=ON \
%cmake_build

%install
%cmake_install

rm -r %{buildroot}%{_mandir}/man3

%check
%ctest

%files
%license LICENSE
%doc README.md
%{_libdir}/libZycore.so.%{sover}*

%files devel
%{_includedir}/Zycore/
%{_libdir}/cmake/zycore/
%{_libdir}/libZycore.so

%files doc
%license LICENSE
%{_docdir}/Zycore/

%changelog
## START: Generated by rpmautospec
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Fri Feb 16 2024 Felix Wang <topazus@outlook.com> - 1.5.0-1
- update to 1.5.0

* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Tue Jan 02 2024 topazus <topazus@outlook.com> - 1.4.1-4
- add packit file

* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon Jun 19 2023 topazus <topazus@outlook.com> - 1.4.1-2
- add Packit CI

* Fri Jun 16 2023 topazus <topazus@outlook.com> - 1.4.1-1
- initial import (RHBZ#2196601)
## END: Generated by rpmautospec