File rtl-sdr.spec of Package rtl-sdr-keenerd

#
# spec file for package rtl-sdr
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define rtlsdr_group	rtlsdr
%define soname		0

Name:           rtl-sdr
Version:        0.0.0.git1430261654.86f9503
Release:        0
Summary:        Support programs for RTL2832
License:        GPL-2.0
Group:          Productivity/Hamradio/Other
Url:            http://sdr.osmocom.org/trac/wiki/rtl-sdr
Source:         %{name}-%{version}.tar.xz
Patch0:		rtl-sdr-better-udev-handling.diff
BuildRequires:  cmake
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(libusb-1.0)
# for git-version-gen
BuildRequires:  git-core
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Programs that controls Realtek RTL2832 based DVB dongle in raw mode, so
it can be used as a SDR receiver.

%package -n librtlsdr%{soname}
Summary:        SDR driver for RTL2832
Group:          Hardware/Other

%description -n librtlsdr%{soname}
Library to run Realtek RTL2832 based DVB dongle as a SDR receiver.

%package devel
Summary:        Development files for rtl-sdr
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description devel
Library headers for rtl-sdr driver.

%prep
%setup -q
%patch0 -p1

%build
%cmake .. \
        -DCMAKE_BUILD_TYPE=Release \
        -DINSTALL_UDEV_RULES=ON \
        -DUDEV_RULES_PATH=%{_udevrulesdir} \
        -DUDEV_RULES_GROUP=%{rtlsdr_group} \
	-DDETACH_KERNEL_DRIVER=ON

make VERBOSE=1 %{?_smp_mflags}

%install
%cmake_install
# remove uneeded files
rm %{buildroot}%{_libdir}/librtlsdr.a

%pre
%{_sbindir}/groupadd -r %{rtlsdr_group} 2> /dev/null || :


%post   -n librtlsdr%{soname} -p /sbin/ldconfig
%postun -n librtlsdr%{soname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS COPYING README
%{_bindir}/rtl_*

%files -n librtlsdr%{soname}
%defattr(-,root,root)
%{_libdir}/librtlsdr.so.*
%{_udevrulesdir}/rtl-sdr.rules

%files devel
%defattr(-,root,root)
%{_libdir}/librtlsdr.so
%{_includedir}/*.h
%{_libdir}/pkgconfig/librtlsdr.pc

%changelog
openSUSE Build Service is sponsored by