Blob Blame History Raw
# spec file for package fixmath
# Copyright (c) 2022 SUSE LLC
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define sover 1
Name:           fixmath
Version:        2022.07.20
Release:        0
Summary:        Fixed point math operations library
License:        MIT
Source0:        %{url}/archive/refs/heads/master.tar.gz#:/%{name}-%{version}.tar.gz
BuildRequires:  gcc-c++
# Use cmake3 package on SLE12 because cmake is too old (version 3.5)
%if !0%{?is_opensuse} && 0%{?sle_version} < 150000
BuildRequires:  cmake3-full >= 3.13
# Requires C++17
BuildRequires:  cmake >= 3.13

fixmath is fix point math operations library.

%package devel
Summary:        Header files for dragonbox, a float-to-string conversion library
Group:          Development/Languages/C and C++

%description devel
fixmath is fix point math operations library.

This package contains the headers and the static library.

%autosetup -n lib%{name}-master

# Fix lto-no-text-in-archive rpmlint error
export CFLAGS="${CFLAGS} -ffat-lto-objects"
export CXXFLAGS="${CXXFLAGS} -ffat-lto-objects"
%if !0%{?is_opensuse} && 0%{?sle_version} < 150000
# Remove -fsanitize=undefined opts in SLE-12-SP5
sed -e '/set(sanitizer_opts/d' -i tests/tests.cmake

mkdir -p %{buildroot}%{_libdir}
cp build/liblibfixmath.a %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}/libfixmath
cp libfixmath/*.h libfixmath/*.hpp %{buildroot}%{_includedir}/libfixmath

%files devel
%license LICENSE