File merkaartor.spec of Package merkaartor

#
# spec file for package merkaartor
#
# Copyright © 2008–2013 Dirk Stöcker <opensuse@dstoecker.de>
# Copyright © 2015 Angelos Tzotsos <tzotsos@opensuse.org>
# Copyright © 2017 Luigi Baldoni <aloisio@gmx.com>
# Copyright © 2018–2021 Markus S. <kamikazow@opensuse.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

%ifarch %{ix86} x86_64 %{arm} aarch64 riscv64
%bcond_without qtwebengine
%endif
Name:           merkaartor
Version:        0.19.0
Release:        0
Summary:        OpenStreetMap editor focused on good desktop integration
License:        GPL-3.0-or-later
Group:          Productivity/Graphics/Other
URL:            http://merkaartor.be/
Source:         %{name}-%{version}.tar.gz
Source1:        merkaartor.xml
# PATCH-FIX-OPENSUSE
Patch0:         0001-Work-around-upstream-version-check.patch
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_serialization-devel
BuildRequires:  netcdf-devel
BuildRequires:  pkgconfig
BuildRequires:  proj-devel
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5Gui)
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  cmake(Qt5Network)
BuildRequires:  cmake(Qt5NetworkAuth)
BuildRequires:  cmake(Qt5PrintSupport)
BuildRequires:  cmake(Qt5Svg)
BuildRequires:  cmake(Qt5Test)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5Xml)
BuildRequires:  pkgconfig(Qgpsmm)
BuildRequires:  pkgconfig(exiv2)
BuildRequires:  pkgconfig(gdal)
BuildRequires:  pkgconfig(libproxy-1.0)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(libxslt)
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(zbar)
BuildRequires:  pkgconfig(zbar-qt)
%if %{with qtwebengine}
BuildRequires:  cmake(Qt5WebEngine)
%endif

%description
Merkaartor is a editor for OpenStreetMap, focusing on good desktop integration.

It has some unique features like anti-aliased displaying,
transparent display of map features like roads and true curved roads.

%prep
%autosetup -p1

# 'gpsd' is not the pkgconfig name
sed -i 's#PKGCONFIG_REQUIRED_LIBS gpsd#PKGCONFIG_REQUIRED_LIBS libgps#' CMakeLists.txt

# Fix plugin location
sed -i "s#lib/merkaartor#%{_lib}/merkaartor#" plugins/plugins.cmake

%build
%cmake \
  -DZBAR=TRUE \
  -DGEOIMAGE=FALSE \
  -DGPSD=TRUE \
  -DGEOIMAGE=TRUE \
%if %{with qtwebengine}
  -DWEBENGINE=TRUE
%endif

%cmake_build

%install
%cmake_install

install -d 755 %{buildroot}%{_datadir}/mime/packages/
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/mime/packages/
pushd %{buildroot}%{_datadir}/icons/hicolor
rm -r 40x40 42x42 80x80 8x8

%fdupes -s %{buildroot}

%files
%doc AUTHORS CHANGELOG HACKING.md
%license LICENSE
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/org.merkaartor.merkaartor.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/metainfo/org.merkaartor.merkaartor.appdata.xml
%{_datadir}/mime/packages/merkaartor.xml
%{_libdir}/%{name}/

%changelog
openSUSE Build Service is sponsored by