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