File waydroid.spec of Package waydroid
#
# spec file for package waydroid
#
# Copyright (c) 2022 Florian "sp1rit" <packaging@sp1rit.anonaddy.me>
# Copyright (c) 2022 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name:           waydroid
Version:        1.2.1+git.3~facf2b7
Release:        0
Summary:        Container-based approach to boot a full Android system
License:        GPL-3.0
Group:          Emulators
Url:            https://waydro.id
BuildArch:      noarch
Source:         %{name}-%{version}.tar.xz
BuildRequires:  python-rpm-macros
Requires:       anbox-modules
Requires:       nftables
Requires:       lxc >= 4.0.10
Requires:       python3-gbinder
Requires:       python3-gobject
Requires:       python3-pyclip
Requires:       dnsmasq
%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.
Note: You need to run a kernel compiled with CONFIG_PSI=y, and boot with kernel
command-line parameter psi=1 for the Android container to start.
%prep
%setup -q
sed -e "s|/usr/bin/env python3|%{__python3}|g" \
	-e "s|/usr/bin/env python|%{__python3}|g" \
	-i "waydroid.py"
%build
%install
install -d -m755 %{buildroot}/{%{_datadir}/waydroid,%{_sysconfdir}/gbinder.d,%{_bindir},%{_datadir}/waydroid}
install -d -m755 %{buildroot}/%{_unitdir}
cp -r data gbinder tools waydroid.py %{buildroot}/%{_datadir}/waydroid
ln -s %{_datadir}/waydroid/waydroid.py %{buildroot}/%{_bindir}/waydroid
install -m644 gbinder/anbox.conf %{buildroot}/%{_sysconfdir}/gbinder.d
install -m644 debian/waydroid-container.service %{buildroot}/%{_unitdir}
%pre
%service_add_pre waydroid-container.service
%post
%service_add_post waydroid-container.service
%preun
%service_del_preun waydroid-container.service
%postun
%service_del_postun waydroid-container.service
%files
%{_bindir}/waydroid
%{_datadir}/waydroid
%dir %{_sysconfdir}/gbinder.d/
%config(noreplace) %{_sysconfdir}/gbinder.d/anbox.conf
%{_unitdir}/waydroid-container.service
%doc README.md
%changelog