Blob Blame History Raw
%global debug_package %{nil}

%global app_id org.gnome.Shell.Extensions.GSConnect

Name:           gnome-shell-extension-gsconnect
Version:        16
Release:        1%{?dist}
Summary:        KDE Connect implementation for GNOME Shell

License:        GPLv2
URL:            https://github.com/andyholmes/%{name}
Source0:        %{url}/archive/v%{version}/%{name}-v%{version}.tar.gz
Source1:        nautilus-gsconnect.metainfo.xml
# Install the Nautilus extension package instead of its dependencies only when
# enable file integration
Patch0:         %{name}-16-PackageKit.patch

BuildRequires:  gcc
BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:  libappstream-glib
BuildRequires:  meson
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(glib-2.0)
Requires:       gnome-shell >= 3.28
Requires:       openssl
Suggests:       folks
Suggests:       fuse-sshfs
Suggests:       gsound
Suggests:       libcanberra-gtk3

%description
The KDE Connect project allows devices to securely share content such as
notifications and files as well as interactive features such as SMS messaging
and remote input. The KDE Connect team maintains cross-desktop, Android and
Sailfish applications as well as an interface for KDE Plasma.

GSConnect is a complete implementation of KDE Connect especially for GNOME Shell
with Nautilus, Chrome and Firefox integration. It is does not rely on the KDE
Connect desktop application and will not work with it installed.


%package -n nautilus-gsconnect
Summary:        Nautilus extension for GSConnect
Requires:       gobject-introspection
Requires:       nautilus-extensions
%if 0%{?fedora} >= 29
Requires:       nautilus-python
%else
Requires:       python2-nautilus
%endif
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch

%description -n nautilus-gsconnect
The nautilus-gsconnect package provides a Nautilus context menu for sending
files to devices that are online, paired and have the "Share and receive" plugin
enabled.


%package -n webextension-gsconnect
Summary:        Web browser integration for GSConnect
Requires:       mozilla-filesystem
Requires:       %{name} = %{version}-%{release}

%description -n webextension-gsconnect
The webextension-gsconnect package allows Google Chrome/Chromium, Firefox,
Vivaldi, Opera (and other Browser Extension, Chrome Extension or WebExtensions
capable browsers) to interact with GSConnect, using the Share plugin to open
links in device browsers and the Telephony plugin to share links with contacts
by SMS.


%prep
%autosetup -p0 -n %{name}-%{version}%{?prerelease:-%{prerelease}}


%build
%meson
%meson_build


%install
%meson_install

# Install AppData file
install -Dpm 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_metainfodir}/nautilus-gsconnect.metainfo.xml

# Remove useless files
rm $RPM_BUILD_ROOT%{_datadir}/gnome-shell/extensions/gsconnect@andyholmes.github.io/nautilus-gsconnect.py

%find_lang %{app_id}


%check
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/%{app_id}.desktop
appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/nautilus-gsconnect.metainfo.xml


%files -f %{app_id}.lang
%doc README.md
%license LICENSE
%{_datadir}/gnome-shell/extensions/gsconnect@andyholmes.github.io/
%{_datadir}/applications/%{app_id}.desktop
%{_datadir}/dbus-1/services/%{app_id}.service
%{_datadir}/glib-2.0/schemas/%{app_id}.gschema.xml


%files -n nautilus-gsconnect
%{_datadir}/nautilus-python/
%{_metainfodir}/nautilus-gsconnect.metainfo.xml


%files -n webextension-gsconnect
%{_libdir}/mozilla/native-messaging-hosts/
%{_sysconfdir}/chromium/
%{_sysconfdir}/opt/chrome/


%changelog
* Tue Nov 27 2018 Mohamed El Morabity <melmorabity@fedoraproject.org> - 16-1
- Initial RPM release