Files
cpuinfo/cpuinfo.spec

89 lines
2.2 KiB
RPMSpec
Raw Normal View History

#
# spec file for package cpuinfo
#
# 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/
#
Name: cpuinfo
Version: 0.0
Release: 0
Summary: CPU INFOrmation tools
License: BSD-2-Clause
URL: https://github.com/pytorch/cpuinfo
Source: %name-%version.tar.xz
Patch1: soname.patch
BuildRequires: cmake
%description
CPU INFOrmation library (x86/x86-64/ARM/ARM64) of pytorch project.
%define lname libcpuinfo0
%package -n %lname
Summary: CPU INFOrmation library
%description -n %lname
CPU INFOrmation library (x86/x86-64/ARM/ARM64) of pytorch project.
%package -n libcpuinfo-devel
Summary: CPU INFOrmation library development files
Requires: %lname
%description -n libcpuinfo-devel
CPU INFOrmation library (x86/x86-64/ARM/ARM64) of pytorch project.
Development files, headers and cmake
%prep
%autosetup -p1
%build
# tests need extra packages, which are considered to be downloaded during build
# needs a second step to add these ...
%cmake .. \
-DCPUINFO_LIBRARY_TYPE=shared \
-DUSE_SYSTEM_LIBS=ON \
-DCPUINFO_BUILD_UNIT_TESTS=OFF \
-DCPUINFO_BUILD_MOCK_TESTS=OFF \
-DCPUINFO_BUILD_BENCHMARKS=OFF
%install
%cmake_install
mkdir -p %buildroot/usr/share/cmake
mv %buildroot/usr/share/{,cmake/}cpuinfo
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%files
%license LICENSE
%doc README.md
%_bindir/cache-info
%_bindir/cpu-info
%_bindir/isa-info
%ifarch x86_64
%_bindir/cpuid-dump
%endif
%files -n %lname
%_libdir/libcpuinfo.so.*
%files -n libcpuinfo-devel
%_includedir/cpuinfo.h
%_libdir/libcpuinfo.so
%_libdir/pkgconfig/libcpuinfo.pc
%_datadir/cmake/cpuinfo
%changelog