File waydroid.spec of Package waydroid

#
# spec file for package waydroid
#
# Copyright (c) 2025 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.5.4.g4bc3b0f
Release:        0
Summary:        Android runtime
License:        GPL-3.0-or-later AND BSD-3-Clause
URL:            https://github.com/waydroid/waydroid
Source0:        %{name}-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
Requires: python3-gbinder
Requires: python3-gobject
Requires: python3-pyclipper
Requires: lxc
BuildArch: noarch
%if 0%{?suse_version}
BuildRequires: apparmor-rpm-macros
%endif
%{?systemd_requires}

%description
%{summary}.

%prep
%setup -q
sed -i -e '1d;2i#!/usr/bin/python3' waydroid.py

%build

%install
make DESTDIR=%{buildroot} install
make DESTDIR=%{buildroot} install_apparmor
rm -Rf %{buildroot}/%{_sysconfdir}/apparmor.d/local

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

%post
%service_add_post %{name}-container.service
%apparmor_reload %{_sysconfdir}/apparmor.d/adbd
%apparmor_reload %{_sysconfdir}/apparmor.d/android_app
%apparmor_reload %{_sysconfdir}/apparmor.d/lxc/lxc-waydroid

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

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

%files
%defattr(-,root,root,-)
%{_prefix}/lib/waydroid
%{_bindir}/waydroid
%{_datadir}/applications/*.desktop
%{_unitdir}/%{name}-container.service
%{_datadir}/dbus-1/system-services/*.service
%{_datadir}/dbus-1/system.d/*.conf
%{_datadir}/desktop-directories/waydroid.directory
%{_datadir}/icons/hicolor/512x512/apps/*.png
%{_datadir}/polkit-1/actions/*.policy
%{_datadir}/metainfo/*.xml
%config %{_sysconfdir}/xdg/menus/applications-merged/waydroid.menu
%config %{_sysconfdir}/apparmor.d/adbd
%config %{_sysconfdir}/apparmor.d/android_app
%config %{_sysconfdir}/apparmor.d/lxc/lxc-waydroid
%dir %{_datadir}/icons
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/512x512
%dir %{_datadir}/icons/hicolor/512x512/apps
%dir %{_datadir}/desktop-directories
%dir %{_datadir}/dbus-1
%dir %{_datadir}/dbus-1/system.d
%dir %{_datadir}/dbus-1/system-services
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
%dir %{_sysconfdir}/apparmor.d
%dir %{_sysconfdir}/apparmor.d/lxc
%dir %{_sysconfdir}/xdg/menus
%dir %{_sysconfdir}/xdg/menus/applications-merged

%changelog
openSUSE Build Service is sponsored by