linux-tools/linux-tools.spec

307 lines
7.5 KiB
RPMSpec
Raw Permalink Normal View History

%define MAJver %(echo %version | cut -d. -f1)
Name: linux-tools
Version: 6.6.4
Release: 1mamba
Summary: Tools provided with the Linux Kernel
Group: System/Kernel and Hardware
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.kernel.org/
Source0: https://cdn.kernel.org/pub/linux/kernel/v%{MAJver}.x/linux-%{version}.tar.xz
Source1: cpupower.service
Source2: cpupower.default
Source3: cpupower.systemd
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libcap-devel
BuildRequires: libdw-devel
BuildRequires: libelf-devel
BuildRequires: liblzma-devel
BuildRequires: libncurses-devel
BuildRequires: libnuma-devel
BuildRequires: libopenssl-devel
BuildRequires: libpci-devel
BuildRequires: libpython27-devel
BuildRequires: libpython311-devel
BuildRequires: libslang-devel
BuildRequires: libstdc++6-devel
BuildRequires: libtraceevent-devel
BuildRequires: libudev-devel
BuildRequires: libunwind-devel
BuildRequires: libwrap-devel
BuildRequires: libz-devel
BuildRequires: libzstd-devel
## AUTOBUILDREQ-END
BuildRequires: libtraceevent-devel
%description
Tools provided with the Linux Kernel.
%package -n cpupower
Summary: Linux kernel tool to examine and tune power saving related features of your processor
Group: System/Kernel and Hardware
Requires: libcpupower = %{?epoch:%epoch:}%{version}-%{release}
%description -n cpupower
Linux kernel tool to examine and tune power saving related features of your processor.
%package -n libcpupower
Summary: Shared library of cpupower tool
Group: System/Libraries
%description -n libcpupower
Shared library of cpupower tool.
%package -n libcpupower-devel
Summary: Development header files and static library for libcpupower
Group: Development/Libraries
Requires: libcpupower = %{?epoch:%epoch:}%{version}-%{release}
%description -n libcpupower-devel
Development header files and static library for libcpupower.
%package -n usbip
Summary: Linux kernel tool to sharing USB devices over IP network
Group: System/Kernel and Hardware
Requires: libusbip = %{?epoch:%epoch:}%{version}-%{release}
%description -n usbip
Linux kernel tool to sharing USB devices over IP network.
%package -n libusbip
Summary: Shared library of usbip tool
Group: System/Libraries
%description -n libusbip
Shared library of usbip tool.
%package -n libusbip-devel
Summary: Development header files and static library for libusbip
Group: Development/Libraries
Requires: libusbip = %{?epoch:%epoch:}%{version}-%{release}
%description -n libusbip-devel
Development header files and static library for libusbip.
%prep
%setup -q -n linux-%{version}
%build
cd tools/perf
%make -f Makefile.perf
cd ..
cd power/cpupower
%make VERSION=%{version}-%{release}
cd ../..
%ifarch x86_64 %{ix86}
cd power/x86/x86_energy_perf_policy
%make
cd ../turbostat
%make
cd ../../..
%endif
cd usb/usbip
# Fix gcc compilation
sed -i 's,-Wall -Werror -Wextra,-fcommon,' configure.ac
./autogen.sh
./configure --prefix=%{_prefix} --sbindir=%{_sbindir}
%make
cd ../..
cd thermal/tmon
%make
cd ../..
cd cgroup
%make
cd ..
cd hv
CFLAGS+=' -DKVP_SCRIPTS_PATH=\"/usr/lib/hyperv/kvp_scripts/\"' make
cd ..
#cd bpf
## doesn't compile when we don't first compile bpftool in its own directory and
## man pages require to be also launch from the subdirectory
#% make -C bpftool all doc
## runqslower, require kernel binary path to build, skip it
#% make -W runqslower
#cd ..
cd bootconfig
%make
cd ../..
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
cd tools/perf
%makeinstall -f Makefile.perf \
prefix=%{_prefix} \
lib=lib/perf \
perfexecdir=lib/perf \
EXTRA_CFLAGS=' -Wno-error=bad-function-cast -Wno-error=declaration-after-statement -Wno-error=switch-enum' \
NO_SDT=1 \
PYTHON=python \
PYTHON_CONFIG=python-config \
install-python_ext
cd ..
cd power/cpupower
%makeinstall \
sbindir=%{_bindir} \
libdir=%{_libdir} \
mandir=%{_mandir} \
docdir=%{_docdir}/cpupower \
install-man
# install startup scripts
install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/cpupower.service
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/default/cpupower
install -D -m0755 %{SOURCE3} %{buildroot}%{_systemd_util_dir}/scripts/cpupower
cd ../..
%ifarch x86_64 %{ix86}
cd power/x86/x86_energy_perf_policy
install -D -m0755 x86_energy_perf_policy %{buildroot}%{_bindir}/x86_energy_perf_policy
install -D -m0644 x86_energy_perf_policy.8 %{buildroot}%{_mandir}/man8/x86_energy_perf_policy.8
cd ../turbostat
%makeinstall
cd ../../..
%endif
cd usb/usbip
%makeinstall \
libdir=%{_libdir} \
cd ../..
cd thermal/tmon
%makeinstall INSTALL_ROOT=%{buildroot}
cd ../..
cd cgroup
install -Dm755 cgroup_event_listener %{buildroot}%{_bindir}/cgroup_event_listener
cd ../..
%find_lang cpupower
# Fix brp-strip
strip %{buildroot}%{_bindir}/trace
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%preun -n cpupower
%systemd_preun cpupower
:
%postun -n cpupower
%systemd_postun cpupower
:
%post -n cpupower
%systemd_post cpupower
:
%files
%defattr (-, root, root)
%{_sysconfdir}/bash_completion.d/perf
%{_bindir}/perf
%ifarch %{ix86} x86_64
%{_bindir}/perf-read-vdso32
%{_bindir}/x86_energy_perf_policy
%{_mandir}/man8/x86_energy_perf_policy.8*
%endif
%{_bindir}/trace
%{_includedir}/perf/perf_dlfilter.h
%dir %{_prefix}/lib/perf
%{_prefix}/lib/perf/*
%dir %{python3_sitearch}/perf-*-py%{python3_version}.egg-info
%{python3_sitearch}/perf-*-py%{python3_version}.egg-info/*
%{python3_sitearch}/perf.cpython-*.so
%{_mandir}/man1/perf*.1*
%{_datadir}/perf-core/strace/groups/file
%{_datadir}/perf-core/strace/groups/string
%{_bindir}/cgroup_event_listener
%{_bindir}/tmon
%ifarch %{ix86} x86_64
%{_bindir}/turbostat
%{_mandir}/man8/turbostat.8*
%endif
%{_datadir}/doc/perf-tip/tips.txt
%files -n cpupower -f cpupower.lang
%defattr (-, root, root)
%config(noreplace) %{_sysconfdir}/default/cpupower
%{_sysconfdir}/cpufreq-bench.conf
%{_bindir}/cpufreq-bench
%{_bindir}/cpufreq-bench_plot.sh
%{_bindir}/cpupower
%{_unitdir}/cpupower.service
%{_prefix}/lib/systemd/scripts/cpupower
%{_datadir}/bash-completion/completions/cpupower
%{_mandir}/man1/cpupower*.1*
%dir %{_docdir}/cpupower
%{_docdir}/cpupower/*
%files -n libcpupower
%defattr (-, root, root)
%{_libdir}/libcpupower.so.*
%files -n libcpupower-devel
%defattr (-, root, root)
%{_includedir}/cpufreq.h
%{_includedir}/cpuidle.h
%{_includedir}/powercap.h
%{_libdir}/libcpupower.so
%files -n usbip
%defattr (-, root, root)
%{_sbindir}/usbip
%{_sbindir}/usbipd
%{_mandir}/man8/usbip.8*
%{_mandir}/man8/usbipd.8*
%files -n libusbip
%defattr (-, root, root)
%{_libdir}/libusbip.so.*
%files -n libusbip-devel
%defattr (-, root, root)
%dir %{_includedir}/usbip
%{_includedir}/usbip/*.h
%{_libdir}/libusbip.a
%{_libdir}/libusbip.so
%changelog
* Sun Dec 03 2023 Automatic Build System <autodist@mambasoft.it> 6.6.4-1mamba
- automatic version update by autodist
* Wed Nov 29 2023 Automatic Build System <autodist@mambasoft.it> 6.6.3-1mamba
- automatic version update by autodist
* Mon Nov 20 2023 Automatic Build System <autodist@mambasoft.it> 6.6.2-1mamba
- automatic version update by autodist
* Wed Nov 08 2023 Automatic Build System <autodist@mambasoft.it> 6.6.1-1mamba
- automatic version update by autodist
* Thu Nov 02 2023 Automatic Build System <autodist@mambasoft.it> 6.6-1mamba
- automatic version update by autodist
* Mon Aug 07 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 6.1-1mamba
- package created