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