File wsjt.spec of Package wsjt

#
# spec file for package wsjt
#
# Copyright (c) 2017 Walter Fey DL8FCL
#
# This file is under MIT license

Name:		wsjt
Version:        10.0.r6005
Release:        0
License:        GPL-2.0
Summary:	Weak-signal amateur radio communications
URL:            http://physics.princeton.edu/pulsar/K1JT
Group:          Productivity/Hamradio/Other
Source0:	%{name}-%{version}.tar.xz
Source1:        readme_opensuse
Source2:        wsjt.png
Patch0:         astro.py.diff
Patch1:         Makefile.in.diff
Patch2:         wsjt_python3.diff
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

BuildRequires:  alsa-devel
BuildRequires:  f2c
BuildRequires:  fftw3-devel
BuildRequires:  gcc-fortran
BuildRequires:  libsamplerate-devel
BuildRequires:  portaudio-devel
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-numpy-devel
BuildRequires:  tcl-devel
BuildRequires:  tk-devel
BuildRequires:  update-desktop-files

Requires:	python3
Requires:       python3-tk
Requires:	python3-numpy

%if 0%{suse_version} != 1315
Requires:       python3-Pillow-tk
%endif

%if 0%{suse_version} == 1315
Requires:       python3-Pillow
%endif

%ifarch == x86_64
Requires:       libgfortran3-32bit
%endif

%description
WSJT is a computer program designed to facilitate Amateur Radio
communication under extreme weak-signal conditions.  Three very
different coding and modulation methods are provided: one for
communication by "meteor scatter" techniques on the VHF bands; one for
meteor and ionospheric scatter, primarily on the 6 meter band; and one
for the very challenging EME (Earth-Moon-Earth) path.

 Authors:  
 --------  
     K1JT    -   Joe Taylor

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

# coding definition is missing in the file wsjt.py.
# Direct editing the file is easier than patching
sed -i '/env python/ a\
# -*- coding: latin-1 -*-
' wsjt.py

sed -i 's|#!/usr/bin/env python|#!/usr/bin/python3|' wsjt.py


%build 
%configure \
    --with-portaudio-include-dir=%{_includedir} \
    --with-portaudio-lib-dir=%{_libdir}
make

%install
strip --strip-unneeded WsjtMod/Audio.so

install -D wsjt %{buildroot}%{_bindir}/wsjt
install wsjt.py %{buildroot}%{_bindir}
install -D -m 644 CALL3.TXT %{buildroot}%{_datadir}/%{name}/CALL3.TXT
install -m 644 wsjtrc dmet_*.dat %{buildroot}%{_datadir}/%{name}
install -d %{buildroot}/%{python3_sitearch}/WsjtMod
install -m 644 WsjtMod/*.py WsjtMod/*.so %{buildroot}/%{python3_sitearch}/WsjtMod
install -m 644 Pmw.py %{buildroot}/%{python3_sitearch}
install -m 644 PmwBlt.py %{buildroot}/%{python3_sitearch}
install -m 644 PmwColor.py %{buildroot}/%{python3_sitearch}
install -D -m 644 LICENSE.TXT  %{buildroot}/%{_docdir}/%{name}/LICENSE.TXT
install -m 644 "%{SOURCE1}" %{buildroot}/%{_docdir}/%{name}

%suse_update_desktop_file -c wsjt Wsjt "Weak-signal communications" wsjt wsjt "Network;HamRadio"

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_bindir}/*
%{python3_sitearch}/*
%{_datadir}/pixmaps/wsjt.png
%{_datadir}/%{name}
%{_datadir}/applications/wsjt.desktop
%{_docdir}/%{name}

%changelog
openSUSE Build Service is sponsored by