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