]> git.pld-linux.org Git - packages/kernel-tools.git/blame - kernel-tools.spec
- added binutils2.35 patch (adjust Makefile for nm output change); release 3
[packages/kernel-tools.git] / kernel-tools.spec
CommitLineData
bb6b0f50
ER
1# TODO:
2# - redefine: PACKAGE_BUGREPORT=cpufreq@vger.kernel.org
b1f08c11 3# - add -n python-perf?
b1f08c11 4# - add bcond to disable building docs (perf docs)
a5af5310 5# - install of perf links perf binary again
c8c3bb5d
JB
6# - build runqslower (needs vmlinux with BPF section)
7#
49fba13a
ER
8# Conditional build:
9%bcond_without verbose # verbose build (V=1)
0a891de9 10%bcond_without cpupower # cpupower tools
db5f9ac9 11%bcond_without perf # perf tools
ae4c1fd4 12%bcond_without gtk # GTK+ 2.x perf support
5a8bbd03 13%bcond_without libunwind # libunwind perf support
a5af5310 14%bcond_without multilib # multilib perf support
c8c3bb5d 15%bcond_with runqslower # runqslower bpf tool
0a891de9 16%bcond_without usbip # usbip utils
5a8bbd03 17
a5af5310
JB
18%ifnarch %{x8664}
19%undefine with_multilib
20%endif
49fba13a 21
a02a39f3
JB
22%define basever 5.7
23%define postver .0
49fba13a 24Summary: Assortment of tools for the Linux kernel
bd620db3 25Summary(pl.UTF-8): Zestaw narzędzi dla jądra Linuksa
49fba13a
ER
26Name: kernel-tools
27Version: %{basever}%{postver}
c66e687f 28Release: 3
49fba13a 29License: GPL v2
fea1e605 30Group: Applications/System
57e0ffb5 31Source0: https://www.kernel.org/pub/linux/kernel/v5.x/linux-%{basever}.tar.xz
a02a39f3 32# Source0-md5: f63ed18935914e1ee3e04c2a0ce1ba3b
bedc6c43
JR
33Source1: cpupower.service
34Source2: cpupower.config
49fba13a 35%if "%{postver}" != ".0"
57e0ffb5 36Patch0: https://www.kernel.org/pub/linux/kernel/v5.x/patch-%{version}.xz
c8c3bb5d 37# Patch0-md5: 7055ff82e7e6a557c04831a191ed14b3
49fba13a 38%endif
bedc6c43 39Patch1: x32.patch
388d18e6 40Patch2: regex.patch
32b75768 41Patch3: %{name}-perf-update.patch
ba3b9a67 42Patch4: %{name}-perf-gtk2.patch
49505f6f
JB
43Patch5: %{name}-bpf-hashmap-upstream.patch
44Patch6: %{name}-bpf-hashmap.patch
45Patch7: %{name}-usbip-nocommon.patch
c66e687f 46Patch8: %{name}-binutils2.35.patch
ba3b9a67 47URL: https://www.kernel.org/
0a891de9 48BuildRequires: bison
89b3b11f 49BuildRequires: docutils
0a891de9 50BuildRequires: flex
4a7175d2 51BuildRequires: gettext-tools
4490164f 52BuildRequires: linux-libc-headers >= 7:4.12
0a891de9 53BuildRequires: ncurses-devel
97b9d37b 54BuildRequires: ncurses-ext-devel
9596c3d3 55BuildRequires: pciutils-devel
0a891de9 56BuildRequires: pkgconfig
605beaf9
AM
57BuildRequires: python3
58BuildRequires: python3-modules
c5a822e3 59BuildRequires: rpmbuild(macros) >= 1.673
49fba13a
ER
60BuildRequires: tar >= 1:1.22
61BuildRequires: xz
fea1e605
ER
62%if %{with perf}
63BuildRequires: asciidoc
52583efa 64BuildRequires: audit-libs-devel
ba3b9a67 65BuildRequires: babeltrace-devel
ea7d139b 66BuildRequires: binutils-devel >= 4:2.29
a8b28c3a 67BuildRequires: docbook-dtd45-xml
52583efa 68BuildRequires: docbook-style-xsl
ba3b9a67 69BuildRequires: elfutils-devel >= 0.158
a5af5310
JB
70%if %{with multilib}
71BuildRequires: gcc-multilib-32
72BuildRequires: gcc-multilib-x32
73%endif
c8c3bb5d
JB
74# for `btftool btf dump file ... format c` - requires vmlinux with BPF section
75%{?with_runqslower:BuildRequires: kernel-vmlinux >= 5.?}
5a8bbd03 76%{?with_libunwind:BuildRequires: libunwind-devel >= 0.99}
60ccbbd3 77BuildRequires: numactl-devel
ba3b9a67 78BuildRequires: openssl-devel
52583efa 79BuildRequires: perl-devel >= 5.1
52583efa 80BuildRequires: python-devel
fea1e605 81BuildRequires: rpm-pythonprov
a1c57a8e 82BuildRequires: slang-devel
fea1e605 83BuildRequires: xmlto
ba3b9a67
JB
84BuildRequires: xz-devel
85BuildRequires: zlib-devel
86BuildRequires: zstd-devel
87# openscd? (CORESIGHT=1 for %{arm}?)
a8b28c3a
ER
88%if %{with gtk}
89BuildRequires: gtk+2-devel >= 2.0
a8b28c3a 90%endif
fea1e605 91%endif
0a891de9
JB
92%if %{with usbip}
93BuildRequires: autoconf >= 2.59
94BuildRequires: automake >= 1:1.9
95BuildRequires: gcc >= 6:4.0
96BuildRequires: libtool >= 2:2
97BuildRequires: libwrap-devel
98BuildRequires: udev-devel
99%endif
49fba13a
ER
100BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101
eb373af4
AM
102# otherwise /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
103%define _enable_debug_packages 0
104
60972f76
ER
105%define makeopts CC="%{__cc}" %{?with_verbose:V=1}
106
49fba13a 107%description
bd620db3
JB
108This package contains the software from tools/ subdirectory from Linux
109kernel source and the supporting documentation.
110
111%description -l pl.UTF-8
112Ten pakiet zawiera oprogramowanie z podkatalogu tools/ ze źródeł jądra
113Linuksa oraz związaną z nim dokumentację.
49fba13a 114
4bc5704a
JK
115%package cpupower
116Summary: cpupower - Shows and sets processor power related values
bd620db3 117Summary(pl.UTF-8): cpupower - wyświetlanie i ustawianie wartości związanych z zużyciem energii przez procesor
4bc5704a 118Group: Applications/System
f57fcd71 119Requires(post,preun,postun): systemd-units >= 38
91fd1f55 120Requires: %{name}-cpupower-libs = %{version}-%{release}
f57fcd71 121Requires: systemd-units >= 0.38
2bd21e06 122Provides: cpupowerutils = 1:009-0.6.p1
2bd21e06
ER
123Obsoletes: cpupowerutils < 1:009-0.6.p1
124Obsoletes: cpuspeed < 1:1.5-16
4bc5704a
JK
125
126%description cpupower
60972f76
ER
127cpupower is a collection of tools to examine and tune power saving
128related features of your processor.
4bc5704a 129
bd620db3
JB
130%description cpupower -l pl.UTF-8
131cpupower to zbiór narzędzi do sprawdzania i ustawiania opcji procesora
132związanych z oszczędzaniem energii.
133
4bc5704a 134%package cpupower-libs
bd620db3
JB
135Summary: cpupower library
136Summary(pl.UTF-8): Biblioteka cpupower
49fba13a
ER
137Group: Libraries
138
4bc5704a 139%description cpupower-libs
bd620db3
JB
140cpupower library.
141
142%description cpupower-libs -l pl.UTF-8
143Biblioteka cpupower.
49fba13a 144
4bc5704a 145%package cpupower-libs-devel
bd620db3
JB
146Summary: Development files for the cpupower library
147Summary(pl.UTF-8): Pliki programistyczne biblioteki cpupower
49fba13a 148Group: Development/Libraries
178c4b31 149Requires: %{name}-cpupower-libs = %{version}-%{release}
49fba13a 150Provides: cpupowerutils-devel = 1:009-0.6.p1
49fba13a 151Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
08be99c5 152Conflicts: cpufrequtils-devel
49fba13a 153
4bc5704a 154%description cpupower-libs-devel
bd620db3
JB
155Development files for the cpupower library.
156
157%description cpupower-libs-devel -l pl.UTF-8
158Pliki programistyczne biblioteki cpupower.
49fba13a 159
388d18e6
JR
160%package -n bash-completion-cpupower
161Summary: Bash completion for cpupower tools
162Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla poleceń cpupower
163Group: Applications/Shells
164Requires: %{name}-cpupower = %{version}-%{release}
165Requires: bash-completion
166%if "%{_rpmversion}" >= "5"
167BuildArch: noarch
168%endif
169
170%description -n bash-completion-cpupower
171Bash completion for cpupower tools.
172
173%description -n bash-completion-cpupower -l pl.UTF-8
174Bashowe uzupełnianie parametrów dla poleceń cpupower.
175
0a891de9
JB
176%package hv
177Summary: Hyper-V virtualization tools
178Summary(pl.UTF-8): Narzędzia do wirtualizacji Hyper-V
179Group: Applications/System
180
181%description hv
182Hyper-V virtualization tools.
183
184%description hv -l pl.UTF-8
185Narzędzia do wirtualizacji Hyper-V.
186
ae4c1fd4
JB
187%package perf
188Summary: perf profiler tool
189Summary(pl.UTF-8): Narzędzie profilujące perf
fea1e605 190Group: Applications/System
9efc8fed 191Suggests: binutils
ae4c1fd4
JB
192Obsoletes: perf-core
193Obsoletes: perf-slang
fea1e605 194
ae4c1fd4 195%description perf
fea1e605
ER
196Perf is a profiler tool for Linux 2.6+ based systems that abstracts
197away CPU hardware differences in Linux performance measurements and
198presents a simple commandline interface. Perf is based on the
199perf_events interface exported by recent versions of the Linux kernel.
200
ae4c1fd4 201This package contains core files, scripts and text interface (TUI).
db5f9ac9 202
ae4c1fd4 203%description perf -l pl.UTF-8
db5f9ac9
JB
204Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
205odseparowujące od różnic sprzętowych między pomiarami wydajności w
206zależności od procesora oraz udostępniające prosty interfejs linii
207poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
208przez nowe wersje jądra Linuksa.
209
ae4c1fd4
JB
210Ten pakiet zawiera podstawowe pliki, skrypty oraz interfejs tekstowy
211(TUI).
db5f9ac9 212
0a3bb9dd 213%package perf-vdso32
dda20c35
JB
214Summary: perf profiler tool - VDSO 32-bit ABI reader
215Summary(pl.UTF-8): Narzędzie profilujące perf - odczyt VDSO dla ABI 32-bitowego
0a3bb9dd
JR
216Group: Applications/System
217Requires: %{name}-perf = %{version}-%{release}
218
219%description perf-vdso32
220Perf is a profiler tool for Linux 2.6+ based systems that abstracts
221away CPU hardware differences in Linux performance measurements and
222presents a simple commandline interface. Perf is based on the
223perf_events interface exported by recent versions of the Linux kernel.
224
225This package contains perf-read-vdso32 tool for reading the 32-bit
226compatibility VDSO in 64-bit mode.
227
dda20c35
JB
228%description perf-vdso32 -l pl.UTF-8
229Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
230odseparowujące od różnic sprzętowych między pomiarami wydajności w
231zależności od procesora oraz udostępniające prosty interfejs linii
232poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
233przez nowe wersje jądra Linuksa.
234
235Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
236binariów 32-bitowych w trybie 64-bitowym.
237
0a3bb9dd 238%package perf-vdsox32
dda20c35
JB
239Summary: perf profiler tool - VDSO x32 ABI reader
240Summary(pl.UTF-8): Narzędzie profilujące perf - odczyt VDSO dla ABI x32
0a3bb9dd
JR
241Group: Applications/System
242Requires: %{name}-perf = %{version}-%{release}
243
244%description perf-vdsox32
245Perf is a profiler tool for Linux 2.6+ based systems that abstracts
246away CPU hardware differences in Linux performance measurements and
247presents a simple commandline interface. Perf is based on the
248perf_events interface exported by recent versions of the Linux kernel.
249
250This package contains perf-read-vdso32 tool for reading the x32 mode
25132-bit compatibility VDSO in 64-bit mode.
252
dda20c35
JB
253%description perf-vdsox32 -l pl.UTF-8
254Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
255odseparowujące od różnic sprzętowych między pomiarami wydajności w
256zależności od procesora oraz udostępniające prosty interfejs linii
257poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
258przez nowe wersje jądra Linuksa.
259
260Ten pakiet zawiera narzędzie perf-read-vdso32 do odczytu VDSO dla
261binariów ABI x32 w trybie 64-bitowym.
262
db5f9ac9 263%package perf-gtk
ae4c1fd4
JB
264Summary: perf profiler tool (GTK+ 2 GUI)
265Summary(pl.UTF-8): Narzędzie profilujące perf (interfejs graficzny GTK+ 2)
db5f9ac9 266Group: X11/Applications
dad8cd2d 267Requires: %{name}-perf = %{version}-%{release}
db5f9ac9
JB
268
269%description perf-gtk
270Perf is a profiler tool for Linux 2.6+ based systems that abstracts
271away CPU hardware differences in Linux performance measurements and
272presents a simple commandline interface. Perf is based on the
273perf_events interface exported by recent versions of the Linux kernel.
274
ae4c1fd4 275This package contains GTK+ 2 based GUI.
db5f9ac9
JB
276
277%description perf-gtk -l pl.UTF-8
278Perf to narzędzie profilujące dla systemów opartych na Linuksie 2.6+,
279odseparowujące od różnic sprzętowych między pomiarami wydajności w
280zależności od procesora oraz udostępniające prosty interfejs linii
281poleceń. Perf jest oparty na interfejsie perf_events eksportowanym
282przez nowe wersje jądra Linuksa.
283
ae4c1fd4 284Ten pakiet zawiera graficzny interfejs oparty na GTK+ 2.
db5f9ac9 285
db5f9ac9
JB
286%package -n bash-completion-perf
287Summary: Bash completion for perf command
288Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla polecenia perf
289Group: Applications/Shells
c5a822e3 290Requires: %{name}-perf = %{version}-%{release}
db5f9ac9 291Requires: bash-completion
741b96de
ER
292%if "%{_rpmversion}" >= "5"
293BuildArch: noarch
294%endif
db5f9ac9
JB
295
296%description -n bash-completion-perf
297Bash completion for perf command.
298
299%description -n bash-completion-perf -l pl.UTF-8
300Bashowe uzupełnianie parametrów dla polecenia perf.
301
c5a822e3
JB
302%package -n bash-completion-kernel-tools
303Summary: Bash completion for kernel-tools commands
304Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla poleceń kernel-tools
305Group: Applications/Shells
306Requires: %{name} = %{version}-%{release}
307Requires: bash-completion >= 2.0
308%if "%{_rpmversion}" >= "5"
309BuildArch: noarch
310%endif
311
312%description -n bash-completion-kernel-tools
313Bash completion for kernel-tools commands (currently bpftool).
314
315%description -n bash-completion-kernel-tools -l pl.UTF-8
316Bashowe uzupełnianie parametrów dla poleceń kernel-tools (obecnie
317bpftool).
318
0a891de9
JB
319%package -n usbip
320Summary: USB device sharing system over IP network
321Summary(pl.UTF-8): System współdzielenia urządzeń USB po sieci IP
322Group: Networking/Utilities
323Requires: usbip-libs = %{version}-%{release}
324# /lib/hwdata/usb.ids (note: only uncompressed file supported)
325Requires: hwdata >= 0.243-2
326
327%description -n usbip
328The USB/IP Project aims to develop a general USB device sharing system
329over IP network. To share USB devices between computers with their
330full functionality, USB/IP encapsulates "USB requests" into IP packets
331and transmits them between computers. Original USB device drivers and
332applications can be also used for remote USB devices without any
333modification of them. A computer can use remote USB devices as if they
334were directly attached; for example, we can:
335 - USB storage devices: fdisk, mkfs, mount/umount, file operations,
336 play a DVD movie and record a DVD-R media.
337 - USB keyboards and USB mice: use with Linux console and X Window
338 System.
339 - USB webcams and USB speakers: view webcam, capture image data and
340 play some music.
341 - USB printers, USB scanners, USB serial converters and USB Ethernet
342 interfaces: ok, use fine.
343
344%description -n usbip -l pl.UTF-8
345Projekt USB/IP ma na celu stworzenie ogólnego systemu współdzielenia
346urządzeń USB po sieci IP. W celu współdzielenia urządzeń USB między
347komputerami z zachowaniem pełnej funkcjonalności, USB/IP obudowuje
348żądania SUB w pakiety IP i przesyła je między komputerami. Oryginalne
349sterowniki urządzeń USB oraz aplikacje mogą być używane bez żadnych
350modyfikacji. Komputer może wykorzystywać zdaln urządzenia USB tak,
351jakby były podłączone bezpośrednio. Przykładowe możliwości:
352 - urządzenia USB do przechowywania danych: można używać programów
353 fdisk, mkfs, mount/umount, operacji na plikach, odtwarzać filmy
354 DVD oraz nagrywać nośniki DVD-R
355 - klawiatury i myszy USB: można ich używać na linuksowej konsoli oraz
356 w systemie X Window
357 - kamery i głośniki USB: można oglądać obraz z kamery, robić zdjęcia
358 i odtwarzać muzykę
359 - drukarki, skanery, konwertery portów szeregowych oraz interfejsy
360 sieciowe USB: można ich normalnie używać
361
362%package -n usbip-libs
363Summary: USB/IP library
364Summary(pl.UTF-8): Biblioteka USB/IP
365Group: Libraries
366
367%description -n usbip-libs
368USB over IP library.
369
370%description -n usbip-libs -l pl.UTF-8
371Biblioteka USB po IP.
372
373%package -n usbip-devel
374Summary: Header files for usbip library
375Summary(pl.UTF-8): Pliki nagłówkowe biblioteki usbip
376Group: Development/Libraries
377Requires: usbip-libs = %{version}-%{release}
378
379%description -n usbip-devel
380This package contains the header files needed to develop programs
381which make use of USB/IP.
382
383%description -n usbip-devel -l pl.UTF-8
384Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów
385wykorzystujących USB/IP.
386
387%package -n usbip-static
388Summary: Static usbip library
389Summary(pl.UTF-8): Statyczna biblioteka usbip
390Group: Development/Libraries
391Requires: usbip-devel = %{version}-%{release}
392
393%description -n usbip-static
394Static usbip library.
395
396%description -n usbip-static -l pl.UTF-8
397Statyczna biblioteka usbip.
398
49fba13a
ER
399%prep
400%setup -qc
401cd linux-%{basever}
402
403%if "%{postver}" != ".0"
404%patch0 -p1
405%endif
406
bedc6c43 407%patch1 -p1
388d18e6 408%patch2 -p1
32b75768 409%patch3 -p1
ba3b9a67 410%patch4 -p1
a02a39f3 411%patch5 -p1
da263bb0 412%patch6 -p1
49505f6f 413%patch7 -p1
c66e687f 414%patch8 -p1
bedc6c43 415
0a891de9
JB
416%{__sed} -i -e '/^CFLAGS = /s/ -g / $(OPTFLAGS) /' tools/hv/Makefile
417%{__sed} -i -e '/^CFLAGS+=/s/ -O1 / $(OPTFLAGS) /' tools/thermal/tmon/Makefile
c5a822e3 418%{__sed} -i -e 's#libexec/perf-core#share/perf-core#g' tools/perf/Makefile.config
eb373af4 419
e76f6fde
JB
420# don't rebuild on make install
421%{__sed} -i -e '/^\$(LIBBPF): FORCE/ s/FORCE$//' tools/bpf/bpftool/Makefile
422
c8c3bb5d
JB
423%if %{without runqslower}
424%{__sed} -i -e '/^all: / s/ runqslower//' \
425 -e '/^install: / s/ runqslower_install//' \
426 tools/bpf/Makefile
427%endif
428
49fba13a 429%build
ba3b9a67
JB
430Wstringop=""
431Waddressof=""
432%if "%{cc_version}" >= "8"
433Wstringop="-Wno-error=stringop-truncation"
434%endif
435%if "%{cc_version}" >= "9"
436Waddressof="-Wno-error=address-of-packed-member"
437%endif
49fba13a
ER
438cd linux-%{basever}
439
b1f08c11 440# Simple Disk Sleep Monitor
2c8f0d44
JR
441%{__make} -C tools/laptop/dslm \
442 %{makeopts} \
443 EXTRA_CFLAGS="%{rpmcflags}"
b1f08c11 444
0a891de9
JB
445# tools common (used eg. by tools/vm)
446%{__make} -C tools/lib/api \
51feff82 447 %{makeopts} \
ba3b9a67 448 EXTRA_CFLAGS="%{rpmcflags} $Wstringop"
0a891de9
JB
449
450# lsgpio
451CFLAGS="%{rpmcflags}" \
51feff82
JB
452%{__make} -C tools/gpio -j1 \
453 %{makeopts}
0a891de9
JB
454
455# HyperV is Windows based, x86 specific
456%ifarch %{ix86} %{x8664} x32
457%{__make} -C tools/hv \
458 CC="%{__cc}" \
459 OPTFLAGS="%{rpmcflags}"
460%endif
461
462CFLAGS="%{rpmcflags}" \
d4e17d6f 463%{__make} -C tools/iio -j1 \
e76f6fde
JB
464 CC="%{__cc}" \
465 %{?with_verbose:V=1}
0a891de9
JB
466
467%{__make} -C tools/laptop/freefall \
468 CC="%{__cc}" \
469 CFLAGS="%{rpmcflags}"
470
ffa90917
JB
471# make bpftool first, top-level bpf CFLAGS cause includes conflict
472CFLAGS="%{rpmcflags}" \
473%{__make} -C tools/bpf/bpftool \
474 CC="%{__cc}" \
475 %{?with_verbose:V=1}
476
0a891de9 477CFLAGS="%{rpmcflags}" \
c5a822e3 478%{__make} -C tools/bpf \
e76f6fde
JB
479 CC="%{__cc}" \
480 EXTRA_CFLAGS="%{rpmcflags}" \
c8c3bb5d 481 %{?with_runqslower:VMLINUX_BTF=$(rpm -ql kernel-vmlinux | head -n 1)} \
e76f6fde 482 %{?with_verbose:V=1}
0a891de9
JB
483
484# perf
485%if %{with perf}
388d18e6 486%{__make} -j1 -C tools/perf all man \
0a891de9
JB
487%ifarch %{x8664}
488 IS_X86_64=1 \
489 %{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
490%endif
491 %{!?with_gtk:NO_GTK2=1} \
492 %{!?with_libunwind:NO_LIBUNWIND=1} \
493 %{makeopts} \
494 CFLAGS_OPTIMIZE="%{rpmcflags}" \
495 WERROR=0 \
496 prefix=%{_prefix} \
497 perfexecdir=%{_datadir}/perf-core \
498 lib=%{_lib} \
499 template_dir=%{_datadir}/perf-core/templates
500%endif
501
49fba13a 502# cpupower
0a891de9 503%if %{with cpupower}
49fba13a 504%{__make} -C tools/power/cpupower \
60972f76 505 %{makeopts} \
fb1ff9fc
JB
506 CPUFREQ_BENCH=false \
507 OPTIMIZATION="%{rpmcflags}" \
508 STRIPCMD=true
49fba13a 509
bedc6c43 510%ifarch %{ix86} x32
49fba13a 511%{__make} -C tools/power/cpupower/debug/i386 centrino-decode powernow-k8-decode \
fb1ff9fc
JB
512 CC="%{__cc}" \
513 CFLAGS="%{rpmcflags}"
49fba13a
ER
514%endif
515
bedc6c43 516%ifarch %{x8664} x32
49fba13a 517%{__make} -C tools/power/cpupower/debug/x86_64 centrino-decode powernow-k8-decode \
fb1ff9fc
JB
518 CC="%{__cc}" \
519 CFLAGS="%{rpmcflags}"
49fba13a 520%endif
0a891de9 521%endif
49fba13a 522
bedc6c43 523%ifarch %{ix86} %{x8664} x32
ea7d139b 524CFLAGS="%{rpmcflags}" \
49fba13a 525%{__make} -C tools/power/x86/x86_energy_perf_policy \
ea7d139b
JR
526 CC="%{__cc}"
527
4b352448 528CFLAGS="%{rpmcflags}" \
49fba13a 529%{__make} -C tools/power/x86/turbostat \
4b352448 530 CC="%{__cc}"
49fba13a
ER
531%endif
532
0a891de9 533%{__make} -C tools/thermal/tmon \
dbaf19f8 534 CC="%{__cc}" \
0a891de9
JB
535 OPTFLAGS="%{rpmcflags}"
536
537# usbip-utils
538%if %{with usbip}
539cd tools/usb/usbip
540%{__libtoolize}
541%{__aclocal}
542%{__autoconf}
543%{__autoheader}
544%{__automake}
545%configure \
ba3b9a67 546 CFLAGS="%{rpmcflags} $Wstringop $Waddressof" \
0a891de9
JB
547 --disable-silent-rules \
548 --with-usbids-dir=/lib/hwdata
549%{__make}
550cd ../../..
551%endif
dbaf19f8 552
f111fe43
JK
553# page-types, slabinfo
554%{__make} -C tools/vm page-types slabinfo \
701b458f 555 CC="%{__cc}" \
f111fe43 556 CFLAGS="%{rpmcflags} -Wall -Wextra -I../lib"
701b458f 557
dd28be58
JK
558# gen_init_cpio
559%{__make} -C usr gen_init_cpio \
60972f76 560 %{makeopts} \
fb1ff9fc 561 CFLAGS="%{rpmcflags}"
dd28be58 562
49fba13a
ER
563%install
564rm -rf $RPM_BUILD_ROOT
b1f08c11 565
49fba13a
ER
566cd linux-%{basever}
567
0a891de9 568%if %{with cpupower}
bd620db3 569%{__make} -C tools/power/cpupower install \
49fba13a
ER
570 DESTDIR=$RPM_BUILD_ROOT \
571 libdir=%{_libdir} \
572 mandir=%{_mandir} \
573 CPUFREQ_BENCH=false
574
575%find_lang cpupower
ba3b9a67 576%{__mv} cpupower.lang ..
49fba13a 577
f57fcd71
ER
578install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{systemdunitdir}}
579cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/cpupower.service
580cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cpupower
581
bedc6c43 582%ifarch %{ix86} x32
701b458f 583install -p tools/power/cpupower/debug/i386/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
49fba13a 584%endif
bedc6c43 585%ifarch %{x8664} x32
701b458f 586install -p tools/power/cpupower/debug/x86_64/{centrino,powernow-k8}-decode $RPM_BUILD_ROOT%{_bindir}
49fba13a 587%endif
49fba13a 588%endif
fea1e605
ER
589
590%if %{with perf}
388d18e6 591%{__make} -C tools/perf install install-man \
4dfb9dde
JR
592%ifarch %{x8664}
593 IS_X86_64=1 \
a5af5310 594 %{!?with_multilib:NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1} \
4dfb9dde 595%endif
ae4c1fd4 596 %{!?with_gtk:NO_GTK2=1} \
5a8bbd03 597 %{!?with_libunwind:NO_LIBUNWIND=1} \
fea1e605 598 CC="%{__cc}" \
fb1ff9fc 599 CFLAGS_OPTIMIZE="%{rpmcflags}" \
6e9d46c8 600 WERROR=0 \
fea1e605
ER
601 %{?with_verbose:V=1} \
602 prefix=%{_prefix} \
603 perfexecdir=%{_datadir}/perf-core \
604 template_dir=%{_datadir}/perf-core/templates \
388d18e6 605 bash_compdir=%{bash_compdir} \
4f4642fc 606 lib=%{_lib} \
fea1e605 607 DESTDIR=$RPM_BUILD_ROOT
db5f9ac9
JB
608
609%py_comp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
610%py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
a8b28c3a 611
4b352448 612%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
49fba13a
ER
613%endif
614
0a891de9
JB
615%if %{with usbip}
616%{__make} -C tools/usb/usbip install \
617 DESTDIR=$RPM_BUILD_ROOT
618
619%{__rm} $RPM_BUILD_ROOT%{_libdir}/libusbip.la
620%endif
621
622install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8}
623
2c8f0d44 624install -p tools/laptop/dslm/dslm $RPM_BUILD_ROOT%{_sbindir}
0a891de9
JB
625
626install -p tools/gpio/lsgpio $RPM_BUILD_ROOT%{_bindir}
627
628%ifarch %{ix86} %{x8664} x32
629install -p tools/hv/hv_{fcopy,kvp,vss}_daemon $RPM_BUILD_ROOT%{_sbindir}
630# TODO: PLD-specific hv_get_dhcp_info,hv_get_dns_info,hv_set_ifconfig
631%{__sed} -e '1s,/usr/bin/env python,%{__python},' tools/hv/lsvmbus >$RPM_BUILD_ROOT%{_bindir}/lsvmbus
632chmod 755 $RPM_BUILD_ROOT%{_bindir}/lsvmbus
633%endif
634
51feff82 635install -p tools/iio/{iio_event_monitor,iio_generic_buffer,lsiio} $RPM_BUILD_ROOT%{_bindir}
0a891de9
JB
636
637install -p tools/laptop/freefall/freefall $RPM_BUILD_ROOT%{_sbindir}
638
c5a822e3
JB
639%{__make} -C tools/bpf install \
640 prefix=$RPM_BUILD_ROOT%{_prefix} \
e76f6fde
JB
641 bash_compdir=$RPM_BUILD_ROOT%{bash_compdir} \
642 %{?with_verbose:V=1}
c5a822e3 643%{__make} -C tools/bpf/bpftool doc-install \
e76f6fde
JB
644 prefix=$RPM_BUILD_ROOT%{_prefix} \
645 mandir=$RPM_BUILD_ROOT%{_mandir} \
646 %{?with_verbose:V=1}
0a891de9
JB
647
648install -p tools/thermal/tmon/tmon $RPM_BUILD_ROOT%{_bindir}
649cp -p tools/thermal/tmon/tmon.8 $RPM_BUILD_ROOT%{_mandir}/man8
650
651install -p tools/vm/slabinfo $RPM_BUILD_ROOT%{_bindir}
652install -p tools/vm/page-types $RPM_BUILD_ROOT%{_sbindir}
653
654%ifarch %{ix86} %{x8664} x32
655install -d $RPM_BUILD_ROOT%{_mandir}/man8
656%{__make} -C tools/power/x86/x86_energy_perf_policy install \
657 DESTDIR=$RPM_BUILD_ROOT
658
659%{__make} -C tools/power/x86/turbostat install \
660 DESTDIR=$RPM_BUILD_ROOT
661%endif
662
dd28be58 663# gen_init_cpio
60972f76 664install -p usr/gen_init_cpio $RPM_BUILD_ROOT%{_bindir}/gen_init_cpio
dd28be58 665
ba3b9a67
JB
666# packaged in man-pages (5.02)
667%{__rm} $RPM_BUILD_ROOT%{_mandir}/man7/bpf-helpers.7*
0813123e 668
49fba13a
ER
669%clean
670rm -rf $RPM_BUILD_ROOT
671
4bc5704a
JK
672%post cpupower-libs -p /sbin/ldconfig
673%postun cpupower-libs -p /sbin/ldconfig
49fba13a 674
f57fcd71
ER
675%post cpupower
676%systemd_post cpupower.service
677
678%preun cpupower
679%systemd_preun cpupower.service
680
681%postun cpupower
682%systemd_reload
683
0a891de9
JB
684%post -n usbip-libs -p /sbin/ldconfig
685%postun -n usbip-libs -p /sbin/ldconfig
686
4bc5704a 687%files
49fba13a 688%defattr(644,root,root,755)
0a891de9
JB
689%attr(755,root,root) %{_bindir}/bpf_asm
690%attr(755,root,root) %{_bindir}/bpf_dbg
691%attr(755,root,root) %{_bindir}/bpf_jit_disasm
701b458f 692%attr(755,root,root) %{_bindir}/gen_init_cpio
0a891de9
JB
693%attr(755,root,root) %{_bindir}/iio_event_monitor
694%attr(755,root,root) %{_bindir}/iio_generic_buffer
0a891de9
JB
695%attr(755,root,root) %{_bindir}/lsgpio
696%attr(755,root,root) %{_bindir}/lsiio
701b458f 697%attr(755,root,root) %{_bindir}/slabinfo
0a891de9 698%attr(755,root,root) %{_bindir}/tmon
c5a822e3 699%attr(755,root,root) %{_sbindir}/bpftool
b1f08c11 700%attr(755,root,root) %{_sbindir}/dslm
0a891de9 701%attr(755,root,root) %{_sbindir}/freefall
f111fe43 702%attr(755,root,root) %{_sbindir}/page-types
c5a822e3 703%{_mandir}/man8/bpftool*.8*
0a891de9 704%{_mandir}/man8/tmon.8*
bedc6c43 705%ifarch %{ix86} %{x8664} x32
49fba13a
ER
706%attr(755,root,root) %{_bindir}/centrino-decode
707%attr(755,root,root) %{_bindir}/powernow-k8-decode
708%endif
bedc6c43 709%ifarch %{ix86} %{x8664} x32
49fba13a
ER
710%attr(755,root,root) %{_bindir}/turbostat
711%attr(755,root,root) %{_bindir}/x86_energy_perf_policy
bd620db3
JB
712%{_mandir}/man8/turbostat.8*
713%{_mandir}/man8/x86_energy_perf_policy.8*
49fba13a
ER
714%endif
715
4bc5704a
JK
716%files cpupower -f cpupower.lang
717%defattr(644,root,root,755)
718%attr(755,root,root) %{_bindir}/cpupower
bd620db3 719%{_mandir}/man1/cpupower*.1*
f57fcd71
ER
720%{systemdunitdir}/cpupower.service
721%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cpupower
4bc5704a
JK
722
723%files cpupower-libs
49fba13a
ER
724%defattr(644,root,root,755)
725%attr(755,root,root) %{_libdir}/libcpupower.so.*.*.*
bd620db3 726%attr(755,root,root) %ghost %{_libdir}/libcpupower.so.0
49fba13a 727
4bc5704a 728%files cpupower-libs-devel
49fba13a 729%defattr(644,root,root,755)
bd620db3 730%attr(755,root,root) %{_libdir}/libcpupower.so
49fba13a 731%{_includedir}/cpufreq.h
dbaf19f8 732%{_includedir}/cpuidle.h
fea1e605 733
388d18e6
JR
734%files -n bash-completion-cpupower
735%defattr(644,root,root,755)
736%{bash_compdir}/cpupower
737
0a891de9
JB
738%ifarch %{ix86} %{x8664} x32
739%files hv
740%defattr(644,root,root,755)
741# TODO: PLDify these scripts and move to bindir
742%doc linux-%{basever}/tools/hv/hv_{get_dhcp_info,get_dns_info,set_ifconfig}.sh
743%attr(755,root,root) %{_bindir}/lsvmbus
744%attr(755,root,root) %{_sbindir}/hv_fcopy_daemon
745%attr(755,root,root) %{_sbindir}/hv_kvp_daemon
746%attr(755,root,root) %{_sbindir}/hv_vss_daemon
747%endif
748
fea1e605 749%if %{with perf}
ae4c1fd4 750%files perf
fea1e605 751%defattr(644,root,root,755)
35be6466 752%attr(755,root,root) %{_bindir}/perf
ae4c1fd4 753%attr(755,root,root) %{_bindir}/trace
fea1e605 754%{_mandir}/man1/perf*.1*
c5a822e3 755%{_docdir}/perf-tip
fea1e605
ER
756%dir %{_datadir}/perf-core
757%attr(755,root,root) %{_datadir}/perf-core/perf-archive
4f4642fc 758%attr(755,root,root) %{_datadir}/perf-core/perf-with-kcore
c5a822e3 759%{_datadir}/perf-core/strace
fea1e605
ER
760
761%dir %{_datadir}/perf-core/scripts
762
763%dir %{_datadir}/perf-core/scripts/perl
764%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util
765%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib
766%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
767%dir %{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
768%{_datadir}/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/*.pm
769%dir %{_datadir}/perf-core/scripts/perl/bin
770%attr(755,root,root) %{_datadir}/perf-core/scripts/perl/bin/*
771%{_datadir}/perf-core/scripts/perl/*.pl
772
773%dir %{_datadir}/perf-core/scripts/python
774%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util
775%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib
776%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
777%dir %{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
db5f9ac9 778%{_datadir}/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/*.py*
fea1e605
ER
779%dir %{_datadir}/perf-core/scripts/python/bin
780%attr(755,root,root) %{_datadir}/perf-core/scripts/python/bin/*
db5f9ac9
JB
781%{_datadir}/perf-core/scripts/python/*.py*
782
eb373af4
AM
783%dir %{_libdir}/traceevent
784%dir %{_libdir}/traceevent/plugins
785%attr(755,root,root) %{_libdir}/traceevent/plugins/plugin_*.so
786
51522bd6
JB
787%dir %{_prefix}/lib/perf
788%{_prefix}/lib/perf/examples
789%{_prefix}/lib/perf/include
790
a5af5310 791%if %{with multilib}
0a3bb9dd
JR
792%files perf-vdso32
793%defattr(644,root,root,755)
794%attr(755,root,root) %{_bindir}/perf-read-vdso32
795
796%files perf-vdsox32
797%defattr(644,root,root,755)
798%attr(755,root,root) %{_bindir}/perf-read-vdsox32
799%endif
800
bc35d286 801%if %{with gtk}
db5f9ac9
JB
802%files perf-gtk
803%defattr(644,root,root,755)
ae4c1fd4 804%attr(755,root,root) %{_libdir}/libperf-gtk.so
bc35d286 805%endif
db5f9ac9 806
db5f9ac9
JB
807%files -n bash-completion-perf
808%defattr(644,root,root,755)
809/etc/bash_completion.d/perf
fea1e605 810%endif
0a891de9 811
c5a822e3
JB
812%files -n bash-completion-kernel-tools
813%defattr(644,root,root,755)
814%{bash_compdir}/bpftool
815
0a891de9
JB
816%if %{with usbip}
817%files -n usbip
818%defattr(644,root,root,755)
819%doc linux-%{basever}/tools/usb/usbip/{AUTHORS,README}
820%attr(755,root,root) %{_sbindir}/usbip
821%attr(755,root,root) %{_sbindir}/usbipd
822%{_mandir}/man8/usbip.8*
823%{_mandir}/man8/usbipd.8*
824
825%files -n usbip-libs
826%defattr(644,root,root,755)
827%attr(755,root,root) %{_libdir}/libusbip.so.*.*.*
828%attr(755,root,root) %ghost %{_libdir}/libusbip.so.0
829
830%files -n usbip-devel
831%defattr(644,root,root,755)
832%attr(755,root,root) %{_libdir}/libusbip.so
833%{_includedir}/usbip
834
835%files -n usbip-static
836%defattr(644,root,root,755)
837%{_libdir}/libusbip.a
838%endif
This page took 0.21562 seconds and 4 git commands to generate.