File cqrlog.spec of Package cqrlog

#
# spec file for package cqrlog
#
# Copyright (c) 2013-2024 Walter Fey DL8FCL
#
# This file is under MIT license

%define date 20240922

%global cqrlog_flavor @BUILD_FLAVOR@%{nil}
%if "%{cqrlog_flavor}" == ""
ExclusiveArch:  do_not_build
%endif
%if "%{cqrlog_flavor}" == "gtk"
%define gtk 1
%endif
%if "%{cqrlog_flavor}" == "qt5"
%define qt5 1
%define pkg_suffix -qt5
%endif

Name:           cqrlog%{?pkg_suffix}
Version:        2.6.0+git%{date}
Release:        0
License:        GPL-2.0-only
Summary:        Advanced ham radio log program
Url:            https://www.cqrlog.com/
Group:          Productivity/Hamradio/Logging
Source:         cqrlog-%{version}.tar.xz

BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  lazarus
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(openssl)
%if 0%{?gtk}
BuildRequires:  pkgconfig(gtk+-2.0)
Conflicts:      cqrlog-qt5
%endif
%if 0%{?qt5}
BuildRequires:  libQt5Pas-devel
Conflicts:      cqrlog
%endif
Requires:       libmariadb-devel
Recommends:     hamlib
Recommends:     tqsl
Recommends:     xplanet

%description
CQRLOG is an advanced ham radio logger based on MySQL database. Provides radio
control based on hamlib libraries, DX cluster connection, online callbook,
a grayliner, internal QSL manager database support and a most accurate country
resolution algorithm based on country tables developed by OK1RR. CQRLOG is
intended for daily general logging of HF, CW & SSB contacts and strongly
focused on easy operation and maintenance.

%prep
%setup -q -n cqrlog-%{version}
dos2unix members/*
dos2unix ctyfiles/*
iconv -f iso8859-1 -t utf-8 ctyfiles/eqsl.txt -o ctyfiles/eqsl.txt_conv
mv ctyfiles/eqsl.txt_conv ctyfiles/eqsl.txt

%build
%if 0%{?gtk}
make %{?_smp_mflags}
%endif
%if 0%{?qt5}
make cqrlog_qt5 %{?_smp_mflags}
%endif

%install
%make_install DESTDIR=%{buildroot}/usr
%suse_update_desktop_file -i -r cqrlog "Network;HamRadio"
%fdupes -s %{buildroot}/%{_datadir}

%files
%license COPYING
%doc AUTHORS CHANGELOG README.md
%{_bindir}/cqrlog
%{_datadir}/applications/cqrlog.desktop
%{_datadir}/icons/hicolor/128x128/apps/cqrlog.png
%{_datadir}/icons/hicolor/256x256/apps/cqrlog.png
%{_datadir}/icons/hicolor/32x32/apps/cqrlog.png
%{_datadir}/icons/hicolor/48x48/apps/cqrlog.png
%{_datadir}/icons/hicolor/64x64/apps/cqrlog.png
%{_datadir}/cqrlog/
%{_datadir}/metainfo/com.cqrlog.cqrlog.appdata.xml
%{_mandir}/man1/cqrlog.1.gz

%changelog
openSUSE Build Service is sponsored by