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