I'd like to submit some ai packages to factory, can I join your devel project?

OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/cpuinfo?expand=0&rev=1
This commit is contained in:
Christian Goll 2024-07-22 13:07:51 +00:00 committed by Git OBS Bridge
commit 5443cb588d
8 changed files with 151 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

14
_service Normal file
View File

@ -0,0 +1,14 @@
<services>
<service name="obs_scm" mode="manual">
<param name="url">https://github.com/pytorch/cpuinfo</param>
<param name="scm">git</param>
<param name="version">0.0</param>
<param name="revision">ca678952a9a8eaa6de112d154e8e104b22f9ab3f</param>
</service>
<service name="tar" mode="buildtime" />
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="manual" />
</services>

3
cpuinfo-0.0.obscpio Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d3bfb86d965f706279bf35ff575cf090145ed029c689e2b1086cabd68dda1f62
size 20823565

6
cpuinfo.changes Normal file
View File

@ -0,0 +1,6 @@
-------------------------------------------------------------------
Fri Jul 19 11:14:42 UTC 2024 - Adrian Schröter <adrian@suse.de>
- initial package.
We don't have any version yet upstream, so using version and soname 0

4
cpuinfo.obsinfo Normal file
View File

@ -0,0 +1,4 @@
name: cpuinfo
version: 0.0
mtime: 1720582619
commit: ca678952a9a8eaa6de112d154e8e104b22f9ab3f

88
cpuinfo.spec Normal file
View File

@ -0,0 +1,88 @@
#
# 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

12
soname.patch Normal file
View File

@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4634a22..87178a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -259,6 +259,7 @@ ELSEIF(CPUINFO_LIBRARY_TYPE STREQUAL "static")
ELSE()
MESSAGE(FATAL_ERROR "Unsupported library type ${CPUINFO_LIBRARY_TYPE}")
ENDIF()
+set_target_properties(cpuinfo PROPERTIES VERSION 0.0.0 SOVERSION 0)
ADD_LIBRARY(cpuinfo_internals STATIC ${CPUINFO_SRCS})
CPUINFO_TARGET_ENABLE_C99(cpuinfo)
CPUINFO_TARGET_ENABLE_C99(cpuinfo_internals)