%global version_major 2
%global abiversion %{version_major}
%global gittag %{name}%{version_major}_%{version}

Name:           gz-utils
Version:        2.2.0
Release:        1%{?dist}
Summary:        General purpose utilities for robotic applications

License:        Apache-2.0
URL:            https://gazebosim.org
Source0:        https://github.com/gazebosim/%{name}/archive/%{gittag}/%{name}-%{version}.tar.gz 

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  gz-cmake-devel >= 3
BuildRequires:  make
# Documentation
BuildRequires:  doxygen

%description
Gazebo Utils, a component of Gazebo, provides general purpose classes and
functions designed for robotic applications.

%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: gz-cmake-devel >= 3

%description devel
%{summary}

%prep
%autosetup -n %{name}-%{gittag} -Sgendiff -p1


%build
%cmake \
  -DCMAKE_BUILD_TYPE:STRING=Release \
  -DUSE_HOST_SSE_FLAGS:BOOL=OFF
%cmake_build


%install
%cmake_install

%check
%ctest

%files
%license LICENSE
%{_libdir}/*.so.%{version}
%{_libdir}/*.so.%{abiversion}
%{_datadir}/gz

%files devel
%doc redhat-linux-build/doxygen/html
%{_libdir}/*.so
%{_libdir}/cmake/%{name}%{version_major}*
%{_libdir}/pkgconfig/%{name}*.pc
%{_includedir}/gz


%changelog
* Wed Apr 03 2024 Rich Mattes <richmattes@gmail.com> - 2.2.0-1
- Initial package