Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 9f723418ec9a902ad056394b37e9625b > files > 4

hackrf-2014.08.1-1.mga5.src.rpm

%global commit 69c4997727a5c4740d7d5a187f7030cca513deff
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%define major   0
%define libname %mklibname %{name} %{major}
%define devname %mklibname %{name} -d
#define devstat %mklibname %{name} -d -s

Name:           hackrf
Version:        2014.08.1
Release:        %mkrel 1
Summary:        A project to produce a low cost open source software radio platform
Group:          Communications/Radio
License:        GPLv2
URL:            https://github.com/mossmann/%{name}/wiki
Source0:        https://github.com/mossmann/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz

# https://github.com/mossmann/hackrf/pull/140
Patch0:         %{name}-2014.08.1-lib-suffixes.patch
# https://github.com/mossmann/hackrf/pull/141
Patch1:         %{name}-2014.08.1-udev-install-dir.patch

BuildRequires:  cmake
BuildRequires:  pkgconfig(libusb)
BuildRequires:  systemd

%description
Hardware designs and software for HackRF, a project to produce a low cost, open
source software radio platform.

%package -n %{libname}
Summary:        Library files for %{name}
Requires:       %{name} = %{version}-%{release}

%package -n %{devname}
Summary:        Development files for %{name}
Requires:       %{libname} = %{version}-%{release}
Provides:       %{name}-devel = %{version}-%{release}

%package doc
Requires:       %{name} = %{version}-%{release}
Summary:        Supplemental documentation for HackRF
BuildArch:      noarch

%if %{defined devstat}
%package -n %{devstat}
Summary:        Static libraries for libhackrf
Requires:       %{name}-devel = %{version}-%{release}
Provides:       %{name}-static-devel = %{version}-%{release}

%description -n %{devstat}
Static libraries for libhackrf.

%files -n %{devstat}
%{_libdir}/libhackrf.a
%endif

%description -n %{devname}
Files needed to develop software against libhackrf.

%description -n %{libname}
hackrf library files.

%description doc
Supplemental documentation for HackRF. For more information, visit the wiki at
https://github.com/mossmann/hackrf/wiki



%prep
%setup -q -n %{name}-%{commit}
%apply_patches

# Fix "plugdev" nonsense
sed -i -e 's/GROUP="plugdev"/ENV{ID_SOFTWARE_RADIO}="1"/g' host/libhackrf/53-hackrf.rules

%build
%cmake ../host \
    -DINSTALL_UDEV_RULES=on \
    -DUDEV_INSTALL_DIR:PATH=%{_udevrulesdir}

%make

%install
%makeinstall_std -C build

%if ! %{defined devstat}
rm -f %{buildroot}%{_libdir}/libhackrf.a
%endif

%files
%doc TRADEMARK Readme.md
%{_bindir}/hackrf_*
%{_udevrulesdir}/53-hackrf.rules

%files -n %{libname}
%{_libdir}/libhackrf.so.%{major}*

%files -n %{devname}
%{_includedir}/libhackrf/hackrf.h
%{_libdir}/pkgconfig/libhackrf.pc
%{_libdir}/libhackrf.so



%files doc
%doc doc/*


%changelog
* Sat Jan 17 2015 barjac <barjac> 2014.08.1-1.mga5
+ Revision: 811099
- Import hackRF based loosely on Fedora with thanks