]> git.pld-linux.org Git - packages/kernel-tools.git/blobdiff - kernel-tools.spec
- binutils rebuild
[packages/kernel-tools.git] / kernel-tools.spec
index f54aca713f2098d20705c4c6803c74fac144707b..2ae8ac1105a0d5feb52cf1f7753946758b55a273 100644 (file)
@@ -3,7 +3,8 @@
 # - add -n python-perf?
 # - add bcond to disable building docs (perf docs)
 # - install of perf links perf binary again
-
+# - build runqslower (needs vmlinux with BPF section)
+#
 # Conditional build:
 %bcond_without verbose         # verbose build (V=1)
 %bcond_without cpupower        # cpupower tools
 %bcond_without gtk             # GTK+ 2.x perf support
 %bcond_without libunwind       # libunwind perf support
 %bcond_without multilib        # multilib perf support
+%bcond_with    runqslower      # runqslower bpf tool
 %bcond_without usbip           # usbip utils
 
-%ifarch x32
-%undefine      with_libunwind
-%endif
 %ifnarch %{x8664}
 %undefine      with_multilib
 %endif
 
-%define                basever         4.19
-%define                postver         .43
+%define                basever         5.10
+%define                postver         .1
 Summary:       Assortment of tools for the Linux kernel
 Summary(pl.UTF-8):     Zestaw narzędzi dla jądra Linuksa
 Name:          kernel-tools
 Version:       %{basever}%{postver}
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Applications/System
-Source0:       https://www.kernel.org/pub/linux/kernel/v4.x/linux-%{basever}.tar.xz
-# Source0-md5: 740a90cf810c2105df8ee12e5d0bb900
+Source0:       https://www.kernel.org/pub/linux/kernel/v5.x/linux-%{basever}.tar.xz
+# Source0-md5: 753adc474bf799d569dec4f165ed92c3
 Source1:       cpupower.service
 Source2:       cpupower.config
 %if "%{postver}" != ".0"
-Patch0:                https://www.kernel.org/pub/linux/kernel/v4.x/patch-%{version}.xz
-# Patch0-md5:  de59f616dfe3f55ee03ccb06e59481ef
+Patch0:                https://www.kernel.org/pub/linux/kernel/v5.x/patch-%{version}.xz
+# Patch0-md5:  33c2cbab3e136939c065e397879a8087
 %endif
 Patch1:                x32.patch
+Patch2:                regex.patch
 Patch3:                %{name}-perf-update.patch
-URL:           http://www.kernel.org/
+Patch4:                %{name}-perf-gtk2.patch
+Patch5:                %{name}-slang.patch
+URL:           https://www.kernel.org/
 BuildRequires: bison
 BuildRequires: docutils
 BuildRequires: flex
@@ -57,21 +59,29 @@ BuildRequires:      xz
 %if %{with perf}
 BuildRequires: asciidoc
 BuildRequires: audit-libs-devel
+BuildRequires: babeltrace-devel
 BuildRequires: binutils-devel >= 4:2.29
 BuildRequires: docbook-dtd45-xml
 BuildRequires: docbook-style-xsl
-BuildRequires: elfutils-devel
+BuildRequires: elfutils-devel >= 0.158
 %if %{with multilib}
 BuildRequires: gcc-multilib-32
 BuildRequires: gcc-multilib-x32
 %endif
+# for `btftool btf dump file ... format c` - requires vmlinux with BPF section
+%{?with_runqslower:BuildRequires:      kernel-vmlinux >= 5.?}
 %{?with_libunwind:BuildRequires:       libunwind-devel >= 0.99}
 BuildRequires: numactl-devel
+BuildRequires: openssl-devel
 BuildRequires: perl-devel >= 5.1
 BuildRequires: python-devel
 BuildRequires: rpm-pythonprov
 BuildRequires: slang-devel
 BuildRequires: xmlto
+BuildRequires: xz-devel
+BuildRequires: zlib-devel
+BuildRequires: zstd-devel
+# openscd? (CORESIGHT=1 for %{arm}?)
 %if %{with gtk}
 BuildRequires: gtk+2-devel >= 2.0
 %endif
@@ -89,7 +99,17 @@ BuildRoot:   %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 # otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
 %define                _enable_debug_packages  0
 
-%define                makeopts        CC="%{__cc}" %{?with_verbose:V=1}
+%ifarch ppc ppc64
+%define                makearch        powerpc
+%else
+%ifarch aarch64
+%define                makearch        arm64
+%else
+%define                makearch        %{_target_base_arch}
+%endif
+%endif
+
+%define                makeopts        ARCH=%{makearch} CC="%{__cc}" %{?with_verbose:V=1}
 
 %description
 This package contains the software from tools/ subdirectory from Linux
@@ -144,6 +164,22 @@ Development files for the cpupower library.
 %description cpupower-libs-devel -l pl.UTF-8
 Pliki programistyczne biblioteki cpupower.
 
+%package -n bash-completion-cpupower
+Summary:       Bash completion for cpupower tools
+Summary(pl.UTF-8):     Bashowe uzupełnianie parametrów dla poleceń cpupower
+Group:         Applications/Shells
+Requires:      %{name}-cpupower = %{version}-%{release}
+Requires:      bash-completion
+%if "%{_rpmversion}" >= "5"
+BuildArch:     noarch
+%endif
+
+%description -n bash-completion-cpupower
+Bash completion for cpupower tools.
+
+%description -n bash-completion-cpupower -l pl.UTF-8
+Bashowe uzupełnianie parametrów dla poleceń cpupower.
+
 %package hv
 Summary:       Hyper-V virtualization tools
 Summary(pl.UTF-8):     Narzędzia do wirtualizacji Hyper-V
@@ -376,7 +412,10 @@ cd linux-%{basever}
 %endif
 
 %patch1 -p1
+%patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %{__sed} -i -e '/^CFLAGS = /s/ -g / $(OPTFLAGS) /' tools/hv/Makefile
 %{__sed} -i -e '/^CFLAGS+=/s/ -O1 / $(OPTFLAGS) /' tools/thermal/tmon/Makefile
@@ -385,7 +424,21 @@ cd linux-%{basever}
 # don't rebuild on make install
 %{__sed} -i -e '/^\$(LIBBPF): FORCE/ s/FORCE$//' tools/bpf/bpftool/Makefile
 
+%if %{without runqslower}
+%{__sed} -i -e '/^all: / s/ runqslower//' \
+       -e '/^install: / s/ runqslower_install//' \
+       tools/bpf/Makefile
+%endif
+
 %build
+Wstringop=""
+Waddressof=""
+%if "%{cc_version}" >= "8"
+Wstringop="-Wno-error=stringop-truncation"
+%endif
+%if "%{cc_version}" >= "9"
+Waddressof="-Wno-error=address-of-packed-member"
+%endif
 cd linux-%{basever}
 
 # Simple Disk Sleep Monitor
@@ -396,7 +449,7 @@ cd linux-%{basever}
 # tools common (used eg. by tools/vm)
 %{__make} -C tools/lib/api \
        %{makeopts} \
-       EXTRA_CFLAGS="%{rpmcflags}"
+       EXTRA_CFLAGS="%{rpmcflags} $Wstringop"
 
 # lsgpio
 CFLAGS="%{rpmcflags}" \
@@ -406,42 +459,41 @@ CFLAGS="%{rpmcflags}" \
 # HyperV is Windows based, x86 specific
 %ifarch %{ix86} %{x8664} x32
 %{__make} -C tools/hv \
-       CC="%{__cc}" \
+       %{makeopts} \
        OPTFLAGS="%{rpmcflags}"
 %endif
 
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/iio -j1 \
-       CC="%{__cc}" \
-       %{?with_verbose:V=1}
+       %{makeopts}
 
 %{__make} -C tools/laptop/freefall \
-       CC="%{__cc}" \
+       %{makeopts} \
        CFLAGS="%{rpmcflags}"
 
 # make bpftool first, top-level bpf CFLAGS cause includes conflict
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/bpf/bpftool \
-       CC="%{__cc}" \
-       %{?with_verbose:V=1}
+       %{makeopts}
 
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/bpf \
-       CC="%{__cc}" \
+       %{makeopts} \
        EXTRA_CFLAGS="%{rpmcflags}" \
-       %{?with_verbose:V=1}
+       %{?with_runqslower:VMLINUX_BTF=$(rpm -ql kernel-vmlinux | head -n 1)}
 
 # perf
 %if %{with perf}
-%{__make} -C tools/perf all man \
+%{__make} -j1 -C tools/perf all man \
 %ifarch %{x8664}
        IS_X86_64=1 \
        %{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
 %endif
-       %{!?with_gtk:NO_GTK2=1} \
+       %{?with_gtk:GTK2=1} \
        %{!?with_libunwind:NO_LIBUNWIND=1} \
        %{makeopts} \
-       CFLAGS_OPTIMIZE="%{rpmcflags}" \
+       EXTRA_CFLAGS="%{rpmcflags}" \
+       VF=1 \
        WERROR=0 \
        prefix=%{_prefix} \
        perfexecdir=%{_datadir}/perf-core \
@@ -459,13 +511,13 @@ CFLAGS="%{rpmcflags}" \
 
 %ifarch %{ix86} x32
 %{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
-       CC="%{__cc}" \
+       %{makeopts} \
        CFLAGS="%{rpmcflags}"
 %endif
 
 %ifarch %{x8664} x32
 %{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
-       CC="%{__cc}" \
+       %{makeopts} \
        CFLAGS="%{rpmcflags}"
 %endif
 %endif
@@ -473,15 +525,15 @@ CFLAGS="%{rpmcflags}" \
 %ifarch %{ix86} %{x8664} x32
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/power/x86/x86_energy_perf_policy \
-       CC="%{__cc}"
+       %{makeopts}
 
 CFLAGS="%{rpmcflags}" \
 %{__make} -C tools/power/x86/turbostat \
-       CC="%{__cc}"
+       %{makeopts}
 %endif
 
 %{__make} -C tools/thermal/tmon \
-       CC="%{__cc}" \
+       %{makeopts} \
        OPTFLAGS="%{rpmcflags}"
 
 # usbip-utils
@@ -493,6 +545,7 @@ cd tools/usb/usbip
 %{__autoheader}
 %{__automake}
 %configure \
+       CFLAGS="%{rpmcflags} $Wstringop $Waddressof" \
        --disable-silent-rules \
        --with-usbids-dir=/lib/hwdata
 %{__make}
@@ -501,7 +554,7 @@ cd ../../..
 
 # page-types, slabinfo
 %{__make} -C tools/vm page-types slabinfo \
-       CC="%{__cc}" \
+       %{makeopts}
        CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
 
 # gen_init_cpio
@@ -522,7 +575,7 @@ cd linux-%{basever}
        CPUFREQ_BENCH=false
 
 %find_lang cpupower
-mv cpupower.lang ..
+%{__mv} cpupower.lang ..
 
 install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
@@ -537,20 +590,20 @@ install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_
 %endif
 
 %if %{with perf}
-%{__make} -C tools/perf -j1 install install-man \
+%{__make} -C tools/perf install install-man \
 %ifarch %{x8664}
        IS_X86_64=1 \
        %{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
 %endif
-       %{!?with_gtk:NO_GTK2=1} \
+       %{?with_gtk:GTK2=1} \
        %{!?with_libunwind:NO_LIBUNWIND=1} \
-       CC="%{__cc}" \
-       CFLAGS_OPTIMIZE="%{rpmcflags}" \
+       %{makeopts} \
+       EXTRA_CFLAGS="%{rpmcflags}" \
        WERROR=0 \
-       %{?with_verbose:V=1} \
        prefix=%{_prefix} \
        perfexecdir=%{_datadir}/perf-core \
        template_dir=%{_datadir}/perf-core/templates \
+       bash_compdir=%{bash_compdir} \
        lib=%{_lib} \
        DESTDIR=$RPM_BUILD_ROOT
 
@@ -611,7 +664,8 @@ install -d $RPM_BUILD_ROOT%{_mandir}/man8
 # gen_init_cpio
 install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
 
-rm -f $RPM_BUILD_ROOT%{_mandir}/man7/bpf-helpers.7*
+# packaged in man-pages (5.02)
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man7/bpf-helpers.7*
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -678,6 +732,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/cpufreq.h
 %{_includedir}/cpuidle.h
 
+%files -n bash-completion-cpupower
+%defattr(644,root,root,755)
+%{bash_compdir}/cpupower
+
 %ifarch %{ix86} %{x8664} x32
 %files hv
 %defattr(644,root,root,755)
This page took 0.047837 seconds and 4 git commands to generate.