1 |
%define major 4 |
2 |
%define libname %mklibname %{name} %{major} |
3 |
%define devname %mklibname %{name} -d |
4 |
|
5 |
# comment out if not prerel |
6 |
#define prel rc1 |
7 |
|
8 |
# Release |
9 |
%define rel 4 |
10 |
|
11 |
Name: uhd |
12 |
Summary: Universal Hardware Driver for Ettus Research products |
13 |
Version: 4.8.0.0 |
14 |
Release: %mkrel %{?prel:0.%prel.}%{rel} |
15 |
Group: Communications/Radio |
16 |
License: GPLv3+ |
17 |
Url: http://uhd.ettus.com/ |
18 |
Source0: https://github.com/EttusResearch/uhd/archive/v%{version}%{?prel:-%prel}/%{name}-%{version}%{?prel:-%prel}.tar.gz |
19 |
# Bug tracker https://github.com/EttusResearch/uhd/issues |
20 |
# |
21 |
# https://github.com/EttusResearch/uhd/pull/836 |
22 |
Patch: 0001-host-include-cstdint-before-boost-lockfree-queue.hpp.patch |
23 |
BuildRequires: cmake |
24 |
BuildRequires: boost-devel |
25 |
BuildRequires: git |
26 |
%ifarch %{arm32} %{ix86} |
27 |
BuildRequires: libatomic-devel |
28 |
%endif |
29 |
BuildRequires: pkgconfig(ncurses) |
30 |
BuildRequires: pkgconfig(libgps) |
31 |
BuildRequires: pkgconfig(libusb-1.0) |
32 |
BuildRequires: pkgconfig(python3) |
33 |
BuildRequires: python3-docutils |
34 |
BuildRequires: python3-mako |
35 |
BuildRequires: python3-numpy-devel |
36 |
BuildRequires: python3-requests |
37 |
BuildRequires: python3-ruamel-yaml |
38 |
BuildRequires: python3-setuptools |
39 |
BuildRequires: doxygen |
40 |
BuildRequires: pkgconfig |
41 |
|
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 and |
45 |
future Ettus Research products. It can be used standalone without GNU Radio. |
46 |
|
47 |
%prep |
48 |
%autosetup -p1 -n %{name}-%{version}%{?prel:-%prel} |
49 |
|
50 |
%build |
51 |
%global _vpath_srcdir host |
52 |
%cmake \ |
53 |
-DCMAKE_SKIP_RPATH=ON \ |
54 |
-DENABLE_UTILS=ON \ |
55 |
-DENABLE_E100=ON \ |
56 |
-DENABLE_E300=ON \ |
57 |
-DENABLE_PYTHON_API=ON \ |
58 |
-DENABLE_PYTHON3=ON \ |
59 |
-DENABLE_TESTS=OFF \ |
60 |
-DENABLE_EXAMPLES=OFF \ |
61 |
%ifarch %arm |
62 |
-DNEON_SIMD_ENABLE=OFF |
63 |
%endif |
64 |
%cmake_build |
65 |
|
66 |
%install |
67 |
%cmake_install |
68 |
|
69 |
# Allow access only to users in usrp group |
70 |
mkdir -p %{buildroot}%{_udevrulesdir} |
71 |
mv %{buildroot}%{_libdir}/uhd/utils/uhd-usrp.rules %{buildroot}%{_udevrulesdir}/10-usrp-uhd.rules |
72 |
sed -i 's/MODE:="0666"/MODE:="0660"/' %{buildroot}%{_udevrulesdir}/10-usrp-uhd.rules |
73 |
|
74 |
# Remove binaries for tests, examples |
75 |
rm -rf %{buildroot}%{_libdir}/uhd/{tests,examples} |
76 |
|
77 |
# Move the utils stuff to libexec dir |
78 |
mkdir -p %{buildroot}%{_libexecdir}/uhd |
79 |
mv %{buildroot}%{_libdir}/uhd/utils %{buildroot}%{_libexecdir}/uhd/utils |
80 |
mv %{buildroot}%{_datadir}/uhd/rfnoc %{buildroot}%{_libexecdir}/uhd/ |
81 |
|
82 |
# Package base docs to base package |
83 |
mkdir _tmpdoc |
84 |
mv %{buildroot}%{_docdir}/%{name}/{LICENSE,README.md} _tmpdoc |
85 |
|
86 |
# Make version sane in uhd.pc |
87 |
sed -i '/Version/c Version: %{version}' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc |
88 |
|
89 |
%package -n %{libname} |
90 |
Summary: Library files |
91 |
Group: Communications/Radio |
92 |
Requires: %{name} = %{version}-%{release} |
93 |
|
94 |
%description -n %{libname} |
95 |
Library files for the Universal Hardware Driver (UHD). |
96 |
|
97 |
%package -n %{devname} |
98 |
Summary: Development files for UHD |
99 |
Group: Communications/Radio |
100 |
Requires: %{libname} = %{version}-%{release} |
101 |
Provides: %{name}-devel = %{version}-%{release} |
102 |
|
103 |
%description -n %{devname} |
104 |
Development files for the Universal Hardware Driver (UHD). |
105 |
|
106 |
%package doc |
107 |
Summary: Documentation files for UHD |
108 |
Group: Communications/Radio |
109 |
BuildArch: noarch |
110 |
|
111 |
%description doc |
112 |
Documentation for the Universal Hardware Driver (UHD). |
113 |
|
114 |
%pre -n uhd |
115 |
getent group usrp >/dev/null || groupadd -r usrp |
116 |
|
117 |
%files |
118 |
%doc _tmpdoc/* |
119 |
%{_bindir}/* |
120 |
%{_datadir}/%{name}/cal/*.fbs |
121 |
%{_datadir}/%{name}/rfnoc-newmod/ |
122 |
%{_udevrulesdir}/10-usrp-uhd.rules |
123 |
%{_libexecdir}/%{name} |
124 |
%{python3_sitearch}/%{name}/ |
125 |
%{python3_sitearch}/usrp_mpm/ |
126 |
|
127 |
%files -n %{libname} |
128 |
%{_libdir}/lib%{name}.so.%{major}{,.*} |
129 |
|
130 |
%files -n %{devname} |
131 |
%{_includedir}/* |
132 |
%{_libdir}/lib%{name}.so |
133 |
%{_libdir}/pkgconfig/*.pc |
134 |
%{_libdir}/cmake/%{name}/ |
135 |
|
136 |
%files doc |
137 |
%doc %{_docdir}/%{name}/ |
138 |
%{_mandir}/man1/* |