File waydroid.spec of Package waydroid

#
# spec file for package waydroid
#
# Copyright (c) 2021 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:           waydroid
Version:        Main
Release:        0
Summary:        Uses a container-based approach to boot a full Android system
License:        GPL-3.0-or-later AND BSD-3-Clause
URL:            https://github.com/waydroid/waydroid
Source0:        %{name}-%{version}.tar.xz
Source1:        README_SUSE.md
# Adding gbinder.conf to source tree so we can put it  into /etc
# preventing "Failed to get service waydroidplatform, trying again..."
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
Requires:       lxc
Requires:       python3-gbinder
Requires:       python3-gobject
Requires:       python3-pyclip
Requires:       clipman
#commenting out to prevent explicit-lib-dependency error
#Requires:       libgbinder1
#Requires:       libglibutil1
BuildArch:      noarch
%{?systemd_requires}

%description
Waydroid uses Linux namespaces (user, pid, uts, net, mount, ipc) to run a full Android system
in a container and provide Android applications on any GNU/Linux-based platform.
The Android system inside the container has direct access to any needed hardware.
The Android runtime environment ships with a minimal customized Android system image based on LineageOS.
The image is currently based on Android 10.

%prep
%autosetup -p1
rm -rf debian/{compat,control,rules}
rm -rf debian/waydroid.dirs
rm -rf debian/waydroid.install
rm -rf debian/waydroid.links
rm -rf debian/waydroid.postinst
rm -rf debian/source
sed -i -e '1d;2i#!/usr/bin/python3' waydroid.py

%build
%make_build

%install
%make_install
install -d %{buildroot}%{_sysconfdir}/gbinder.d/
mkdir -p %{buildroot}%{_datadir}/doc/packages/%{name}
install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/doc/packages/%{name}/README_SUSE.md
%fdupes %{buildroot}/%{_prefix}

%pre
%service_add_pre %{name}-container.service

%post
%service_add_post %{name}-container.service

%preun
%service_del_preun %{name}-container.service

%postun
%service_del_postun %{name}-container.service

%files
%license LICENSE debian/copyright
%doc README.md debian/changelog README_SUSE.md
%{_bindir}/%{name}
%{_datadir}/applications/Waydroid.desktop
%{_datadir}/applications/waydroid.app.install.desktop
%{_datadir}/applications/waydroid.market.desktop
%{_prefix}/lib/%{name}
%{_unitdir}/%{name}-container.service
%dir %{_datadir}/dbus-1
%dir %{_datadir}/dbus-1/system-services/
%{_datadir}/dbus-1/system-services/id.waydro.Container.service
%dir %{_datadir}/dbus-1/system.d
%{_datadir}/dbus-1/system.d/id.waydro.Container.conf
%{_datadir}/icons/hicolor/512x512/apps/waydroid.png
%{_datadir}/metainfo/id.waydro.waydroid.metainfo.xml
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
%{_datadir}/polkit-1/actions/id.waydro.Container.policy
%dir %{_datadir}/desktop-directories
%{_datadir}/desktop-directories/waydroid.directory
%dir %{_sysconfdir}/xdg/menus
%dir %{_sysconfdir}/xdg/menus/applications-merged
%config(noreplace) %{_sysconfdir}/xdg/menus/applications-merged/*.menu

%changelog
openSUSE Build Service is sponsored by