%global pkgvers 0 %global scdate0 20241129 %global schash0 87c4ff673a9e0d095d568f12e85f02d688aba727 %global branch0 master %global source0 https://github.com/EttusResearch/uhd.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: uhd Version: 4.7.0.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Universal Hardware Driver for Ettus Research products License: GPLv3+ URL: https://github.com/EttusResearch/uhd Source1: %{name}-limits.conf Patch0: uhd-py.patch BuildRequires: gcc-c++ cmake git pkgconfig doxygen vim-common python3 python3-devel BuildRequires: python3-mako python3-requests python3-docutils pybind11-devel python3-setuptools BuildRequires: libpcap-devel ncurses-devel boost-devel libusb1-devel python3-cheetah BuildRequires: python3-numpy python3-ruamel-yaml Requires: python3-tkinter %global __cmake_in_source_build 1 %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. %package firmware Summary: Firmware files for UHD Requires: %{name} = %{version}-%{release} BuildArch: noarch %description firmware Firmware files for the Universal Hardware driver (UHD). %package devel Summary: Development files for UHD Requires: %{name} = %{version}-%{release} %description devel Development files for the Universal Hardware Driver (UHD). %package doc Summary: Documentation files for UHD BuildArch: noarch %description doc Documentation for the Universal Hardware Driver (UHD). %package tools Summary: Tools for working with / debugging USRP device Requires: %{name} = %{version}-%{release} %description tools Tools that are useful for working with and/or debugging USRP device. %package python3 Summary: Python libs working with / debugging USRP device Requires: %{name} = %{version}-%{release} %description python3 Python libs for working with and/or debugging USRP device. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller %patch -P 0 -p1 -b .py3~ # fix python shebangs find . -type f -name "*.py" -exec sed -i '/^#!/ s|.*|#!%{__python3}|' {} \; %build # ext pybind11 rm -rf host/lib/deps/pybind11 sed -i '/pybind11/d' host/lib/deps/CMakeLists.txt # firmware pushd images mkdir -p images python3 ../host/utils/uhd_images_downloader.py.in \ -i %{_builddir}/%{name}/images/images \ -m manifest.txt popd # build mkdir -p host/build pushd host/build %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_SKIP_BUILD_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DUHD_VERSION="%{scdate0}.%{pkgvers}.git%{sshort0}%{?dist}" \ %ifarch aarch64 -DHAVE_ARM_NEON_H=1 \ %endif -DENABLE_TESTS=OFF \ -DENABLE_DPDK=OFF \ -DENABLE_PYTHON_API=ON \ -DPYTHON_EXECUTABLE="%{__python3}" make %{?_smp_mflags} popd # tools pushd tools/uhd_dump make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" popd %install pushd host/build make install DESTDIR=%{buildroot} # Fix udev rules and use dynamic ACL management for device sed -i 's/BUS==/SUBSYSTEM==/;s/SYSFS{/ATTRS{/;s/MODE:="0666"/GROUP:="usrp" MODE:="0660", ENV{ID_SOFTWARE_RADIO}="1"/' %{buildroot}%{_libdir}/uhd/utils/uhd-usrp.rules mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d mv %{buildroot}%{_libdir}/uhd/utils/uhd-usrp.rules %{buildroot}%{_prefix}/lib/udev/rules.d/10-usrp-uhd.rules # Remove tests, examples binaries 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 popd install -m 644 -D %{SOURCE1} %{buildroot}%{_sysconfdir}/security/limits.d/99-usrp.conf # firmware mkdir -p %{buildroot}%{_datadir}/uhd/images cp -r images/images/* %{buildroot}%{_datadir}/uhd/images # remove win stuff rm -rf %{buildroot}%{_datadir}/uhd/images/winusb_driver # convert hardlinks to symlinks (to not package the file twice) pushd %{buildroot}%{_bindir} for f in uhd_images_downloader usrp2_card_burner do unlink $f ln -s ../..%{_libexecdir}/uhd/${f}.py $f done popd # tools install -Dpm 0755 tools/usrp_x3xx_fpga_jtag_programmer.sh %{buildroot}%{_bindir}/usrp_x3xx_fpga_jtag_programmer.sh install -Dpm 0755 tools/uhd_dump/chdr_log %{buildroot}%{_bindir}/chdr_log # remove spurious rm -rf %{buildroot}/usr/share/doc rm -rf %{buildroot}%{_datadir}/uhd/images/bit rm -rf %{buildroot}%{_datadir}/uhd/images/winusb* %ldconfig_scriptlets %pre getent group usrp >/dev/null || \ %{_sbindir}/groupadd -r usrp >/dev/null 2>&1 exit 0 %files %doc README.md %doc CHANGELOG %license LICENSE.md %exclude %{_datadir}/uhd/images %{_bindir}/* %{_prefix}/lib/udev/rules.d/10-usrp-uhd.rules %config(noreplace) %{_sysconfdir}/security/limits.d/*.conf %{_libdir}/lib*.so.* %{_libexecdir}/uhd %{_mandir}/man1/*.1* %{_datadir}/uhd %files firmware %dir %{_datadir}/uhd/images %{_datadir}/uhd/images/* %files devel %{_includedir}/* %{_libdir}/lib*.so %{_libdir}/cmake/uhd/*.cmake %{_libdir}/pkgconfig/*.pc %files doc %doc host/build/docs/doxygen/html %files tools %doc tools/README.md %{_bindir}/usrp_x3xx_fpga_jtag_programmer.sh %{_bindir}/chdr_log %files python3 %{python3_sitearch}/* %changelog * Tue Aug 21 2018 Balint Cristian - github update releases