%define major 4 %define libname %mklibname %{name} %{major} %define devname %mklibname %{name} -d # comment out if not prerel #define prel rc1 # Release %define rel 1 Name: uhd Summary: Universal Hardware Driver for Ettus Research products Version: 4.7.0.0 Release: %mkrel %{?prel:0.%prel.}%{rel} Group: Communications/Radio License: GPLv3+ Url: http://uhd.ettus.com/ Source0: https://github.com/EttusResearch/uhd/archive/v%{version}%{?prel:-%prel}/%{name}-%{version}%{?prel:-%prel}.tar.gz # Bug tracker https://github.com/EttusResearch/uhd/issues BuildRequires: cmake BuildRequires: boost-devel BuildRequires: git BuildRequires: pkgconfig(ncurses) BuildRequires: pkgconfig(libgps) BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(python3) BuildRequires: python3-docutils BuildRequires: python3-mako BuildRequires: python3-numpy-devel BuildRequires: python3-requests BuildRequires: python3-ruamel-yaml BuildRequires: python3-setuptools BuildRequires: doxygen BuildRequires: pkgconfig %description The UHD is the universal hardware driver for Ettus Research products. The goal of the UHD is to provide a host driver and API for current and future Ettus Research products. It can be used standalone without GNU Radio. %prep %autosetup -p1 -n %{name}-%{version}%{?prel:-%prel} %build %global _vpath_srcdir host %cmake \ -DCMAKE_SKIP_RPATH=ON \ -DENABLE_UTILS=ON \ -DENABLE_E100=ON \ -DENABLE_E300=ON \ -DENABLE_PYTHON_API=ON \ -DENABLE_PYTHON3=ON \ -DENABLE_TESTS=OFF \ -DENABLE_EXAMPLES=OFF \ %ifarch %arm -DNEON_SIMD_ENABLE=OFF %endif %cmake_build %install %cmake_install # Allow access only to users in usrp group mkdir -p %{buildroot}%{_udevrulesdir} mv %{buildroot}%{_libdir}/uhd/utils/uhd-usrp.rules %{buildroot}%{_udevrulesdir}/10-usrp-uhd.rules sed -i 's/MODE:="0666"/MODE:="0660"/' %{buildroot}%{_udevrulesdir}/10-usrp-uhd.rules # Remove binaries for tests, examples rm -rf %{buildroot}%{_libdir}/uhd/{tests,examples} # Move the utils stuff to libexec dir mkdir -p %{buildroot}%{_libexecdir}/uhd mv %{buildroot}%{_libdir}/uhd/utils %{buildroot}%{_libexecdir}/uhd/utils mv %{buildroot}%{_datadir}/uhd/rfnoc %{buildroot}%{_libexecdir}/uhd/ # Package base docs to base package mkdir _tmpdoc mv %{buildroot}%{_docdir}/%{name}/{LICENSE,README.md} _tmpdoc # Make version sane in uhd.pc sed -i '/Version/c Version: %{version}' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc %package -n %{libname} Summary: Library files Group: Communications/Radio Requires: %{name} = %{version}-%{release} %description -n %{libname} Library files for the Universal Hardware Driver (UHD). %package -n %{devname} Summary: Development files for UHD Group: Communications/Radio Requires: %{libname} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} %description -n %{devname} Development files for the Universal Hardware Driver (UHD). %package doc Summary: Documentation files for UHD Group: Communications/Radio BuildArch: noarch %description doc Documentation for the Universal Hardware Driver (UHD). %pre -n uhd getent group usrp >/dev/null || groupadd -r usrp %files %doc _tmpdoc/* %{_bindir}/* %{_datadir}/%{name}/cal/*.fbs %{_udevrulesdir}/10-usrp-uhd.rules %{_libexecdir}/%{name} %{python3_sitearch}/%{name}/ %{python3_sitearch}/usrp_mpm/ %files -n %{libname} %{_libdir}/lib%{name}.so.%{major}{,.*} %files -n %{devname} %{_includedir}/* %{_libdir}/lib%{name}.so %{_libdir}/pkgconfig/*.pc %{_libdir}/cmake/%{name}/ %files doc %doc %{_docdir}/%{name}/ %{_mandir}/man1/*