#spec file for gvfs
%define _unpackaged_files_terminate_build 0
%global avahi_version 0.6
%global fuse_version 2.8.0
%global gettext_version 0.19.4
%global glib2_version 2.57.2
%global goa_version 3.17.1
%global gudev_version 147
%global libarchive_version 3.0.22
%global libcdio_paranoia_version 0.78.2
%global libgcrypt_version 1.2.2
%global libgdata_version 0.17.9
%global libgphoto2_version 2.5.0
%global libimobiledevice_version 1.2
%global libmtp_version 1.1.12
%global libnfs_version 1.9.8
%global libplist_version 0.15
%global libsmbclient_version 3.4.0
%global libsoup_version 2.42.0
%global libusb_version 1.0.21
%global systemd_version 206
%global talloc_version 1.3.0
%global udisks2_version 1.97

Name: gvfs
Version: 1.40.2
Release: 3
Summary: gvfs is a backends for the gio framework in GLib
License: GPLv3 and LGPLv2+ and BSD and MPLv2.0
URL: https://wiki.gnome.org/Projects/gvfs

Source0: https://download.gnome.org/sources/gvfs/1.40/gvfs-%{version}.tar.xz

BuildRequires: /usr/bin/ssh
BuildRequires: meson gcc pkgconfig pkgconfig(glib-2.0) >= %{glib2_version} pkgconfig(dbus-glib-1) pkgconfig(gcr-3)
BuildRequires: openssl-devel
BuildRequires: pkgconfig(libcdio_paranoia) >= %{libcdio_paranoia_version} pkgconfig(gudev-1.0) >= %{gudev_version}
BuildRequires: pkgconfig(libsoup-2.4) >= %{libsoup_version} pkgconfig(avahi-client) >= %{avahi_version}
BuildRequires: pkgconfig(avahi-glib) >= %{avahi_version} pkgconfig(libsecret-1)
BuildRequires: gettext-devel >= %{gettext_version} pkgconfig(udisks2) >= %{udisks2_version}
BuildRequires: systemd-devel >= %{systemd_version} pkgconfig(libxslt) docbook-style-xsl pkgconfig(polkit-gobject-1) pkgconfig(libcap)
BuildRequires: pkgconfig(goa-1.0) >= %{goa_version}
BuildRequires: pkgconfig(libgdata) >= %{libgdata_version}
BuildRequires: libsmbclient-devel >= %{libsmbclient_version}
BuildRequires: pkgconfig(talloc) >= %{talloc_version}
BuildRequires: pkgconfig(libarchive) >= %{libarchive_version}
BuildRequires: pkgconfig(libgphoto2) >= %{libgphoto2_version}
BuildRequires: libusb-devel >= %{libusb_version} libexif-devel
BuildRequires: pkgconfig(fuse) >= %{fuse_version}
BuildRequires: pkgconfig(libimobiledevice-1.0) >= %{libimobiledevice_version}
BuildRequires: pkgconfig(libplist) >= %{libplist_version}
BuildRequires: libgcrypt-devel >= %{libgcrypt_version}
BuildRequires: pkgconfig(libmtp) >= %{libmtp_version}
BuildRequires: pkgconfig(libnfs) >= %{libnfs_version}

Requires: glib2%{?_isa} >= %{glib2_version} udisks2 >= %{udisks2_version}
Requires: fuse >= %{fuse_version}
Requires: libgdata%{?_isa} >= %{libgdata_version}
Requires: %{name}-client%{?_isa} = %{version}-%{release}
Requires(post): desktop-file-utils >= 0.22-6
Requires(postun): desktop-file-utils >= 0.22-6

Provides: %{name}-fuse %{name}-smb %{name}-archive %{name}-gphoto2 %{name}-afc %{name}-afp %{name}-mtp %{name}-goa %{name}-tests
Obsoletes: %{name}-fuse %{name}-smb %{name}-archive %{name}-gphoto2 %{name}-afc %{name}-afp %{name}-mtp %{name}-goa %{name}-tests
Obsoletes: gnome-mount <= 0.8 gnome-mount-nautilus-properties <= 0.8
Obsoletes: gvfs-obexftp < 1.17.91-2
Obsoletes: %{name} < 1.9.4-1


%description
Gvfs is a userspace virtual filesystem implementation for GIO (a library available in GLib).
It comes with a set of backends, including trash support, SFTP, SMB, HTTP, DAV, and many others.
Gvfs also contains modules for GIO that implement volume monitors and persistent metadata storage.


%package  client
Summary:  Client modules of backends for the gio framework in GLib
Conflicts: %{name} < 1.25.2-2

%description client
This package containers the client modules of backend implementations for the gio framework in GLib.


%package devel
Summary: Development files for gvfs
Requires: %{name}-client%{?_isa} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
This package containers the headers and other files which are required for develop applications with gvfs.


%package help
Summary: Documentation for gvfs

%description help
This package contains help documentation for gvfs

%prep
%autosetup -n %{name}-%{version} -p1

%build
%meson -Dinstalled_tests=true -Dman=true -Dnfs=false -Dbluray=false %{nil}
%meson_build

%install
%meson_install
# trashlib is GPLv3, include the license
cp -p daemon/trashlib/COPYING COPYING.GPL3

%find_lang gvfs

%files
%dir %{_datadir}/gvfs
%dir %{_datadir}/gvfs/mounts
%dir %{_datadir}/gvfs/remote-volume-monitors
%{_datadir}/dbus-1/services/org.gtk.vfs.Daemon.service
%{_datadir}/dbus-1/services/org.gtk.vfs.GoaVolumeMonitor.service
%{_datadir}/dbus-1/services/org.gtk.vfs.Metadata.service
%{_datadir}/dbus-1/services/org.gtk.vfs.UDisks2VolumeMonitor.service
%{_datadir}/gvfs/mounts/admin.mount
%{_datadir}/gvfs/mounts/archive.mount
%{_datadir}/gvfs/mounts/afp.mount
%{_datadir}/gvfs/mounts/afp-browse.mount
%{_datadir}/gvfs/mounts/burn.mount
%{_datadir}/gvfs/mounts/cdda.mount
%{_datadir}/gvfs/mounts/computer.mount
%{_datadir}/gvfs/mounts/dav.mount
%{_datadir}/gvfs/mounts/dav+sd.mount
%{_datadir}/gvfs/mounts/dns-sd.mount
%{_datadir}/gvfs/mounts/ftp.mount
%{_datadir}/gvfs/mounts/ftpis.mount
%{_datadir}/gvfs/mounts/ftps.mount
%{_datadir}/gvfs/mounts/google.mount
%{_datadir}/gvfs/mounts/http.mount
%{_datadir}/gvfs/mounts/localtest.mount
%{_datadir}/gvfs/mounts/network.mount
%{_datadir}/gvfs/mounts/recent.mount
%{_datadir}/gvfs/mounts/smb-browse.mount
%{_datadir}/gvfs/mounts/sftp.mount
%{_datadir}/gvfs/mounts/smb.mount
%{_datadir}/gvfs/mounts/trash.mount
%{_datadir}/gvfs/remote-volume-monitors/goa.monitor
%{_datadir}/gvfs/remote-volume-monitors/udisks2.monitor
%{_datadir}/GConf/gsettings/*.convert
%{_datadir}/glib-2.0/schemas/*.xml
%{_datadir}/polkit-1/actions/org.gtk.vfs.file-operations.policy
%{_datadir}/polkit-1/rules.d/org.gtk.vfs.file-operations.rules
%{_libdir}/gvfs/libgvfsdaemon.so
%{_libexecdir}/gvfs-goa-volume-monitor
%{_libexecdir}/gvfs-udisks2-volume-monitor
%{_libexecdir}/gvfsd
%{_libexecdir}/gvfsd-admin
%{_libexecdir}/gvfsd-afp
%{_libexecdir}/gvfsd-afp-browse
%{_libexecdir}/gvfsd-archive
%{_libexecdir}/gvfsd-burn
%{_libexecdir}/gvfsd-cdda
%{_libexecdir}/gvfsd-computer
%{_libexecdir}/gvfsd-dnssd
%{_libexecdir}/gvfsd-dav
%{_libexecdir}/gvfsd-ftp
%{_libexecdir}/gvfsd-fuse
%{_libexecdir}/gvfsd-google
%{_libexecdir}/gvfsd-http
%{_libexecdir}/gvfsd-localtest
%{_libexecdir}/gvfsd-metadata
%{_libexecdir}/gvfsd-network
%{_libexecdir}/gvfsd-recent
%{_libexecdir}/gvfsd-sftp
%{_libexecdir}/gvfsd-smb
%{_libexecdir}/gvfsd-smb-browse
%{_libexecdir}/gvfsd-trash
%{_userunitdir}/gvfs-daemon.service
%{_userunitdir}/gvfs-metadata.service
%{_userunitdir}/gvfs-udisks2-volume-monitor.service
%{_userunitdir}/gvfs-goa-volume-monitor.service
%{_tmpfilesdir}/gvfsd-fuse-tmpfiles.conf

%files client -f gvfs.lang
%license COPYING COPYING.GPL3
%doc NEWS README.md
%dir %{_libdir}/gvfs
%{_libdir}/gvfs/libgvfscommon.so
%{_libdir}/gio/modules/libgioremote-volume-monitor.so
%{_libdir}/gio/modules/libgvfsdbus.so

%files devel
%dir %{_includedir}/gvfs-client
%dir %{_includedir}/gvfs-client/gvfs
%{_includedir}/gvfs-client/gvfs/gvfsurimapper.h
%{_includedir}/gvfs-client/gvfs/gvfsuriutils.h
%dir %{_libexecdir}/installed-tests
%{_libexecdir}/installed-tests/gvfs
%{_datadir}/installed-tests

%files help
%{_mandir}/man1/gvfsd.1*
%{_mandir}/man1/gvfsd-metadata.1*
%{_mandir}/man7/gvfs.7*
%{_mandir}/man1/gvfsd-fuse.1*

%changelog
* Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.40.2-3
- Delete redundant info

* Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.40.2-2
- Delete unneeded build requires

* Tue Jan 7 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.40.2-1
- update to 1.40.2

* Tue Sep 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.38.1-3
- Type:cves
- ID:CVE-2019-12447 CVE-2019-12448 CVE-2019-12449
- SUG:restart
- DESC:fix CVE-2019-12447 CVE-2019-12448 CVE-2019-12449

* Tue Sep 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.38.1-2
- Package init
