]>
Commit | Line | Data |
---|---|---|
0cfe325a JB |
1 | # |
2 | # Conditional build | |
3 | %bcond_without mpm # Module Peripheral Manager (run on embedded devices) | |
4 | ||
938948b4 | 5 | Summary: Universal Hardware Driver for Ettus Research products |
245f21b5 | 6 | Summary(pl.UTF-8): Uniwersalny sterownik sprzętowy do produktów Ettus Research |
938948b4 | 7 | Name: uhd |
0cfe325a | 8 | Version: 3.15.0.0 |
245f21b5 | 9 | Release: 1 |
938948b4 | 10 | License: GPL v3+ |
245f21b5 | 11 | Group: Applications/System |
0cfe325a JB |
12 | #Source0Download: https://github.com/EttusResearch/uhd/releases |
13 | Source0: https://github.com/EttusResearch/uhd/archive/v%{version}/%{name}-%{version}.tar.gz | |
14 | # Source0-md5: cf589d5130ebd8348e3dbf129a7c5c38 | |
245f21b5 JB |
15 | Patch0: %{name}-boost.patch |
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 | |
31 | BuildRequires: python3-numpy >= 1.7 | |
32 | BuildRequires: python3-requests >= 2.0 | |
e4482680 | 33 | BuildRequires: rpm-pythonprov |
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} | |
68 | Requires: boost-devel >= 1.53 | |
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 |
245f21b5 | 94 | %if "%{_rpmversion}" >= "4.6" |
938948b4 BS |
95 | BuildArch: noarch |
96 | %endif | |
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 |
245f21b5 JB |
165 | %patch0 -p1 |
166 | %patch1 -p1 | |
0cfe325a JB |
167 | %patch2 -p1 |
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 | |
173 | %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' mpm/python/{n3xx_bist,usrp_hwd.py,usrp_update_fs} | |
174 | %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' mpm/tools/mpm_{debug,shell}.py | |
938948b4 BS |
175 | |
176 | %build | |
0cfe325a JB |
177 | install -d build-{host,mpm} |
178 | cd build-host | |
179 | %cmake ../host \ | |
245f21b5 JB |
180 | -DENABLE_USB=ON |
181 | ||
938948b4 BS |
182 | %{__make} |
183 | ||
0cfe325a JB |
184 | %if %{with mpm} |
185 | cd ../build-mpm | |
186 | %cmake ../mpm | |
187 | ||
188 | # -DMPM_DEVICE= n3xx (Mykonos+Magnesium), e320, e31x | |
189 | %endif | |
190 | ||
191 | %{__make} | |
192 | ||
938948b4 BS |
193 | %install |
194 | rm -rf $RPM_BUILD_ROOT | |
245f21b5 | 195 | |
0cfe325a | 196 | %{__make} -C build-host install \ |
938948b4 BS |
197 | DESTDIR=$RPM_BUILD_ROOT |
198 | ||
0cfe325a JB |
199 | # outdated (binaries removed) |
200 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{octoclock_firmware_burner,usrp_n2xx_simple_net_burner,usrp_x3xx_fpga_burner}.1* | |
201 | # not packaging tests | |
202 | %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/tests \ | |
203 | $RPM_BUILD_ROOT%{_libdir}/%{name}/utils/latency/run_tests.py | |
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 | |
212 | %endif | |
213 | ||
214 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
215 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
938948b4 BS |
216 | |
217 | %clean | |
218 | rm -rf $RPM_BUILD_ROOT | |
219 | ||
245f21b5 JB |
220 | %post libs -p /sbin/ldconfig |
221 | %postun libs -p /sbin/ldconfig | |
938948b4 | 222 | |
0cfe325a JB |
223 | %post mpm-libs -p /sbin/ldconfig |
224 | %postun mpm-libs -p /sbin/ldconfig | |
225 | ||
938948b4 BS |
226 | %files |
227 | %defattr(644,root,root,755) | |
0cfe325a | 228 | %doc host/{LICENSE,README.md} |
938948b4 BS |
229 | %attr(755,root,root) %{_bindir}/uhd_cal_rx_iq_balance |
230 | %attr(755,root,root) %{_bindir}/uhd_cal_tx_dc_offset | |
231 | %attr(755,root,root) %{_bindir}/uhd_cal_tx_iq_balance | |
245f21b5 | 232 | %attr(755,root,root) %{_bindir}/uhd_config_info |
938948b4 | 233 | %attr(755,root,root) %{_bindir}/uhd_find_devices |
245f21b5 | 234 | %attr(755,root,root) %{_bindir}/uhd_image_loader |
938948b4 BS |
235 | %attr(755,root,root) %{_bindir}/uhd_images_downloader |
236 | %attr(755,root,root) %{_bindir}/uhd_usrp_probe | |
24404f1d | 237 | %attr(755,root,root) %{_bindir}/usrp2_card_burner |
24404f1d ER |
238 | %{_mandir}/man1/uhd_cal_rx_iq_balance.1* |
239 | %{_mandir}/man1/uhd_cal_tx_dc_offset.1* | |
240 | %{_mandir}/man1/uhd_cal_tx_iq_balance.1* | |
245f21b5 | 241 | %{_mandir}/man1/uhd_config_info.1* |
24404f1d | 242 | %{_mandir}/man1/uhd_find_devices.1* |
245f21b5 | 243 | %{_mandir}/man1/uhd_image_loader.1* |
24404f1d ER |
244 | %{_mandir}/man1/uhd_images_downloader.1* |
245 | %{_mandir}/man1/uhd_usrp_probe.1* | |
245f21b5 | 246 | %{_mandir}/man1/usrp2_card_burner.1* |
58254af1 | 247 | %dir %{_libdir}/%{name}/utils |
245f21b5 JB |
248 | %attr(755,root,root) %{_libdir}/%{name}/utils/b2xx_fx3_utils |
249 | %attr(755,root,root) %{_libdir}/%{name}/utils/converter_benchmark | |
250 | %attr(755,root,root) %{_libdir}/%{name}/utils/converter_benchmark.py | |
251 | %attr(755,root,root) %{_libdir}/%{name}/utils/fx2_init_eeprom | |
252 | %attr(755,root,root) %{_libdir}/%{name}/utils/octoclock_burn_eeprom | |
253 | %attr(755,root,root) %{_libdir}/%{name}/utils/query_gpsdo_sensors | |
254 | %attr(755,root,root) %{_libdir}/%{name}/utils/uhd_images_downloader.py | |
255 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp2_card_burner.py | |
245f21b5 JB |
256 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp2_recovery.py |
257 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp_burn_db_eeprom | |
258 | %attr(755,root,root) %{_libdir}/%{name}/utils/usrp_burn_mb_eeprom | |
58254af1 | 259 | %{_libdir}/%{name}/utils/uhd-usrp.rules |
58254af1 | 260 | %dir %{_libdir}/%{name}/utils/latency |
245f21b5 JB |
261 | %attr(755,root,root) %{_libdir}/%{name}/utils/latency/graph.py |
262 | %attr(755,root,root) %{_libdir}/%{name}/utils/latency/responder | |
263 | %{_datadir}/%{name} | |
264 | ||
265 | %files libs | |
266 | %defattr(644,root,root,755) | |
0cfe325a | 267 | %attr(755,root,root) %{_libdir}/libuhd.so.3.15.0 |
245f21b5 | 268 | %dir %{_libdir}/%{name} |
938948b4 BS |
269 | |
270 | %files devel | |
271 | %defattr(644,root,root,755) | |
245f21b5 | 272 | %attr(755,root,root) %{_libdir}/libuhd.so |
938948b4 | 273 | %{_includedir}/uhd |
245f21b5 | 274 | %{_includedir}/uhd.h |
24404f1d | 275 | %{_libdir}/cmake/uhd |
245f21b5 | 276 | %{_pkgconfigdir}/uhd.pc |
938948b4 | 277 | |
245f21b5 | 278 | %files examples |
938948b4 | 279 | %defattr(644,root,root,755) |
24404f1d | 280 | %dir %{_libdir}/%{name}/examples |
58254af1 | 281 | %attr(755,root,root) %{_libdir}/%{name}/examples/* |
245f21b5 JB |
282 | |
283 | %files doc | |
284 | %defattr(644,root,root,755) | |
285 | %{_docdir}/%{name} | |
0cfe325a JB |
286 | |
287 | %files -n python3-uhd | |
288 | %defattr(644,root,root,755) | |
289 | %dir %{py3_sitedir}/uhd | |
290 | %attr(755,root,root) %{py3_sitedir}/uhd/libpyuhd.so | |
291 | %{py3_sitedir}/uhd/*.py | |
292 | %{py3_sitedir}/uhd/__pycache__ | |
293 | ||
294 | %if %{with mpm} | |
295 | %files mpm | |
296 | %defattr(644,root,root,755) | |
297 | %attr(755,root,root) %{_bindir}/db-dump | |
298 | %attr(755,root,root) %{_bindir}/db-id | |
299 | %attr(755,root,root) %{_bindir}/db-init | |
300 | %attr(755,root,root) %{_bindir}/eeprom-blank | |
301 | %attr(755,root,root) %{_bindir}/eeprom-dump | |
302 | %attr(755,root,root) %{_bindir}/eeprom-id | |
303 | %attr(755,root,root) %{_bindir}/eeprom-init | |
304 | %attr(755,root,root) %{_bindir}/eeprom-set-flags | |
305 | %attr(755,root,root) %{_bindir}/fan-limits | |
306 | %attr(755,root,root) %{_bindir}/mpm_debug.py | |
307 | %attr(755,root,root) %{_bindir}/mpm_shell.py | |
308 | %attr(755,root,root) %{_bindir}/n3xx_bist | |
309 | %attr(755,root,root) %{_bindir}/usrp_hwd.py | |
310 | %attr(755,root,root) %{_bindir}/usrp_update_fs | |
311 | %{systemdunitdir}/usrp-hwd.service | |
312 | ||
313 | %files mpm-libs | |
314 | %defattr(644,root,root,755) | |
315 | %attr(755,root,root) %{_libdir}/libusrp-periphs.so.*.*.* | |
316 | %attr(755,root,root) %ghost %{_libdir}/libusrp-periphs.so.3 | |
317 | ||
318 | %files mpm-devel | |
319 | %defattr(644,root,root,755) | |
320 | %attr(755,root,root) %{_libdir}/libusrp-periphs.so | |
321 | %{_includedir}/mpm | |
322 | ||
323 | %files -n python3-usrp_mpm | |
324 | %defattr(644,root,root,755) | |
325 | %dir %{py3_sitedir}/usrp_mpm | |
326 | %attr(755,root,root) %{py3_sitedir}/usrp_mpm/libpyusrp_periphs.so | |
327 | %{py3_sitedir}/usrp_mpm/*.py | |
328 | %{py3_sitedir}/usrp_mpm/__pycache__ | |
329 | %{py3_sitedir}/usrp_mpm/chips | |
330 | %{py3_sitedir}/usrp_mpm/cores | |
331 | %{py3_sitedir}/usrp_mpm/dboard_manager | |
332 | %{py3_sitedir}/usrp_mpm/periph_manager | |
333 | %{py3_sitedir}/usrp_mpm/sys_utils | |
334 | %{py3_sitedir}/usrp_mpm/xports | |
335 | %endif |