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