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