Blob Blame Raw
# Only python2 is supported
Name:		rtlsdr-scanner
Version:	1.0.22497.10311
Release:	3%{?dist}
Summary:	Frequency scanning GUI for RTL2832 based DVB-T dongles
License:	GPLv3
Group:		Applications/Engineering
URL:		http://eartoearoak.com/software/rtlsdr-scanner
Source0:	https://github.com/EarToEarOak/RTLSDR-Scanner/archive/v%{version}.tar.gz#/RTLSDR-Scanner-%{version}.tar.gz
Source1:	rtlsdr-scanner.desktop
#BuildRequires:	python2-setuptools
BuildRequires:	python2-devel, ImageMagick, desktop-file-utils
Requires:	wxPython, python2-matplotlib, python2-matplotlib-wx, numpy
Requires:	python-pillow, pyserial, python2-pyrtlsdr, hicolor-icon-theme
BuildArch:	noarch
# distribution specific patch changing paths and modularizing the code
Patch0:		rtlsdr-scanner-1.0.22497.10311-fedora.patch
Patch1:		rtlsdr-scanner-1.0.22497.10311-relative-imports.patch

%description
Frequency scanning GUI for RTL2832 based DVB-T dongles. In other
words a cheap, simple Spectrum Analyser.

%package doc
Summary:	Documentation files for rtlsdr-scanner
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch

%description doc
%{summary}.

%prep
%setup -qn RTLSDR-Scanner-%{version}
%patch0 -p1
%patch1 -p1

find src -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python2}|'

# rtlsdr_scan_diag.py is not needed in distribution
rm -f src/rtlsdr_scan_diag.py

mv src/rtlsdr_scan.py ./rtlsdr_scan

# icon
convert rtlsdr_scan.ico rtlsdr_scan.png

%build
#%%py2_build

%install
#%%py2_install

install -Dpm 0755 rtlsdr_scan %{buildroot}%{_bindir}/rtlsdr_scan
install -Dpm 0644 -t %{buildroot}%{python2_sitelib}/rtlsdr_scanner src/*
install -Dpm 0644 -t %{buildroot}%{_datadir}/%{name}/res res/*

# icon
install -Dpm 0644 rtlsdr_scan-8.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/rtlsdr_scan.png

# desktop file
mkdir -p  %{buildroot}%{_datadir}/applications
desktop-file-install --add-category="Utility" \
  --dir=%{buildroot}%{_datadir}/applications \
  %{SOURCE1}

%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :

%files
%license COPYING
%doc readme.md
%{_bindir}/rtlsdr_scan
%{_datadir}/icons/hicolor/256x256/apps/rtlsdr_scan.png
%{_datadir}/applications/rtlsdr-scanner.desktop
%{_datadir}/%{name}
%{python2_sitelib}/rtlsdr_scanner/
#%{python2_sitelib}/rtlsdr_scanner-%{version}-*.egg-info

%files doc
%doc doc/Manual.pdf

%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.22497.10311-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.22497.10311-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Oct 13 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 1.0.22497.10311-1
- New version
- Fixed imports to be relative
  Resolves: rhbz#1383513

* Tue Sep 20 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 1.0.22298.18049-3
- Rebuilt for python2-matplotlib

* Fri Jul 15 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 1.0.22298.18049-2
- Fixed icon packaging according to review

* Tue Apr 12 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 1.0.22298.18049-1
- Initial release