File libcpuid.spec of Package libcpuid

#
# spec file for package libcpuid
#
# Copyright (c) 2024 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 https://bugs.opensuse.org/
#


%define so_ver  18
Name:           libcpuid
Version:        0.8.x
Release:        0
Summary:        Library providing x86 CPU identification
License:        BSD-2-Clause
URL:            https://github.com/anrieff/libcpuid
Source0:        %{name}-%{version}.tar.xz
Patch1:         001_%{name}_fix_install_paths.patch
BuildRequires:  help2man
BuildRequires:  pkgconfig
BuildRequires:  python3-base
BuildRequires:  libtool
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  cmake
BuildRequires:  gcc-c++

%description
Libcpuid provides CPU identification for the x86 (and x86_64) architectures.

%package tools
Summary:        Tools based on %{name}

%description tools
This package provides tools based on %{name}.

%package devel
Summary:        Development files for %{name}
Requires:       %{name}%{so_ver} = %{version}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
For details about the programming API, please see the docs
on the project's site (http://libcpuid.sourceforge.net/)

%package -n %{name}%{so_ver}
Summary:        Library providing CPU identification for x86

%description -n %{name}%{so_ver}
Libcpuid provides CPU identification for the x86 (and x86_64)
architectures.

%prep
%autosetup -p1 -n %{name}-%{version}

%build
%cmake \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=%{_prefix}
%cmake_build

%install
%cmake_install

# Drop useless libtool files
find %{buildroot} -type f -name "*.la" -delete -print

%ldconfig_scriptlets -n %{name}%{so_ver}

%files tools
%{_bindir}/cpuid_tool

%files -n %{name}%{so_ver}
%license COPYING AUTHORS
%{_libdir}/%{name}.so.%{so_ver}*

%files devel
%{_includedir}/%{name}
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%dir %{_libdir}/cmake/cpuid/
%{_libdir}/cmake/cpuid/*.cmake

%changelog
openSUSE Build Service is sponsored by