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