bladeRF/bladeRF.spec

158 lines
3.6 KiB
RPMSpec

#
# spec file for package bladeRF
#
# Copyright (c) 2013-2015 Wojciech Kazubski, wk@ire.pw.edu.pl
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
#norootforbuild
%define soname 1
%define release_name 2015.07
Name: bladeRF
Version: 1.2.1
Release: 3.1
Summary: SDR radio receiver
License: GPL-2.0
%if 0%{?suse_version}
Group: Productivity/Hamradio/Other
%endif
%if 0%{?fedora}
Group: Applications/Engineering
%endif
Source: https://github.com/Nuand/bladeRF/archive/%{release_name}.tar.gz
URL: http://nuand.com/
BuildRoot: %{_tmppath}/build-%{name}-%{version}
BuildRequires: cmake >= 2.8.4
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: pkg-config
BuildRequires: udev
%if 0%{?suse_version}
BuildRequires: libusb-1_0-devel
#BuildRequires: libtecla-devel
BuildRequires: help2man
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
%endif
%if 0%{?fedora}
BuildRequires: libusb1-devel
%endif
%ifarch != armv7l
%if 0%{?suse_version} == 1320 || 0%{?fedora} >= 20
BuildRequires: pandoc
%endif
%endif
%description
The software for bladeRF USB 3.0 Superspeed Software Defined Radio
%if 0%{?suse_version}
%define libname libbladeRF%{soname}
%else
%define libname libbladeRF
%endif
%package -n %{libname}
Version: 1.4.3
Summary: Library for bladeRF
Group: Hardware/Other
Requires: udev
%description -n %{libname}
Library for bladeRF, SDR transceiver.
%package -n %{libname}-devel
Version: 1.4.3
Summary: Development files for libbladeRF
Group: Development/Libraries/Other
Requires: %{libname} = %{version}-%{release}
Obsoletes: %{name}-devel
%description -n %{libname}-devel
Libraries and header files for developing applications that want to make
use of libbladerf.
%prep
%setup -q -n %{name}-%{release_name}
%build
cd host
mkdir build
cd build
cmake .. \
%ifarch x86_64
-DLIB_SUFFIX=64 \
%endif
%if 0%{?suse_version}
-DBUILD_DOCUMENTATION=ON \
%endif
-DCMAKE_INSTALL_PREFIX=%{_prefix}
make %{?_smp_mflags}
%install
cd host/build
make DESTDIR=%{buildroot} install
#move udev rules
%if 0%{?suse_version} >= 1310 || 0%{?fedora} >= 19
mkdir -p %{buildroot}%{_udevrulesdir}
mv %{buildroot}%{_sysconfdir}/udev/rules.d/88-nuand.rules %{buildroot}%{_udevrulesdir}
%endif
%clean
rm -rf %{buildroot}
%if 0%{?suse_version}
%post -n %{libname}
/sbin/ldconfig
%udev_rules_update
%postun -n %{libname}
/sbin/ldconfig
%udev_rules_update
%else
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%endif
%files
%defattr(-,root,root)
%{_bindir}/bladeRF-*
%if 0%{?suse_version}
%{_mandir}/man1/bladeRF-cli.1.gz
%endif
%doc README.md COPYING CONTRIBUTORS
%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/libbladeRF.so.*
%if 0%{?suse_version} >= 1310 || 0%{?fedora} >= 19
%{_udevrulesdir}/88-nuand.rules
%else
%config(noreplace) %{_sysconfdir}/udev/rules.d/88-nuand.rules
%endif
%files -n %{libname}-devel
%defattr(-,root,root)
%{_libdir}/libbladeRF.so
%{_includedir}/libbladeRF.h
%{_libdir}/pkgconfig/libbladeRF.pc
%changelog