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