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