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