File waydroid.spec of Package waydroid

#
# spec file for package waydroid
#
# Copyright (c) 2022 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:        1.2.0
Release:        8.15
Summary:        Waydroid is a container-based approach to boot a full Android
License:        LGPL-3.0-only
URL:            https://github.com/waydroid/waydroid
Source0:        %{name}-%{version}.tar
Source1:        gbinder.conf
Source2:        id.waydro.setup-waydroid.policy
Requires:       lxc
Requires:       python3-gobject
Requires:       python3-gbinder-python
Requires:       waydroid-image
Requires:       waydroid-sensors
Requires:       dnsmasq

%description
Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system.

%prep
%autosetup

%build

%install
install -dm755 %{buildroot}%{_libdir}/waydroid
install -dm755 %{buildroot}%{_datadir}/applications
install -dm755 %{buildroot}%{_bindir}/
cp -r tools data %{buildroot}%{_libdir}/waydroid/
mv %{buildroot}/%{_libdir}/waydroid/data/Waydroid.desktop %{buildroot}%{_datadir}/applications
cp waydroid.py %{buildroot}%{_libdir}/waydroid/
ln -s %{_libdir}/waydroid/waydroid.py %{buildroot}%{_bindir}/waydroid
install -Dm644 -t %{buildroot}%{_sysconfdir}/ %{SOURCE1}
install -Dm644 -t %{buildroot}%{_sysconfdir}/gbinder.d gbinder/anbox.conf
install -Dm644 -t %{buildroot}%{_unitdir}/%{name}-container.service debian/waydroid-container.service
install -Dm644 -t %{buildroot}%{_datadir}/polkit-1/actions/ %{SOURCE2}

%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
%{_bindir}/waydroid
%dir %{_libdir}/waydroid/
%{_libdir}/waydroid/*
%{_datadir}/applications/Waydroid.desktop
%{_sysconfdir}/gbinder.conf
%dir %{_sysconfdir}/gbinder.d/
%{_sysconfdir}/gbinder.d/*
%{_unitdir}/waydroid-container.service
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
%{_datadir}/polkit-1/actions/*
%config %{_sysconfdir}/gbinder.conf
%config %{_sysconfdir}/gbinder.d/anbox.conf

%changelog
* Mon Sep 20 2021 Adrian Campos Garrido <adriancampos@teachelp.com>
- First build for Waydroid
openSUSE Build Service is sponsored by