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