%global forgeurl https://github.com/waydroid/waydroid %global tag 1.2.0 %global debug_package %{nil} %global selinuxtype targeted %forgemeta Name: waydroid Version: %{tag} Release: 5%{?dist} Summary: waydroid License: LGPLv2+ URL: %{forgeurl} Source: %{forgesource} Source1: waydroid.te Source2: waydroid-gbinder.conf Source3: waydroid-container.service Source4: dev-binderfs.mount Patch0: setup-firealld.patch Patch1: memfd.patch BuildRequires: make BuildRequires: selinux-policy-devel BuildRequires: systemd BuildRequires: python3-devel Requires: python-gbinder-python Requires: libgbinder Requires: lxc Requires: libglibutil %if 0%{?fedora} || 0%{?rhel} >= 8 Recommends: %{name}-selinux = %{version}-%{release} %endif %description A container-based approach to boot a full Android system on a regular GNU/Linux system. %package selinux Summary: SELinux policy module required tu run waydroid BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: container-selinux %{?selinux_requires} # TMP: Require exact version of sepolicy to prevent updating to an official build that does not define binder types Requires: selinux-policy = %{_selinux_policy_version} %description selinux This package contains SELinux policy module necessary to run waydroid. %prep %forgeautosetup -p1 # Remove link for ROM files sed -i -e '/"system_channel":/ s/: ".*"/: ""/' tools/config/__init__.py sed -i -e '/"vendor_channel":/ s/: ".*"/: ""/' tools/config/__init__.py mkdir SELinux cp %{S:1} SELinux/ %build cd SELinux %{__make} NAME=%{selinuxtype} -f /usr/share/selinux/devel/Makefile %install mkdir -p %{buildroot}%{_prefix}/lib/waydroid mkdir -p %{buildroot}%{_datadir}/applications mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/gbinder.d mkdir -p %{buildroot}%{_prefix}/lib/systemd/system cp -r tools data waydroid.py "%{buildroot}%{_prefix}/lib/waydroid" %py_byte_compile %{python3} %{buildroot}%{_prefix}/lib/waydroid ln -s ../lib/waydroid/waydroid.py "%{buildroot}%{_bindir}/waydroid" mv "%{buildroot}%{_prefix}/lib/waydroid/data/Waydroid.desktop" "%{buildroot}%{_datadir}/applications" cp %{S:2} %{buildroot}%{_sysconfdir}/gbinder.d/waydroid.conf cp %{S:3} %{buildroot}%{_prefix}/lib/systemd/system/ cp %{S:4} %{buildroot}%{_prefix}/lib/systemd/system/ %{__install} -d %{buildroot}%{_datadir}/selinux/%{selinuxtype} %{__install} -p -m 644 SELinux/%{name}.pp %{buildroot}%{_datadir}/selinux/%{selinuxtype}/%{name}.pp %post selinux %selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/%{selinuxtype}/%{name}.pp || : %postun selinux if [ $1 -eq 0 ] ; then %selinux_modules_uninstall -s %{selinuxtype} %{name} || : fi %files %license LICENSE %doc README.md %{_prefix}/lib/waydroid %{_datadir}/applications/Waydroid.desktop %{_bindir}/waydroid %{_sysconfdir}/gbinder.d/waydroid.conf %{_unitdir}/waydroid-container.service %{_unitdir}/dev-binderfs.mount %files selinux %doc SELinux/%{name}.te %{_datadir}/selinux/targeted/%{name}.pp %changelog * Sat Feb 26 2022 Alessandro Astone - 1.2.0-5.20220226git1.2.0 - Add sepolicy for crash handler * Fri Feb 25 2022 Alessandro Astone - 1.2.0-4.20220225git1.2.0 - Respin package * Wed Aug 12 2020 Qiyu Yan - 0-0.1.20200811gitc87ea48 - initial package