Blame fixmath.spec

0827c9
#
0827c9
# spec file for package fixmath
0827c9
#
e890d0
# Copyright (c) 2022 SUSE LLC
0827c9
#
0827c9
# All modifications and additions to the file contributed by third parties
0827c9
# remain the property of their copyright owners, unless otherwise agreed
0827c9
# upon. The license for this file, and modifications and additions to the
0827c9
# file, is the same license as for the pristine package itself (unless the
0827c9
# license for the pristine package is not an Open Source License, in which
0827c9
# case the license is the MIT License). An "Open Source License" is a
0827c9
# license that conforms to the Open Source Definition (Version 1.9)
0827c9
# published by the Open Source Initiative.
0827c9
0827c9
# Please submit bugfixes or comments via https://bugs.opensuse.org/
0827c9
#
0827c9
0827c9
0827c9
%define sover 1
0827c9
Name:           fixmath
0827c9
Version:        2022.07.20
0827c9
Release:        0
0827c9
Summary:        Fixed point math operations library
0827c9
License:        MIT
0827c9
URL:            https://github.com/PetteriAimonen/libfixmath
0827c9
Source0:        %{url}/archive/refs/heads/master.tar.gz#:/%{name}-%{version}.tar.gz
e890d0
BuildRequires:  gcc-c++
0827c9
# Use cmake3 package on SLE12 because cmake is too old (version 3.5)
0827c9
%if !0%{?is_opensuse} && 0%{?sle_version} < 150000
e890d0
BuildRequires:  cmake3-full >= 3.13
0827c9
# Requires C++17
0827c9
%else
e890d0
BuildRequires:  cmake >= 3.13
0827c9
%endif
0827c9
0827c9
%description
0827c9
fixmath is fix point math operations library.
0827c9
0827c9
%package devel
0827c9
Summary:        Header files for dragonbox, a float-to-string conversion library
0827c9
Group:          Development/Languages/C and C++
0827c9
0827c9
%description devel
0827c9
fixmath is fix point math operations library.
0827c9
0827c9
This package contains the headers and the static library.
0827c9
0827c9
%prep
0827c9
%autosetup -n lib%{name}-master
0827c9
0827c9
%build
e890d0
# Fix lto-no-text-in-archive rpmlint error
0827c9
export CFLAGS="${CFLAGS} -ffat-lto-objects"
0827c9
export CXXFLAGS="${CXXFLAGS} -ffat-lto-objects"
0827c9
%if !0%{?is_opensuse} && 0%{?sle_version} < 150000
e890d0
# Remove -fsanitize=undefined opts in SLE-12-SP5
e890d0
sed -e '/set(sanitizer_opts/d' -i tests/tests.cmake
0827c9
%endif
e890d0
%cmake
0827c9
%cmake_build
0827c9
0827c9
%install
0827c9
mkdir -p %{buildroot}%{_libdir}
0827c9
cp build/liblibfixmath.a %{buildroot}%{_libdir}
0827c9
mkdir -p %{buildroot}%{_includedir}/libfixmath
0827c9
cp libfixmath/*.h libfixmath/*.hpp %{buildroot}%{_includedir}/libfixmath
0827c9
0827c9
%files devel
0827c9
%doc README.md
0827c9
%license LICENSE
0827c9
%{_includedir}/libfixmath
0827c9
%{_libdir}/*.a
0827c9
0827c9
%changelog