%global glib2_version 2.72.1
%global gnome_autoar_version 0.4.0
%global gtk4_version 4.7.2
%global libadwaita_version 1.2

Name:            nautilus
Version:         43.1
Release:         1
Summary:         File manager for GNOME
License:         GPLv3+ and LGPLv2+
URL:             https://wiki.gnome.org/Apps/Nautilus
Source0:         https://download.gnome.org/sources/%{name}/43/%{name}-%{version}.tar.xz

BuildRequires:   desktop-file-utils gcc gettext gi-docgen meson libgexiv2-devel
BuildRequires:   gobject-introspection-devel gsettings-desktop-schemas-devel libseccomp-devel libselinux-devel libxslt
BuildRequires:   libxml2-devel tracker3-devel libX11-devel pkgconfig(gstreamer-pbutils-1.0) pkgconfig(gstreamer-tag-1.0) libappstream-glib
BuildRequires:   pkgconfig(libportal)
BuildRequires:   pkgconfig(libportal-gtk4)
BuildRequires:   pkgconfig(gnome-desktop-4)
BuildRequires:   pkgconfig(glib-2.0) >= %{glib2_version}
BuildRequires:   pkgconfig(gnome-autoar-0) >= %{gnome_autoar_version}
BuildRequires:   pkgconfig(gtk4) >= %{gtk4_version}
BuildRequires:   pkgconfig(libadwaita-1) >= %{libadwaita_version}
BuildRequires:   libcloudproviders-devel

Requires:        glib2 gsettings-desktop-schemas gvfs tracker3-miners
Requires:        gnome-autoar%{_isa} >= %{gnome_autoar_version}
Requires:        gtk4%{_isa} >= %{gtk4_version}
Requires:        libadwaita%{_isa} >= %{libadwaita_version}

Provides:        bundled(libgd)
Provides:        %{name}-extensions %{name}-extensions%{?_isa} = %{version}-%{release}
Provides:        lib%{name}-extensions lib%{name}-extensions%{?_isa} = %{version}-%{release}
Obsoletes:       %{name}-extensions < %{version}-%{release}

%description
It's easier to manage your files for the GNOME desktop. Ability to browse directories on local and remote systems.
preview folders and launch related programs. It is also handle icons on the GNOME desktop.

%package         devel
Summary:         includes development files for %{name} client development
License:         LGPLv2+
Requires:        %{name} = %{version}-%{release}

%description    devel
Files needed for building applications,such as static libraries,
header files that can communicate with a %{name} media server.

%package_help

%prep
%autosetup -p1

sed -i '/-Werror/d' meson.build

%build
%meson -Ddocs=true \
       -Dextensions=true \
       -Dintrospection=true \
       -Dselinux=true \
       %{nil}
%meson_build

%install
%meson_install

%find_lang %{name}

%check
appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/metainfo/org.gnome.Nautilus.appdata.xml
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop

%ldconfig_scriptlets

%files
%defattr(-,root,root)
%license LICENSE
%{_bindir}/*
%{_libdir}/nautilus
%{_libdir}/libnautilus-extension.so*
%{_libdir}/girepository-1.0
%{_datadir}/metainfo/*
%{_datadir}/dbus-1/*
%{_datadir}/gnome-shell/*
%{_datadir}/locale
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*
%{_datadir}/glib-2.0/*
%{_datadir}/nautilus/*
%{_datadir}/tracker3/*
%{_datadir}/tracker3/domain-ontologies/org.gnome.Nautilus.domain.rule

%files devel
%defattr(-,root,root)
%license libnautilus-extension/LICENSE
%{_libdir}/libnautilus-extension.*
%{_includedir}/nautilus/*
%{_libdir}/pkgconfig/*
%{_datadir}/gir-1.0/*

%files help
%defattr(-,root,root)
%doc NEWS README.md
%{_mandir}/man1/*
%{_datadir}/doc

%changelog
* Mon Jan 02 2023 lin zhang <lin.zhang@turbolinux.com.cn> - 43.1-1
- Update to 43.1

* Mon Jun 13 2022 lin zhang <lin.zhang@turbolinux.com.cn> - 42.2-1
- Update to 42.2

* Mon Jun 7 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 3.38.2-1
- Upgrade to 3.38.2
- Add a patch that can launch default uri handlers when activating files

* Sat Dec 28 2019 Jiangping Hu <hujiangping@huawei.com> - 3.33.90-3
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:package glib-2.0/* into nautilus package

* Thu Nov 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.33.90-2
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:add the libxslt in buildrequires

* Sat Aug 31 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.33.90-1
- Package init
