Skip to content

Commit a47dff1

Browse files
author
CKI KWF Bot
committed
Merge: Enable building libcpupower bindings for Stream 10
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1456 With the libcpupower changes merged in these final two commits allow the build system to enabling building the bindings into kernel-tools-libs-devel JIRA: https://issues.redhat.com/browse/RHEL-83442 Signed-off-by: John B. Wyatt IV <jwyatt@redhat.com> Approved-by: John Kacur <jkacur@redhat.com> Approved-by: Justin M. Forbes <jforbes@fedoraproject.org> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 2313288 + 325904b commit a47dff1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

redhat/kernel.spec.template

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,11 @@ BuildRequires: libbpf-devel
772772
BuildRequires: bpftool
773773
BuildRequires: clang
774774

775+
%ifarch %{cpupowerarchs}
776+
# For libcpupower bindings
777+
BuildRequires: swig
778+
%endif
779+
775780
%ifnarch s390x
776781
BuildRequires: pciutils-devel
777782
%endif
@@ -1335,7 +1340,7 @@ This package provides debug information for package %{package_name}-tools.
13351340
# symlinks because of the trailing nonmatching alternation and
13361341
# the leading .*, because of find-debuginfo.sh's buggy handling
13371342
# of matching the pattern against the symlinks file.
1338-
%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%%{_bindir}/bootconfig(\.debug)?|.*%%{_bindir}/centrino-decode(\.debug)?|.*%%{_bindir}/powernow-k8-decode(\.debug)?|.*%%{_bindir}/cpupower(\.debug)?|.*%%{_libdir}/libcpupower.*|.*%%{_bindir}/turbostat(\.debug)?|.*%%{_bindir}/x86_energy_perf_policy(\.debug)?|.*%%{_bindir}/tmon(\.debug)?|.*%%{_bindir}/lsgpio(\.debug)?|.*%%{_bindir}/gpio-hammer(\.debug)?|.*%%{_bindir}/gpio-event-mon(\.debug)?|.*%%{_bindir}/gpio-watch(\.debug)?|.*%%{_bindir}/iio_event_monitor(\.debug)?|.*%%{_bindir}/iio_generic_buffer(\.debug)?|.*%%{_bindir}/lsiio(\.debug)?|.*%%{_bindir}/intel-speed-select(\.debug)?|.*%%{_bindir}/page_owner_sort(\.debug)?|.*%%{_bindir}/slabinfo(\.debug)?|.*%%{_sbindir}/intel_sdsi(\.debug)?|XXX' -o %{package_name}-tools-debuginfo.list}
1343+
%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%%{_bindir}/bootconfig(\.debug)?|.*%%{_bindir}/centrino-decode(\.debug)?|.*%%{_bindir}/powernow-k8-decode(\.debug)?|.*%%{_bindir}/cpupower(\.debug)?|.*%%{_libdir}/libcpupower.*|.*%%{python3_sitearch}/_raw_pylibcpupower.*|.*%%{_bindir}/turbostat(\.debug)?|.*%%{_bindir}/x86_energy_perf_policy(\.debug)?|.*%%{_bindir}/tmon(\.debug)?|.*%%{_bindir}/lsgpio(\.debug)?|.*%%{_bindir}/gpio-hammer(\.debug)?|.*%%{_bindir}/gpio-event-mon(\.debug)?|.*%%{_bindir}/gpio-watch(\.debug)?|.*%%{_bindir}/iio_event_monitor(\.debug)?|.*%%{_bindir}/iio_generic_buffer(\.debug)?|.*%%{_bindir}/lsiio(\.debug)?|.*%%{_bindir}/intel-speed-select(\.debug)?|.*%%{_bindir}/page_owner_sort(\.debug)?|.*%%{_bindir}/slabinfo(\.debug)?|.*%%{_sbindir}/intel_sdsi(\.debug)?|XXX' -o %{package_name}-tools-debuginfo.list}
13391344

13401345
%package -n rtla
13411346
%if 0%{gemini}
@@ -3118,6 +3123,8 @@ chmod +x tools/perf/check-headers.sh
31183123
%ifarch %{cpupowerarchs}
31193124
# link against in-tree libcpupower for idle state support
31203125
%global rtla_make %{tools_make} LDFLAGS="%{__global_ldflags} -L../../power/cpupower" INCLUDES="-I../../power/cpupower/lib"
3126+
# Build libcpupower Python bindings
3127+
%global libcpupower_python_bindings_make %{tools_make} LDFLAGS="-L%{buildroot}%{_libdir} -lcpupower"
31213128
%else
31223129
%global rtla_make %{tools_make}
31233130
%endif
@@ -3504,6 +3511,12 @@ mv cpupower.lang ../
35043511
popd
35053512
%endif
35063513
chmod 0755 %{buildroot}%{_libdir}/libcpupower.so*
3514+
%{log_msg "Build libcpupower Python bindings"}
3515+
pushd tools/power/cpupower/bindings/python
3516+
%{libcpupower_python_bindings_make}
3517+
%{log_msg "Install libcpupower Python bindings"}
3518+
%{make} INSTALL_DIR=$RPM_BUILD_ROOT%{python3_sitearch} install
3519+
popd
35073520
%endif
35083521
%ifarch x86_64
35093522
mkdir -p %{buildroot}%{_mandir}/man8
@@ -4138,6 +4151,9 @@ fi\
41384151
%{_includedir}/cpufreq.h
41394152
%{_includedir}/cpuidle.h
41404153
%{_includedir}/powercap.h
4154+
# libcpupower Python bindings
4155+
%{python3_sitearch}/_raw_pylibcpupower.so
4156+
%{python3_sitearch}/raw_pylibcpupower.py
41414157
%endif
41424158
%if %{with_ynl}
41434159
%{_libdir}/libynl*

0 commit comments

Comments
 (0)