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