File QLandkarteGT.spec of Package QLandkarteGT

#
# spec file for package QLandkarteGT
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define garmindev_name garmindev-0.3.4
%define qlandkartegt_name qlandkartegt

Name:           QLandkarteGT
Summary:        Garmin GPS Map, Route, Waypoint and Tracking Tool
License:        GPL-2.0-or-later
Group:          Productivity/Other
Version:        1.8.1
Release:        0
Url:            http://www.qlandkarte.org/
Source0:        %{qlandkartegt_name}-%{version}.tar.xz
Source1:        %{garmindev_name}.tar.xz
Patch0:         %{qlandkartegt_name}-1.7.7_agent_osm.patch
BuildRequires:  Mesa-libGLU-devel
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libQtWebKit-devel >= 4.7
BuildRequires:  libexif-devel
BuildRequires:  libgdal-devel
BuildRequires:  libproj-devel
BuildRequires:  libqt4-devel >= 4.7
BuildRequires:  libusb-devel
BuildRequires:  update-desktop-files

%description
QLandkarte GT is the ultimate outdoor aficionado's tool. It supports GPS maps in GeoTiff format as well as Garmin's img vector map format. Additional it is the PC side front end to QLandkarte M, a moving map application for mobile devices. And it fills the gap Garmin leaves in refusing to support Linux. QLandkarte GT is the proof that writing portable applications for Unix, Windows and OSX is feasible with a minimum of overhead. No excuses!

QLandkarte GT does replace the original QLandkarte with a much more flexible architecture. It's not limited to a map format or device. Thus if you think your Magellan GPS or other should be supported, join the team.

Additionally it is a front end to the GDAL tools, to make georeferencing scanned maps feasible for the normal user. Compared to similar tools like QGis, it's target users are more on the consumer side than on the scientific one. QLandkarte GT might not let you select every possible feature of the GDAL tools, but it will simplify their use to the demands of most users.

%package driver-garmin
Summary:        Driver for Garmin devices
Group:          System/Libraries
Requires:       %{name} = %{version}

%description driver-garmin
This is the driver package for Garmin devices.

%package driver-garmin-devel
Summary:        Development files for %{name}-driver-garmin
Group:          Development/Libraries/C and C++
Requires:       %{name}-driver-garmin = %{version}

%description driver-garmin-devel
This is the development package for the QLandkarte GT Garmin driver.

%prep
%setup -q -b 1 -n %{garmindev_name}
%setup -q -n %{qlandkartegt_name}-%{version}
%patch0 -p1

%build
%cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now"
%cmake_build
cd ../../%{garmindev_name}
%cmake -DCMAKE_BUILD_TYPE=Release
%cmake_build

%install
%cmake_install
%{__install} -d -m 0755 %{buildroot}%{_libdir}/%{qlandkartegt_name}
%{__install} -m 0755 -p -t %{buildroot}%{_libdir}/%{qlandkartegt_name} build/lib/*.so
%suse_update_desktop_file -r %{qlandkartegt_name} Education Science Geography
cd ../%{garmindev_name}
%cmake_install
%if 0%{?suse_version} && ( 0%{?suse_version} > 1500 || ( 0%{?is_opensuse} && 0%{?suse_version} == 1500 && 0%{?sle_version} && 0%{?sle_version} >= 150200 ) )
export NO_BRP_CHECK_RPATH=true
%endif

%post
/sbin/ldconfig

%post driver-garmin
/sbin/ldconfig

%postun
/sbin/ldconfig

%postun driver-garmin
/sbin/ldconfig

%files
%defattr(-,root,root)
%attr(755,root,root) %{_bindir}/*
%{_datadir}/applications/%{qlandkartegt_name}.desktop
%{_datadir}/pixmaps/%{qlandkartegt_name}.png
%{_datadir}/%{qlandkartegt_name}
%{_libdir}/%{qlandkartegt_name}/libSerialPort.so
%{_libdir}/%{qlandkartegt_name}/lib[q-t]*.so
%{_mandir}/man?/%{qlandkartegt_name}.1%{?ext_man}
%license LICENSE

%files driver-garmin
%defattr(-,root,root)
%dir %{_libdir}/%{qlandkartegt_name}
%{_libdir}/%{qlandkartegt_name}/libwhatGarmin.so
%{_libdir}/%{qlandkartegt_name}/lib[A-R]*.so

%files driver-garmin-devel
%defattr(-,root,root)
%dir %{_includedir}/garmin
%dir %{_libdir}/%{qlandkartegt_name}
%{_includedir}/garmin/*.h
%{_libdir}/%{qlandkartegt_name}/*.a

%changelog
openSUSE Build Service is sponsored by