File navit.spec of Package navit

#
# spec file for package navit
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           navit
Version:        0.5.6
Release:        0
Summary:        Open source car navigation software
License:        GPL-2.0-only
URL:            https://www.navit-project.org/
Source:         https://github.com/navit-gps/navit/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        osm_sample_bbox.osm.bz2
BuildRequires:  SDL-devel
BuildRequires:  cmake
BuildRequires:  espeak-devel
BuildRequires:  espeak-devel
BuildRequires:  freeglut-devel
BuildRequires:  freetype-devel
BuildRequires:  gcc-c++
BuildRequires:  gd-devel
BuildRequires:  gettext-devel
BuildRequires:  gpsd-devel
BuildRequires:  libgarmin-devel
BuildRequires:  libgypsy-devel
BuildRequires:  libprotobuf-c-devel
BuildRequires:  libxslt-devel
BuildRequires:  pkgconfig
BuildRequires:  postgresql-devel
BuildRequires:  protobuf-devel
BuildRequires:  python-devel
BuildRequires:  pkgconfig(gtk+-2.0)
#Requires:	espeak
#Requires:	gpsd
Requires:       liberation-fonts
%if 0%{?suse_version}
BuildRequires:  SDL_image-devel
BuildRequires:  clutter-devel
BuildRequires:  clutter-gtk-devel
BuildRequires:  fdupes
BuildRequires:  libGLC-devel
BuildRequires:  speechd-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(dbus-glib-1)
%else
BuildRequires:  librsvg2
%endif
%if 0%{?sle_version} == 150200 || 0%{?suse_version} > 1500
BuildRequires:  rsvg-convert
%else
BuildRequires:  rsvg-view
%endif
%if 0%{?mandriva_version}
BuildRequires:  libgpsd-devel
BuildRequires:  libx11-devel
BuildRequires:  libxinerama-devel
BuildRequires:  libxv-devel
%else
BuildRequires:  gpsd-devel
%endif
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
BuildRequires:  libX11-devel
BuildRequires:  libXinerama-devel
BuildRequires:  libXv-devel
%endif
%if 0%{?suse_version} > 1320
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5Multimedia)
BuildRequires:  cmake(Qt5Positioning)
BuildRequires:  cmake(Qt5QuickControls2)
BuildRequires:  cmake(Qt5Sensors)
BuildRequires:  cmake(Qt5Svg)
#BuildRequires:  cmake(Qt5WebKit)
%else
BuildRequires:  libqt4-devel
%endif
%if 0%{?suse_version} <= 1210
BuildRequires:  xerces-j2
%endif
%if 0%{?sle_version} == 150100
BuildRequires:  typelib-1_0-Gst-1_0
%endif

%description
Navit is an open source (GPL) car navigation software for Linux systems. It will display your position on a map (in bird-view mode or as a 3D "visualization") from GPS sensor data, and can provide precise route calculation, touch screen functionality and supports Points of Interest (POI), which can be extended via an easy to use plugin system. Unlike other navigation systems, Navit maps are dynamically generated in real time from vector data.

%prep
%setup -q
mkdir -p %{_builddir}/%{name}-%{version}/%{name}/maps
cp "%{SOURCE1}" "%{_builddir}/%{name}-%{version}/%{name}/maps/osm_bbox_11.3,47.9,11.7,48.2"
#./autogen.sh

%build
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
export PATH=%{_libdir}/qt4/bin:$PATH
%endif
#configure  --enable-gui-gtk --enable-speech-speechd --enable-binding-dbus  \
#            --enable-graphics-sdl --enable-graphics-gd --enable-graphics-qt-qpainter \
#            --disable-samplemap
mkdir build
cd build
# FIXME: you should use %%cmake macros
cmake -DCFLAGS="%{optflags}" -DCXXFLAGS="%{optflags}" -DWANT_SVN_STAMP=OFF -DCMAKE_INSTALL_PREFIX=%{_prefix} -DSAMPLE_MAP=n ..
make %{?_smp_mflags}

%install
cd build
%make_install
cd ..
find %{buildroot} -type f -name "*.la" -delete -print
%if 0%{?suse_version}
%suse_update_desktop_file -n %{name}
%endif
sed -i 's/Categories=.*/Categories=Education;Geography;/' %{buildroot}/%{_datadir}/applications/navit.desktop
%if 0%{?suse_version} > 1020
%fdupes -s %{buildroot}
%endif
%find_lang %{name}

%files -f %{name}.lang
%license COPYING LGPL-2
%doc AUTHORS CHANGELOG.md
%dir %{_datadir}/icons/hicolor/86x86
%dir %{_datadir}/icons/hicolor/86x86/apps
%dir %{_datadir}/icons/hicolor/108x108
%dir %{_datadir}/icons/hicolor/108x108/apps
%{_bindir}/*
%{_libdir}/navit/
%{_datadir}/applications/navit.desktop
%{_datadir}/icons/hicolor/22x22/apps/navit.png
%{_datadir}/icons/hicolor/86x86/apps/navit.png
%{_datadir}/icons/hicolor/108x108/apps/navit.png
%{_datadir}/icons/hicolor/128x128/apps/navit.png
%{_datadir}/icons/hicolor/256x256/apps/navit.png
%{_datadir}/navit/
%{_mandir}/man1/*
%if 0%{?suse_version} > 1120
%{_datadir}/dbus-1/services/*.service
%endif
%if 0%{?suse_version} < 1130
%{_datadir}/locale/jv/
%endif

%changelog
openSUSE Build Service is sponsored by