|
| 1 | +%global forgeurl https://github.com/waydroid/waydroid |
| 2 | +%global selinuxtype targeted |
| 3 | + |
| 4 | +Version: 1.4.2 |
| 5 | +%global tag %{version} |
| 6 | + |
| 7 | +%forgemeta |
| 8 | +Name: waydroid |
| 9 | +Release: 1%{?dist}.bazzite |
| 10 | +Summary: Container-based approach to boot a full Android system on GNU/Linux |
| 11 | +License: GPL-3.0-only |
| 12 | +URL: %{forgeurl} |
| 13 | +Source: %{forgesource} |
| 14 | +Source1: waydroid.te |
| 15 | +Source4: dev-binderfs.mount |
| 16 | +Source6: waydroid.fc |
| 17 | + |
| 18 | +# Assign firewalld zone to the waydroid network interface |
| 19 | +Patch0: setup-firewalld.patch |
| 20 | + |
| 21 | +# Mount the android rootfs with a default selinux context |
| 22 | +Patch1: mount-secontext.patch |
| 23 | + |
| 24 | +# https://github.com/waydroid/waydroid/commit/66c8343c4d2ea118601ba5d8ce52fa622cbcd665 |
| 25 | +Patch2: regex.patch |
| 26 | +# https://github.com/waydroid/waydroid/commit/6eea5cf63f4a724e66a2857b8f67ee2bbc82f0bd |
| 27 | +Patch3: sse3.patch |
| 28 | + |
| 29 | +BuildArch: noarch |
| 30 | + |
| 31 | +BuildRequires: make |
| 32 | +BuildRequires: selinux-policy-devel |
| 33 | +BuildRequires: container-selinux |
| 34 | +BuildRequires: systemd |
| 35 | +BuildRequires: python3-devel |
| 36 | +BuildRequires: systemd-rpm-macros |
| 37 | +BuildRequires: desktop-file-utils |
| 38 | +BuildRequires: libappstream-glib |
| 39 | + |
| 40 | +Requires: python3-gbinder >= 1.1.0 |
| 41 | +Requires: python3-gobject |
| 42 | +Requires: lxc |
| 43 | +Requires: gtk3 |
| 44 | +Requires: (%{name}-selinux = %{version}-%{release} if selinux-policy-%{selinuxtype}) |
| 45 | +Requires: nftables |
| 46 | +Requires: iproute |
| 47 | +Requires: dnsmasq |
| 48 | +Recommends: python3-pyclip |
| 49 | +Recommends: wl-clipboard |
| 50 | + |
| 51 | +%description |
| 52 | +Waydroid uses Linux namespaces to run a full Android system in a container |
| 53 | +and provide Android applications on any GNU/Linux-based platform. |
| 54 | +The Android system inside the container has direct access to needed hardware |
| 55 | +through LXC and the binder interface. |
| 56 | + |
| 57 | +%package selinux |
| 58 | +Summary: SELinux policy module for waydroid |
| 59 | +Requires: %{name} = %{version}-%{release} |
| 60 | +Requires: container-selinux |
| 61 | +%{?selinux_requires} |
| 62 | + |
| 63 | +%description selinux |
| 64 | +This package contains the SELinux policy module necessary to run waydroid. |
| 65 | + |
| 66 | +%prep |
| 67 | +%forgeautosetup -p1 |
| 68 | +mkdir SELinux |
| 69 | +cp %{S:1} SELinux/ |
| 70 | +cp %{S:6} SELinux/ |
| 71 | + |
| 72 | +%build |
| 73 | +# Remove link for ROM files |
| 74 | +sed -i -e '/"system_channel":/ s/: ".*"/: ""/' tools/config/__init__.py |
| 75 | +sed -i -e '/"vendor_channel":/ s/: ".*"/: ""/' tools/config/__init__.py |
| 76 | +# Compile sepolicy |
| 77 | +cd SELinux |
| 78 | +%{__make} NAME=%{selinuxtype} -f /usr/share/selinux/devel/Makefile |
| 79 | + |
| 80 | +%install |
| 81 | +%make_install LIBDIR=%{_libdir} DESTDIR=%{buildroot} USE_SYSTEMD=1 USE_DBUS_ACTIVATION=1 USE_NFTABLES=1 |
| 82 | +%py_byte_compile %{python3} %{buildroot}%{_prefix}/lib/waydroid |
| 83 | +%{__install} -d %{buildroot}%{_unitdir} |
| 84 | +%{__install} -d %{buildroot}%{_datadir}/selinux/%{selinuxtype} |
| 85 | +%{__install} -p -m 644 %{S:4} %{buildroot}%{_unitdir}/ |
| 86 | +%{__install} -p -m 644 SELinux/%{name}.pp %{buildroot}%{_datadir}/selinux/%{selinuxtype}/%{name}.pp |
| 87 | +sed -i '/^\[Unit\]/a Wants=dev-binderfs.mount' %{buildroot}%{_unitdir}/waydroid-container.service |
| 88 | +sed -i '/^\[Service\]/a ExecStartPre=/usr/bin/ln -sf /dev/binderfs/binder /dev/binderfs/vndbinder /dev/binderfs/hwbinder /dev/' %{buildroot}%{_unitdir}/waydroid-container.service |
| 89 | + |
| 90 | +%check |
| 91 | +desktop-file-validate %{buildroot}/%{_datadir}/applications/Waydroid.desktop |
| 92 | +desktop-file-validate %{buildroot}/%{_datadir}/applications/waydroid.market.desktop |
| 93 | +desktop-file-validate %{buildroot}/%{_datadir}/applications/waydroid.app.install.desktop |
| 94 | +appstream-util validate --nonet %{buildroot}%{_metainfodir}/id.waydro.waydroid.metainfo.xml |
| 95 | + |
| 96 | +%pre selinux |
| 97 | +%selinux_relabel_pre -s %{selinuxtype} |
| 98 | + |
| 99 | +%post selinux |
| 100 | +%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/%{selinuxtype}/%{name}.pp |
| 101 | +%selinux_relabel_post -s %{selinuxtype} |
| 102 | + |
| 103 | +if [ "$1" -le "1" ]; then # First install |
| 104 | + # the daemon needs to be restarted for the custom label to be applied |
| 105 | + %systemd_postun_with_restart waydroid-container.service |
| 106 | +fi |
| 107 | + |
| 108 | +%postun selinux |
| 109 | +if [ $1 -eq 0 ]; then |
| 110 | + %selinux_modules_uninstall -s %{selinuxtype} %{name} |
| 111 | + %selinux_relabel_post -s %{selinuxtype} |
| 112 | +fi |
| 113 | + |
| 114 | +%post |
| 115 | +waydroid upgrade -o > /dev/null || : |
| 116 | +%systemd_post waydroid-container.service |
| 117 | +if [ $1 -eq 1 ]; then |
| 118 | + if systemctl -q is-enabled waydroid-container.service > /dev/null 2>&1 ; then |
| 119 | + systemctl start waydroid-container.service > /dev/null 2>&1 || : |
| 120 | + fi |
| 121 | +fi |
| 122 | + |
| 123 | +%preun |
| 124 | +%systemd_preun waydroid-container.service |
| 125 | + |
| 126 | +%postun |
| 127 | +%systemd_postun_with_restart waydroid-container.service |
| 128 | + |
| 129 | +%files |
| 130 | +%license LICENSE |
| 131 | +%doc README.md |
| 132 | +%{_prefix}/lib/waydroid |
| 133 | +%{_datadir}/applications/Waydroid.desktop |
| 134 | +%{_datadir}/applications/waydroid.market.desktop |
| 135 | +%{_datadir}/applications/waydroid.app.install.desktop |
| 136 | +%{_datadir}/metainfo/id.waydro.waydroid.metainfo.xml |
| 137 | +%{_datadir}/icons/hicolor/512x512/apps/waydroid.png |
| 138 | +%{_bindir}/waydroid |
| 139 | +%{_unitdir}/waydroid-container.service |
| 140 | +%{_unitdir}/dev-binderfs.mount |
| 141 | +%{_datadir}/dbus-1/system-services/id.waydro.Container.service |
| 142 | +%{_datadir}/dbus-1/system.d/id.waydro.Container.conf |
| 143 | +%{_datadir}/polkit-1/actions/id.waydro.Container.policy |
| 144 | +%{_datadir}/desktop-directories/waydroid.directory |
| 145 | +%{_sysconfdir}/xdg/menus/applications-merged/waydroid.menu |
| 146 | + |
| 147 | +%files selinux |
| 148 | +%doc SELinux/%{name}.te |
| 149 | +%{_datadir}/selinux/%{selinuxtype}/%{name}.pp |
| 150 | + |
| 151 | +%changelog |
| 152 | +* Tue Oct 31 2023 Alessandro Astone <[email protected]> - 1.4.2-1 |
| 153 | +- Update to 1.4.2 |
| 154 | + |
| 155 | +* Tue Sep 26 2023 Alessandro Astone <[email protected]> - 1.4.1-3 |
| 156 | +- Amend SELinux to coexist with snap |
| 157 | + |
| 158 | +* Sat Jul 22 2023 Fedora Release Engineering <[email protected]> - 1.4.1-2 |
| 159 | +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild |
| 160 | + |
| 161 | +* Tue Apr 25 2023 Alessandro Astone <[email protected]> - 1.4.1-1 |
| 162 | +- Update to 1.4.1 |
| 163 | + |
| 164 | +* Wed Feb 08 2023 Alessandro Astone <[email protected]> - 1.4.0-1 |
| 165 | +- Update to 1.4.0 |
| 166 | + |
| 167 | +* Sat Jan 21 2023 Fedora Release Engineering <[email protected]> - 1.3.4-5 |
| 168 | +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild |
| 169 | + |
| 170 | +* Fri Jan 06 2023 Alessandro Astone <[email protected]> - 1.3.4-4 |
| 171 | +- Re-enable s390x build |
| 172 | +- Sepolicy fixes |
| 173 | + |
| 174 | +* Tue Dec 27 2022 Alessandro Astone <[email protected]> - 1.3.4-3 |
| 175 | +- Fix description typos etc. |
| 176 | +- Validate desktop and metainfo files |
| 177 | +- Reorder post install scriptlets |
| 178 | + |
| 179 | +* Sun Dec 25 2022 Alessandro Astone <[email protected]> - 1.3.4-2 |
| 180 | +- Add selinux label to android rootfs |
| 181 | +- Make package noarch |
| 182 | + |
| 183 | +* Wed Dec 14 2022 Alessandro Astone <[email protected]> - 1.3.4-1 |
| 184 | +- Update to 1.3.4 |
| 185 | + |
| 186 | +* Sat Nov 05 2022 Alessandro Astone <[email protected]> - 1.3.3-3 |
| 187 | +- Override selinux context of the android rootfs |
| 188 | +- Fixes https://github.com/casualsnek/waydroid_script |
| 189 | + |
| 190 | +* Sun Oct 30 2022 Alessandro Astone <[email protected]> - 1.3.3-2 |
| 191 | +- Add sepolicy for updating from the android app |
| 192 | + |
| 193 | +* Sun Sep 25 2022 Alessandro Astone <[email protected]> - 1.3.3-1 |
| 194 | +- Update to 1.3.3 |
| 195 | + |
| 196 | +* Fri Sep 02 2022 Alessandro Astone <[email protected]> - 1.3.1-1 |
| 197 | +- Update to 1.3.1 |
| 198 | + |
| 199 | +* Tue Aug 09 2022 Alessandro Astone <[email protected]> - 1.3.0-1 |
| 200 | +- Update to 1.3.0 |
| 201 | + |
| 202 | +* Sun Apr 17 2022 Alessandro Astone <[email protected]> - 1.2.1-1 |
| 203 | +- Update to 1.2.1 |
| 204 | + |
| 205 | +* Mon Mar 07 2022 Alessandro Astone <[email protected]> - 1.2.0-7.20220307git1.2.0 |
| 206 | +- Recommend pyclip |
| 207 | + |
| 208 | +* Sat Feb 26 2022 Alessandro Astone <[email protected]> - 1.2.0-5.20220226git1.2.0 |
| 209 | +- Add sepolicy for crash handler |
| 210 | + |
| 211 | +* Fri Feb 25 2022 Alessandro Astone <[email protected]> - 1.2.0-4.20220225git1.2.0 |
| 212 | +- Respin package |
| 213 | + |
| 214 | +* Wed Aug 12 2020 Qiyu Yan <[email protected]> - 0-0.1.20200811gitc87ea48 |
| 215 | +- initial package |
0 commit comments