%global gjs_version 1.69.2
%global libshumate_version 1.0.0

%global __provides_exclude_from ^%{_libdir}/%{name}/.*\\.so.*$

Name:           gnome-maps
Version:        43.2
Release:        2
Summary:        A map application for GNOME
License:        GPLv2+
URL:            https://wiki.gnome.org/Apps/Maps
Source0:        https://download.gnome.org/sources/%{name}/43/%{name}-%{version}.tar.xz
Patch0:         disable_timeTest.patch

BuildRequires:  gcc gettext meson desktop-file-utils libappstream-glib 
BuildRequires:  pkgconfig(geoclue-2.0)
BuildRequires:  pkgconfig(geocode-glib-2.0)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(gjs-1.0) >= %{gjs_version}
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(gtk4)
BuildRequires:  pkgconfig(gweather4)
BuildRequires:  pkgconfig(libadwaita-1)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(rest-1.0)
BuildRequires:  pkgconfig(shumate-1.0) >= %{libshumate_version}

Requires:       dbus
Requires:       gdk-pixbuf2%{?_isa}
Requires:       geoclue2-libs%{?_isa}
Requires:       geocode-glib2%{?_isa}
Requires:       gjs%{?_isa} >= %{gjs_version}
Requires:       gobject-introspection%{?_isa}
Requires:       gtk4%{?_isa}
Requires:       libadwaita%{?_isa}
Requires:       libgweather%{?_isa}
Requires:       libshumate%{?_isa} >= %{libshumate_version}
Requires:       libsoup3%{?_isa}

%description
GNOME Maps is a simple map application for the GNOME desktop.

%prep
%autosetup -p1

%build
%meson
%meson_build

%install
%meson_install
rm %{buildroot}%{_libdir}/gnome-maps/libgnome-maps.so

%find_lang %{name}

%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/org.gnome.Maps.appdata.xml
desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Maps.desktop
%meson_test

%files -f %{name}.lang
%doc NEWS README
%license COPYING
%{_bindir}/%{name}
%{_datadir}/applications/org.gnome.Maps.desktop
%{_datadir}/dbus-1/services/org.gnome.Maps.service
%{_datadir}/glib-2.0/schemas/org.gnome.Maps.gschema.xml
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/scalable/apps/org.gnome.Maps.svg
%{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Maps-symbolic.svg
%{_datadir}/metainfo/org.gnome.Maps.appdata.xml
%{_libdir}/%{name}/

%changelog
* Mon Mar 27 2023 lin zhang <lin.zhang@turbolinux.com.cn> - 43.2-2
- rebuild for libgweather(Issue:I6QR7B)

* Mon Jan 2 2023 lin zhang <lin.zhang@turbolinux.com.cn> - 43.2-1
- Update to 43.2

* Mon Mar 28 2022 lin zhang <lin.zhang@turbolinux.com.cn> - 42.2-1
- Update to 42.2 and Add gnome-maps.yaml

* Thu Jun 17 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 3.38.4-1
- Package init with 3.38.4
