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