# By default include binary_firmware, otherwise try to rebuild # the firmware from sources. If you want to rebuild all firmware # images you need to install appropriate tools (e.g. Xilinx ISE). %bcond_without binary_firmware # NEON support is by default disabled on ARMs # building with --with=neon will enable auto detection %bcond_with neon %global ver_major 3 %global ver_minor 7 %global ver_patch 2 %global ver %(printf "%03d.%03d.%03d" %{ver_major} %{ver_minor} %{ver_patch}) %global ver_ %(printf "%03d_%03d_%03d" %{ver_major} %{ver_minor} %{ver_patch}) %global wireshark_ver %((%{__awk} '/^#define VERSION[ \t]+/ { print $NF }' /usr/include/wireshark/config.h 2>/dev/null||echo none)|/usr/bin/tr -d '"') %ifarch %{arm} %if %{without neon} %global have_neon -DHAVE_ARM_NEON_H=0 %endif %endif Name: uhd URL: http://code.ettus.com/redmine/ettus/projects/uhd/wiki Version: %{ver_major}.%{ver_minor}.%{ver_patch} Release: 1%{?dist} License: GPLv3+ BuildRequires: cmake BuildRequires: boost-devel libusb1-devel python-cheetah BuildRequires: docutils doxygen pkgconfig libpcap-devel wireshark-devel %if ! %{with binary_firmware} BuildRequires: sdcc sed %endif Requires(pre): shadow-utils Requires: tkinter Group: Applications/Engineering Summary: Universal Hardware Driver for Ettus Research products # Workaround for rhbz#1128127 %if 0%{?rhel:1} ExcludeArch: ppc64 %endif Source0: http://github.com/EttusResearch/uhd/archive/release_%{ver_}.tar.gz#/uhd-release_%{ver_}.tar.gz Source1: %{name}-limits.conf Source2: http://files.ettus.com/binaries/uhd_stable/latest_release/uhd-images_%{ver}-release.tar.gz # Fix firmware build with sdcc-3 Patch0: uhd-3.4.2-sdcc-3-fix.patch # Fix not to override distribution LDFLAGS Patch1: uhd-3.7.2-uhd-dump-libs.patch # Fix building with wireshark 1.12 Patch2: uhd-3.7.2-wireshark-1.12-fix.patch %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} #Requires: wireshark = %{wireshark_ver} %description tools Tools that are useful for working with and/or debugging USRP device, including Wireshark plugin to view Compressed HeaDeR (CHDR) formatted-packets. %prep %setup -q -n uhd-release_%{ver_} %patch0 -p1 -b .sdcc-3-fix %patch1 -p1 -b .uhd-dump-libs %patch2 -p1 -b .wireshark-1.12-fix # firmware %if %{with binary_firmware} # extract binary firmware mkdir -p images/images tar -xzf %{SOURCE2} -C images/images --strip-components=4 rm -f images/images/{LICENSE.txt,*.tag} %endif %build # firmware %if ! %{with binary_firmware} # rebuilt from sources export PATH=$PATH:%{_libexecdir}/sdcc pushd images sed -i '/-name "\*\.twr" | xargs grep constraint | grep met/ s/^/#/' Makefile make %{?_smp_mflags} images popd %endif mkdir -p host/build pushd host/build %cmake %{?have_neon} ../ make %{?_smp_mflags} popd # tools pushd tools/uhd_dump make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" popd # tools wireshark plugin # currenty disabled due to rhbz#1129419 #pushd tools/chdr-dissector #mkdir build #cd build #%%cmake ../ #make %{?_smp_mflags} #popd %check cd host/build make test %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"/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 # Package base docs to base package mkdir _tmpdoc mv %{buildroot}%{_docdir}/%{name}/{LICENSE,README.md} _tmpdoc 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 usrp_n2xx_simple_net_burner usrp_x3xx_fpga_burner; do unlink $f ln -s ../..%{_libexecdir}/uhd/$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 #install -Dpm 0755 tools/chdr-dissector/build/chdr-plugin.so %{buildroot}%{_libdir}/wireshark/plugins/%{wireshark_ver}/chdr-plugin.so %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %exclude %{_docdir}/%{name}/manual %exclude %{_docdir}/%{name}/doxygen %exclude %{_datadir}/uhd/images %doc _tmpdoc/* %{_bindir}/uhd_* %{_bindir}/usrp2* %{_bindir}/usrp_n2xx_simple_net_burner %{_bindir}/usrp_x3xx_fpga_burner %{_bindir}/nirio_programmer %{_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}/pkgconfig/*.pc %files doc %doc %{_docdir}/%{name}/manual %doc %{_docdir}/%{name}/doxygen %files tools %doc tools/README.md %{_bindir}/usrp_x3xx_fpga_jtag_programmer.sh %{_bindir}/chdr_log #%{_libdir}/wireshark/plugins/%{wireshark_ver}/chdr-plugin.so %changelog * Mon Sep 1 2014 Jaroslav Škarvada - 3.7.2-1 - New version - Added tools subpackage (wireshark plugin disabled due to rhbz#1129419) - Minor packaging fixes * Fri Aug 29 2014 Jaroslav Škarvada - 3.6.2-6 - Migrated udev rule to dynamic ACL management - Fixed udev rule location - Group usrp is no more used / created * Mon Aug 18 2014 Fedora Release Engineering - 3.6.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Fri Aug 8 2014 Jaroslav Škarvada - 3.6.2-4 - Added workaround for build failure on RHEL-7 * Sun Jun 08 2014 Fedora Release Engineering - 3.6.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Thu May 22 2014 Petr Machata - 3.6.2-2 - Rebuild for boost 1.55.0 * Tue Feb 11 2014 Jaroslav Škarvada - 3.6.2-1 - New version Resolves: rhbz#1063587 * Sun Aug 04 2013 Fedora Release Engineering - 3.5.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sat Jul 27 2013 pmachata@redhat.com - 3.5.3-2 - Rebuild for boost 1.54.0 * Wed Jun 05 2013 Jaroslav Škarvada - 3.5.3-1 - New version - Defuzzified no-neon patch * Sun Feb 10 2013 Denis Arnaud - 3.4.3-3 - Rebuild for Boost-1.53.0 * Sat Feb 09 2013 Denis Arnaud - 3.4.3-2 - Rebuild for Boost-1.53.0 * Wed Aug 22 2012 Jaroslav Škarvada - 3.4.3-1 - New version * Fri Aug 10 2012 Jaroslav Škarvada - 3.4.2-4 - Rebuilt for new boost * Sun Jul 22 2012 Fedora Release Engineering - 3.4.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Wed Jun 6 2012 Jaroslav Škarvada - 3.4.2-2 - Added firmware subpackage Resolves: rhbz#769684 * Wed May 23 2012 Jaroslav Škarvada - 3.4.2-1 - New version - Removed usrp1-r45-dbsrx-i2c-fix patch (upstreamed) - Fixed convert_test failure on ARM by no-neon patch Resolves: rhbz#813393 * Tue Mar 27 2012 Jaroslav Škarvada - 3.4.0-1 - New version - Fixed lockup on USRP1 r4.5 + DBSRX + another i2c board combo (usrp1-r45-dbsrx-i2c-fix patch) Resolves: rhbz#804440 * Mon Mar 19 2012 Jaroslav Škarvada - 3.3.2-1 - New version * Tue Feb 28 2012 Fedora Release Engineering - 3.3.1-4 - Rebuilt for c++ ABI breakage * Fri Feb 10 2012 Jaroslav Škarvada - 3.3.1-3 - Allowed UHD to boost the thread's scheduling priority Resolves: rhbz#781540 * Wed Jan 11 2012 Jaroslav Škarvada - 3.3.1-2 - Minor tweaks to %%pre scriptlet - Fixed udev rules - Added tkinter requires Resolves: rhbz#769678 * Fri Dec 2 2011 Jaroslav Škarvada - 3.3.1-1 - New version * Thu Dec 1 2011 Jaroslav Škarvada - 3.3.0-3 - Updated summary to be more descriptive * Wed Nov 30 2011 Jaroslav Škarvada - 3.3.0-2 - Fixed according to reviewer comments * Tue Nov 01 2011 Jaroslav Škarvada - 3.3.0-1 - Initial version