File qvnamax.spec of Package qvnamax

#
# spec file for package qvnamax
#
%ifarch  %ix86 x86_64
%define with_parport 1
%endif
%if 0%{?sle_version} >= 150600 || %{?suse_version} > 1600
%define with_rmb 0
%else
%define with_rmb 1
%endif

Name:           qvnamax
Version:        0.3.4
Release:        11.1
License:        GPL-3.0
Summary:        Control program for VNA by IW3HEV
Url:            http://www.ire.pw.edu.pl/~wkazubski/software/qvnamax_eng.html
Group:          Development/Tools/Other
Source0:        %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Patch1:         %{name}-remove-old-serialport-header.patch
Patch0:         %{name}-opensuse-qwt-location.patch
Patch2:         %{name}-opensuse-qwt-location-mod.patch
%if 0%{?suse_version} >=1330
%define x_qmake qmake-qt5
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libqt5-qtserialport-devel
BuildRequires:  qwt6-qt5-devel
%if 0%{with_rmb}
BuildRequires:  qwt-rmb-qt5-devel
%endif
%else
%define x_qmake qmake 
BuildRequires:  libqt4-devel >= 4.7.0
BuildRequires:  qtserialport-devel
BuildRequires:  qwt6-devel
BuildRequires:  qwt-rmb-devel
%endif
BuildRequires:  update-desktop-files
BuildRequires:  hicolor-icon-theme
Requires:       hicolor-icon-theme

%description
qVNAmax is a software to control antenna analysers based on IW2HEV design, 
including original analyser by IW2HEV, VNA 3p2 by SP3SWJ, miniVNA,
MAX 2, MAX 3 and MAX6 analysers by SP3SWJ.
Those analyzes can measure impedance of antenna (or other circut) connected to
its terminals in range from near 0 to 70, 180, or 500MHz, depending on DDS chip
used. Some can also measure transmitance of two port circuits (filters,
transmission lines).

%prep
%setup -q -n qVNAmax-%{version}.1
%if 0%{?sle_version} <= 150500 && 0%{?sle_version} >= 150300
%patch -P 2 -p1
%else
%patch -P 0 -p1
%endif
%patch -P 1 -p1

%build
%{x_qmake} PREFIX=/usr \
%if 0%{with_parport}
  "CONFIG += ad9851" \
%endif
%if 0%{with_rmb}
  "CONFIG += qwt-rmb" \
%endif
  %{name}.pro
%make_build

%install
make INSTALL_ROOT=%{buildroot} install 

#create desktop file
mkdir -p %{buildroot}%{_datadir}/applications
cp %{name}.desktop %{buildroot}%{_datadir}/applications
%suse_update_desktop_file -r %{name} Network HamRadio

%check

%files
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%doc AUTHORS ChangeLog NEWS README.md TODO
%license LICENSE
%{_datadir}/icons/hicolor/*/apps/%{name}.png

%changelog
openSUSE Build Service is sponsored by