]>
Commit | Line | Data |
---|---|---|
0cfe325a JB |
1 | # |
2 | # Conditional build | |
3 | %bcond_without mpm # Module Peripheral Manager (run on embedded devices) | |
a57c7bf9 | 4 | %bcond_with dpdk # DPDK support |
4077bdba | 5 | %bcond_with tests # build tests |
0cfe325a | 6 | |
938948b4 | 7 | Summary: Universal Hardware Driver for Ettus Research products |
245f21b5 | 8 | Summary(pl.UTF-8): Uniwersalny sterownik sprzętowy do produktów Ettus Research |
938948b4 | 9 | Name: uhd |
a6a4f4fa | 10 | Version: 4.4.0.0 |
401659a8 | 11 | Release: 2 |
938948b4 | 12 | License: GPL v3+ |
245f21b5 | 13 | Group: Applications/System |
0cfe325a JB |
14 | #Source0Download: https://github.com/EttusResearch/uhd/releases |
15 | Source0: https://github.com/EttusResearch/uhd/archive/v%{version}/%{name}-%{version}.tar.gz | |
a6a4f4fa | 16 | # Source0-md5: d91249b0114b2ac2fc36457f294ee55b |
a1eb7cc3 | 17 | Patch0: gcc13.patch |
245f21b5 | 18 | Patch1: %{name}-libdir.patch |
0cfe325a | 19 | Patch3: %{name}-mpm-build.patch |
245f21b5 | 20 | URL: https://www.ettus.com/sdr-software/uhd-usrp-hardware-driver/ |
95341cf5 JB |
21 | BuildRequires: boost-devel >= 1.66 |
22 | BuildRequires: cmake >= 3.8 | |
e4482680 | 23 | BuildRequires: doxygen |
a57c7bf9 JB |
24 | %if %{with dpdk} |
25 | BuildRequires: dpdk-devel >= 18.11 | |
26 | BuildRequires: dpdk-devel < 21.12 | |
27 | %endif | |
95341cf5 | 28 | BuildRequires: libstdc++-devel >= 6:6.3 |
245f21b5 | 29 | BuildRequires: libusb-devel >= 1.0 |
e4482680 | 30 | BuildRequires: ncurses-devel |
e4482680 | 31 | BuildRequires: pkgconfig |
95341cf5 | 32 | BuildRequires: python3 >= 1:3.6 |
0cfe325a | 33 | BuildRequires: python3-Mako >= 0.4.2 |
d1110e97 JP |
34 | BuildRequires: python3-devel >= 1:3.6 |
35 | BuildRequires: python3-modules >= 1:3.6 | |
95341cf5 | 36 | BuildRequires: python3-numpy-devel >= 1.11 |
0cfe325a | 37 | BuildRequires: python3-requests >= 2.0 |
c8bbab61 | 38 | BuildRequires: rpm-build >= 4.6 |
e4482680 | 39 | BuildRequires: rpm-pythonprov |
4077bdba | 40 | BuildRequires: rpmbuild(macros) >= 1.742 |
0cfe325a | 41 | %if %{with mpm} |
e4482680 | 42 | BuildRequires: udev-devel |
0cfe325a | 43 | %endif |
245f21b5 | 44 | Requires: %{name}-libs = %{version}-%{release} |
a57c7bf9 | 45 | Requires: python3-uhd = %{version}-%{release} |
938948b4 | 46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
938948b4 | 47 | |
a57c7bf9 JB |
48 | # per_lcore__lcore_id, per_lcore__rte_errno non-function symbols from dpdk |
49 | %define skip_post_check_so libuhd.so.* | |
50 | ||
938948b4 BS |
51 | %description |
52 | The UHD is the universal hardware driver for Ettus Research products. | |
53 | The goal of the UHD is to provide a host driver and API for current | |
54 | and future Ettus Research products. It can be used standalone without | |
55 | GNU Radio. | |
56 | ||
245f21b5 JB |
57 | %description -l pl.UTF-8 |
58 | UHD to uniwersalny sterownik sprzętowy do produktów Ettus Research. | |
59 | Celem UHD jest zapewnienie sterownika gospodarza oraz API do obecnych | |
60 | i przyszłych produków Ettus Research. Może być używany samodzielnie | |
61 | bez GNU Radio. | |
62 | ||
63 | %package libs | |
64 | Summary: USRP Hardware Driver library | |
65 | Summary(pl.UTF-8): Biblioteka USRP Hardware Driver | |
66 | Group: Libraries | |
67 | ||
68 | %description libs | |
69 | USRP Hardware Driver library. | |
70 | ||
71 | %description libs -l pl.UTF-8 | |
72 | Biblioteka USRP Hardware Driver. | |
73 | ||
938948b4 | 74 | %package devel |
245f21b5 JB |
75 | Summary: Development files for USRP Hardware Driver library |
76 | Summary(pl.UTF-8): Pliki programistyczne biblioteki USRP Hardware Driver | |
77 | Group: Development/Libraries | |
78 | Requires: %{name}-libs = %{version}-%{release} | |
95341cf5 | 79 | Requires: boost-devel >= 1.66 |
938948b4 BS |
80 | |
81 | %description devel | |
245f21b5 JB |
82 | Header files for USRP Hardware Driver for Ettus Research products. |
83 | ||
84 | %description devel -l pl.UTF-8 | |
85 | Pliki nagłówkowe biblioteki USRP Hardware Driver (sterownika dla | |
86 | sprzętu USRP) do produktów Ettus Research. | |
87 | ||
88 | %package examples | |
89 | Summary: Examples for UHD | |
90 | Summary(pl.UTF-8): Przykłady do UHD | |
91 | Group: Applications/System | |
92 | Requires: %{name}-libs = %{version}-%{release} | |
93 | ||
94 | %description examples | |
95 | Example programs for USRP Hardware Driver for Ettus Research products. | |
96 | ||
97 | %description examples -l pl.UTF-8 | |
98 | Programy przykładowe do biblioteki USRP Hardware Driver (sterownika | |
99 | dla sprzętu USRP) do produktów Ettus Research. | |
938948b4 | 100 | |
24404f1d | 101 | %package doc |
245f21b5 JB |
102 | Summary: Documentation for UHD |
103 | Summary(pl.UTF-8): Dokumentacja do UHD | |
938948b4 | 104 | Group: Documentation |
938948b4 | 105 | BuildArch: noarch |
938948b4 BS |
106 | |
107 | %description doc | |
245f21b5 JB |
108 | Documentation for USRP Hardware Driver for Ettus Research products. |
109 | ||
110 | %description doc -l pl.UTF-8 | |
111 | Dokumentacja do biblioteki USRP Hardware Driver (sterownika dla | |
112 | sprzętu USRP) do produktów Ettus Research. | |
938948b4 | 113 | |
0cfe325a JB |
114 | %package -n python3-uhd |
115 | Summary: Python interface for USRP Hardware Driver library | |
116 | Summary(pl.UTF-8): Interfejs Pythona do biblioteki USRP Hardware Driver | |
117 | Group: Libraries/Python | |
118 | ||
119 | %description -n python3-uhd | |
120 | Python interface for USRP Hardware Driver library. | |
121 | ||
122 | %description -n python3-uhd -l pl.UTF-8 | |
123 | Interfejs Pythona do biblioteki USRP Hardware Driver. | |
124 | ||
125 | %package mpm | |
126 | Summary: USRP Module Peripheral Manager | |
127 | Summary(pl.UTF-8): USRP Module Peripheral Manager - zarządca urządzeń peryferyjnych | |
128 | Group: Applications/System | |
129 | Requires: %{name}-mpm-libs = %{version}-%{release} | |
130 | ||
131 | %description mpm | |
132 | USRP Module Peripheral Manager. | |
133 | ||
134 | %description mpm -l pl.UTF-8 | |
135 | USRP Module Peripheral Manager - zarządca urządzeń peryferyjnych. | |
136 | ||
137 | %package mpm-libs | |
138 | Summary: USRP Module Peripheral Manager library | |
139 | Summary(pl.UTF-8): Biblioteka USRP Module Peripheral Manager | |
140 | Group: Libraries | |
141 | ||
142 | %description mpm-libs | |
143 | USRP Module Peripheral Manager library. | |
144 | ||
145 | %description mpm-libs -l pl.UTF-8 | |
146 | Biblioteka USRP Module Peripheral Manager. | |
147 | ||
148 | %package mpm-devel | |
149 | Summary: USRP Module Peripheral Manager library | |
150 | Summary(pl.UTF-8): Biblioteka USRP Module Peripheral Manager | |
151 | Group: Development/Libraries | |
152 | Requires: %{name}-mpm-libs = %{version}-%{release} | |
153 | ||
154 | %description mpm-devel | |
155 | USRP Module Peripheral Manager library. | |
156 | ||
157 | %description mpm-devel -l pl.UTF-8 | |
158 | Biblioteka USRP Module Peripheral Manager. | |
159 | ||
160 | %package -n python3-usrp_mpm | |
161 | Summary: Python USRP Module Peripheral Manager library | |
162 | Summary(pl.UTF-8): Biblioteka USRP Module Peripheral Manager dla Pythona | |
163 | Group: Libraries/Python | |
164 | Requires: %{name}-mpm-libs = %{version}-%{release} | |
165 | ||
166 | %description -n python3-usrp_mpm | |
167 | Python USRP Module Peripheral Manager library. | |
168 | ||
169 | %description -n python3-usrp_mpm -l pl.UTF-8 | |
170 | Biblioteka USRP Module Peripheral Manager dla Pythona. | |
171 | ||
938948b4 | 172 | %prep |
0cfe325a | 173 | %setup -q |
a1eb7cc3 | 174 | %patch0 -p1 |
245f21b5 | 175 | %patch1 -p1 |
0cfe325a | 176 | %patch3 -p1 |
245f21b5 | 177 | |
0cfe325a JB |
178 | %{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' host/examples/python/*.py |
179 | %{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' host/utils/{converter_benchmark.py,usrp2_{card_burner,card_burner_gui,recovery}.py} | |
180 | %{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' host/utils/latency/graph.py | |
0b1fbba1 | 181 | grep -rl '/usr/bin/env python3' . | xargs %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' |
938948b4 BS |
182 | |
183 | %build | |
0cfe325a JB |
184 | install -d build-{host,mpm} |
185 | cd build-host | |
186 | %cmake ../host \ | |
eb732e51 | 187 | -DUHD_VERSION="%{version}" \ |
a57c7bf9 | 188 | %{!?with_dpdk:-DENABLE_DPDK=OFF} \ |
4077bdba | 189 | %{cmake_on_off tests ENABLE_TESTS} \ |
245f21b5 JB |
190 | -DENABLE_USB=ON |
191 | ||
938948b4 BS |
192 | %{__make} |
193 | ||
0cfe325a JB |
194 | %if %{with mpm} |
195 | cd ../build-mpm | |
196 | %cmake ../mpm | |
197 | ||
198 | # -DMPM_DEVICE= n3xx (Mykonos+Magnesium), e320, e31x | |
199 | %endif | |
200 | ||
201 | %{__make} | |
202 | ||
938948b4 BS |
203 | %install |
204 | rm -rf $RPM_BUILD_ROOT | |
245f21b5 | 205 | |
0cfe325a | 206 | %{__make} -C build-host install \ |
938948b4 BS |
207 | DESTDIR=$RPM_BUILD_ROOT |
208 | ||
0cfe325a | 209 | # outdated (binaries removed) |
a57c7bf9 | 210 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/usrp_n2xx_simple_net_burner.1* |
0cfe325a | 211 | # not packaging tests |
08a4f4a4 JB |
212 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/utils/latency/run_tests.py |
213 | %if %{with tests} | |
1dd8577d | 214 | %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/tests |
4077bdba | 215 | %endif |
245f21b5 JB |
216 | # packaged as %doc |
217 | %{__rm} $RPM_BUILD_ROOT%{_docdir}/uhd/{LICENSE,README.md} | |
24404f1d | 218 | |
0cfe325a JB |
219 | %if %{with mpm} |
220 | %{__make} -C build-mpm install \ | |
221 | DESTDIR=$RPM_BUILD_ROOT | |
222 | ||
223 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/aurora_bist_test.py | |
1dd8577d JB |
224 | |
225 | # combine all rules | |
226 | LC_ALL=C sort -u mpm/systemd/udev/????/70-sfp-net.rules >$RPM_BUILD_ROOT/lib/udev/rules.d/70-sfp-net.rules | |
227 | ||
228 | # configuration examples | |
229 | %{__rm} $RPM_BUILD_ROOT/lib/systemd/network/{eth0,int0,sfp*}.network | |
0cfe325a JB |
230 | %endif |
231 | ||
232 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
233 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
938948b4 BS |
234 | |
235 | %clean | |
236 | rm -rf $RPM_BUILD_ROOT | |
237 | ||
245f21b5 JB |
238 | %post libs -p /sbin/ldconfig |
239 | %postun libs -p /sbin/ldconfig | |
938948b4 | 240 | |
0cfe325a JB |
241 | %post mpm-libs -p /sbin/ldconfig |
242 | %postun mpm-libs -p /sbin/ldconfig | |
243 | ||
938948b4 BS |
244 | %files |
245 | %defattr(644,root,root,755) | |
95341cf5 | 246 | %doc CHANGELOG host/{LICENSE,README.md} |
3d2bbd78 | 247 | %attr(755,root,root) %{_bindir}/check-filesystem |
3d2bbd78 JR |
248 | %attr(755,root,root) %{_bindir}/rfnoc_image_builder |
249 | %attr(755,root,root) %{_bindir}/uhd_adc_self_cal | |
938948b4 BS |
250 | %attr(755,root,root) %{_bindir}/uhd_cal_rx_iq_balance |
251 | %attr(755,root,root) %{_bindir}/uhd_cal_tx_dc_offset | |
252 | %attr(755,root,root) %{_bindir}/uhd_cal_tx_iq_balance | |
245f21b5 | 253 | %attr(755,root,root) %{_bindir}/uhd_config_info |
938948b4 | 254 | %attr(755,root,root) %{_bindir}/uhd_find_devices |
245f21b5 | 255 | %attr(755,root,root) %{_bindir}/uhd_image_loader |
938948b4 BS |
256 | %attr(755,root,root) %{_bindir}/uhd_images_downloader |
257 | %attr(755,root,root) %{_bindir}/uhd_usrp_probe | |
24404f1d | 258 | %attr(755,root,root) %{_bindir}/usrp2_card_burner |
a57c7bf9 | 259 | %attr(755,root,root) %{_bindir}/usrpctl |
24404f1d ER |
260 | %{_mandir}/man1/uhd_cal_rx_iq_balance.1* |
261 | %{_mandir}/man1/uhd_cal_tx_dc_offset.1* | |
262 | %{_mandir}/man1/uhd_cal_tx_iq_balance.1* | |
245f21b5 | 263 | %{_mandir}/man1/uhd_config_info.1* |
24404f1d | 264 | %{_mandir}/man1/uhd_find_devices.1* |
245f21b5 | 265 | %{_mandir}/man1/uhd_image_loader.1* |
24404f1d ER |
266 | %{_mandir}/man1/uhd_images_downloader.1* |
267 | %{_mandir}/man1/uhd_usrp_probe.1* | |
245f21b5 | 268 | %{_mandir}/man1/usrp2_card_burner.1* |
a57c7bf9 | 269 | %{_mandir}/man1/usrpctl.1* |
58254af1 | 270 | %dir %{_libdir}/%{name}/utils |
245f21b5 | 271 | %attr(755,root,root) %{_libdir}/%{name}/utils/b2xx_fx3_utils |
3d2bbd78 | 272 | %attr(755,root,root) %{_libdir}/%{name}/utils/convert_cal_data.py |
245f21b5 JB |
273 | %attr(755,root,root) %{_libdir}/%{name}/utils/converter_benchmark |
274 | %attr(755,root,root) %{_libdir}/%{name}/utils/converter_benchmark.py | |
275 | %attr(755,root,root) %{_libdir}/%{name}/utils/fx2_init_eeprom | |
276 | %attr(755,root,root) %{_libdir}/%{name}/utils/octoclock_burn_eeprom | |
277 | %attr(755,root,root) %{_libdir}/%{name}/utils/query_gpsdo_sensors | |
278 | %attr(755,root,root) %{_libdir}/%{name}/utils/uhd_images_downloader.py | |
3d2bbd78 | 279 | %attr(755,root,root) %{_libdir}/%{name}/utils/uhd_power_cal.py |
245f21b5 | 280 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp2_card_burner.py |
245f21b5 JB |
281 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp2_recovery.py |
282 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp_burn_db_eeprom | |
283 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp_burn_mb_eeprom | |
58254af1 | 284 | %{_libdir}/%{name}/utils/uhd-usrp.rules |
58254af1 | 285 | %dir %{_libdir}/%{name}/utils/latency |
245f21b5 JB |
286 | %attr(755,root,root) %{_libdir}/%{name}/utils/latency/graph.py |
287 | %attr(755,root,root) %{_libdir}/%{name}/utils/latency/responder | |
288 | %{_datadir}/%{name} | |
289 | ||
290 | %files libs | |
291 | %defattr(644,root,root,755) | |
a6a4f4fa | 292 | %attr(755,root,root) %{_libdir}/libuhd.so.4.4.0 |
245f21b5 | 293 | %dir %{_libdir}/%{name} |
938948b4 BS |
294 | |
295 | %files devel | |
296 | %defattr(644,root,root,755) | |
245f21b5 | 297 | %attr(755,root,root) %{_libdir}/libuhd.so |
938948b4 | 298 | %{_includedir}/uhd |
245f21b5 | 299 | %{_includedir}/uhd.h |
24404f1d | 300 | %{_libdir}/cmake/uhd |
245f21b5 | 301 | %{_pkgconfigdir}/uhd.pc |
938948b4 | 302 | |
245f21b5 | 303 | %files examples |
938948b4 | 304 | %defattr(644,root,root,755) |
24404f1d | 305 | %dir %{_libdir}/%{name}/examples |
58254af1 | 306 | %attr(755,root,root) %{_libdir}/%{name}/examples/* |
245f21b5 JB |
307 | |
308 | %files doc | |
309 | %defattr(644,root,root,755) | |
310 | %{_docdir}/%{name} | |
0cfe325a JB |
311 | |
312 | %files -n python3-uhd | |
313 | %defattr(644,root,root,755) | |
314 | %dir %{py3_sitedir}/uhd | |
3f4f25fc | 315 | %attr(755,root,root) %{py3_sitedir}/uhd/libpyuhd.cpython-*.so |
0cfe325a JB |
316 | %{py3_sitedir}/uhd/*.py |
317 | %{py3_sitedir}/uhd/__pycache__ | |
3d2bbd78 JR |
318 | %{py3_sitedir}/uhd/dsp |
319 | %{py3_sitedir}/uhd/imgbuilder | |
320 | %{py3_sitedir}/uhd/usrp | |
a57c7bf9 | 321 | %{py3_sitedir}/uhd/usrpctl |
3d2bbd78 | 322 | %{py3_sitedir}/uhd/utils |
0cfe325a JB |
323 | |
324 | %if %{with mpm} | |
325 | %files mpm | |
326 | %defattr(644,root,root,755) | |
327 | %attr(755,root,root) %{_bindir}/db-dump | |
328 | %attr(755,root,root) %{_bindir}/db-id | |
329 | %attr(755,root,root) %{_bindir}/db-init | |
330 | %attr(755,root,root) %{_bindir}/eeprom-blank | |
331 | %attr(755,root,root) %{_bindir}/eeprom-dump | |
332 | %attr(755,root,root) %{_bindir}/eeprom-id | |
333 | %attr(755,root,root) %{_bindir}/eeprom-init | |
334 | %attr(755,root,root) %{_bindir}/eeprom-set-flags | |
335 | %attr(755,root,root) %{_bindir}/fan-limits | |
336 | %attr(755,root,root) %{_bindir}/mpm_debug.py | |
337 | %attr(755,root,root) %{_bindir}/mpm_shell.py | |
338 | %attr(755,root,root) %{_bindir}/n3xx_bist | |
339 | %attr(755,root,root) %{_bindir}/usrp_hwd.py | |
340 | %attr(755,root,root) %{_bindir}/usrp_update_fs | |
1dd8577d | 341 | /lib/udev/rules.d/70-sfp-net.rules |
0cfe325a | 342 | %{systemdunitdir}/usrp-hwd.service |
1dd8577d | 343 | /usr/lib/sysctl.d/usrp-hwd.conf |
0cfe325a JB |
344 | |
345 | %files mpm-libs | |
346 | %defattr(644,root,root,755) | |
347 | %attr(755,root,root) %{_libdir}/libusrp-periphs.so.*.*.* | |
7bbfc1d2 | 348 | %attr(755,root,root) %ghost %{_libdir}/libusrp-periphs.so.4 |
0cfe325a JB |
349 | |
350 | %files mpm-devel | |
351 | %defattr(644,root,root,755) | |
352 | %attr(755,root,root) %{_libdir}/libusrp-periphs.so | |
353 | %{_includedir}/mpm | |
354 | ||
355 | %files -n python3-usrp_mpm | |
356 | %defattr(644,root,root,755) | |
357 | %dir %{py3_sitedir}/usrp_mpm | |
358 | %attr(755,root,root) %{py3_sitedir}/usrp_mpm/libpyusrp_periphs.so | |
359 | %{py3_sitedir}/usrp_mpm/*.py | |
360 | %{py3_sitedir}/usrp_mpm/__pycache__ | |
361 | %{py3_sitedir}/usrp_mpm/chips | |
362 | %{py3_sitedir}/usrp_mpm/cores | |
363 | %{py3_sitedir}/usrp_mpm/dboard_manager | |
364 | %{py3_sitedir}/usrp_mpm/periph_manager | |
365 | %{py3_sitedir}/usrp_mpm/sys_utils | |
366 | %{py3_sitedir}/usrp_mpm/xports | |
3d2bbd78 | 367 | %{py3_sitedir}/usrp_mpm/simulator |
0cfe325a | 368 | %endif |