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 1 |
10 |
|
11 |
Name: uhd |
12 |
Summary: Universal Hardware Driver for Ettus Research products |
13 |
Version: 4.7.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 |
BuildRequires: cmake |
22 |
BuildRequires: boost-devel |
23 |
BuildRequires: git |
24 |
BuildRequires: pkgconfig(ncurses) |
25 |
BuildRequires: pkgconfig(libgps) |
26 |
BuildRequires: pkgconfig(libusb-1.0) |
27 |
BuildRequires: pkgconfig(python3) |
28 |
BuildRequires: python3-docutils |
29 |
BuildRequires: python3-mako |
30 |
BuildRequires: python3-numpy-devel |
31 |
BuildRequires: python3-requests |
32 |
BuildRequires: python3-ruamel-yaml |
33 |
BuildRequires: python3-setuptools |
34 |
BuildRequires: doxygen |
35 |
BuildRequires: pkgconfig |
36 |
|
37 |
%description |
38 |
The UHD is the universal hardware driver for Ettus Research products. |
39 |
The goal of the UHD is to provide a host driver and API for current and |
40 |
future Ettus Research products. It can be used standalone without GNU Radio. |
41 |
|
42 |
%prep |
43 |
%autosetup -p1 -n %{name}-%{version}%{?prel:-%prel} |
44 |
|
45 |
%build |
46 |
%global _vpath_srcdir host |
47 |
%cmake \ |
48 |
-DCMAKE_SKIP_RPATH=ON \ |
49 |
-DENABLE_UTILS=ON \ |
50 |
-DENABLE_E100=ON \ |
51 |
-DENABLE_E300=ON \ |
52 |
-DENABLE_PYTHON_API=ON \ |
53 |
-DENABLE_PYTHON3=ON \ |
54 |
-DENABLE_TESTS=OFF \ |
55 |
-DENABLE_EXAMPLES=OFF \ |
56 |
%ifarch %arm |
57 |
-DNEON_SIMD_ENABLE=OFF |
58 |
%endif |
59 |
%cmake_build |
60 |
|
61 |
%install |
62 |
%cmake_install |
63 |
|
64 |
# Allow access only to users in usrp group |
65 |
mkdir -p %{buildroot}%{_udevrulesdir} |
66 |
mv %{buildroot}%{_libdir}/uhd/utils/uhd-usrp.rules %{buildroot}%{_udevrulesdir}/10-usrp-uhd.rules |
67 |
sed -i 's/MODE:="0666"/MODE:="0660"/' %{buildroot}%{_udevrulesdir}/10-usrp-uhd.rules |
68 |
|
69 |
# Remove binaries for tests, examples |
70 |
rm -rf %{buildroot}%{_libdir}/uhd/{tests,examples} |
71 |
|
72 |
# Move the utils stuff to libexec dir |
73 |
mkdir -p %{buildroot}%{_libexecdir}/uhd |
74 |
mv %{buildroot}%{_libdir}/uhd/utils %{buildroot}%{_libexecdir}/uhd/utils |
75 |
mv %{buildroot}%{_datadir}/uhd/rfnoc %{buildroot}%{_libexecdir}/uhd/ |
76 |
|
77 |
# Package base docs to base package |
78 |
mkdir _tmpdoc |
79 |
mv %{buildroot}%{_docdir}/%{name}/{LICENSE,README.md} _tmpdoc |
80 |
|
81 |
# Make version sane in uhd.pc |
82 |
sed -i '/Version/c Version: %{version}' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc |
83 |
|
84 |
%package -n %{libname} |
85 |
Summary: Library files |
86 |
Group: Communications/Radio |
87 |
Requires: %{name} = %{version}-%{release} |
88 |
|
89 |
%description -n %{libname} |
90 |
Library files for the Universal Hardware Driver (UHD). |
91 |
|
92 |
%package -n %{devname} |
93 |
Summary: Development files for UHD |
94 |
Group: Communications/Radio |
95 |
Requires: %{libname} = %{version}-%{release} |
96 |
Provides: %{name}-devel = %{version}-%{release} |
97 |
|
98 |
%description -n %{devname} |
99 |
Development files for the Universal Hardware Driver (UHD). |
100 |
|
101 |
%package doc |
102 |
Summary: Documentation files for UHD |
103 |
Group: Communications/Radio |
104 |
BuildArch: noarch |
105 |
|
106 |
%description doc |
107 |
Documentation for the Universal Hardware Driver (UHD). |
108 |
|
109 |
%pre -n uhd |
110 |
getent group usrp >/dev/null || groupadd -r usrp |
111 |
|
112 |
%files |
113 |
%doc _tmpdoc/* |
114 |
%{_bindir}/* |
115 |
%{_datadir}/%{name}/cal/*.fbs |
116 |
%{_udevrulesdir}/10-usrp-uhd.rules |
117 |
%{_libexecdir}/%{name} |
118 |
%{python3_sitearch}/%{name}/ |
119 |
%{python3_sitearch}/usrp_mpm/ |
120 |
|
121 |
%files -n %{libname} |
122 |
%{_libdir}/lib%{name}.so.%{major}{,.*} |
123 |
|
124 |
%files -n %{devname} |
125 |
%{_includedir}/* |
126 |
%{_libdir}/lib%{name}.so |
127 |
%{_libdir}/pkgconfig/*.pc |
128 |
%{_libdir}/cmake/%{name}/ |
129 |
|
130 |
%files doc |
131 |
%doc %{_docdir}/%{name}/ |
132 |
%{_mandir}/man1/* |