1 Summary: %{?title}%{!?title:Android-x86} - Run Android on your PC
2 Name: %{?name}%{!?name:android-x86}
3 Version: %(echo %{ver} | cut -d- -f1)
4 Release: %(echo %{ver} | cut -d- -f2)
10 License: Apache Public License / GPLv2
11 Group: Operating system/Android
12 URL: http://www.android-x86.org
15 Android-x86 is an open source project to port AOSP to x86 platform. Most
16 components of the project is licensed under Apache Public License 2.0.
17 Some components are licensed under GNU General Public License (GPL) 2.0
26 mkdir -p %{buildroot}/%{install_prefix} %{buildroot}%{_bindir}
27 install -m644 %{S:1} %{S:2} %{S:3} %{S:4} %{buildroot}/%{install_prefix}
28 install -m755 %{S:5} %{buildroot}%{_bindir}
29 sed -i "s|ANDROID_ROOT|/%{install_prefix}|; s|CMDLINE|%{cmdline}|" %{buildroot}%{_bindir}/`basename %{S:5}`
33 mkdir -p /%{install_prefix}/data
34 if [ "$ID" = "debian" -o "$ID_LIKE" = "debian" ]; then
35 grubcfg=/boot/grub/custom.cfg
36 elif mountpoint -q /boot/efi; then
37 grubcfg=/boot/efi/EFI/$ID/custom.cfg && efi=efi
39 grubcfg=/boot/grub2/custom.cfg
41 echo -e "menuentry \"%{?title}%{!?title:Android-x86} %{ver}\" {\n\tsearch --set=root --file /%{install_prefix}/kernel\n\tlinux$efi /%{install_prefix}/kernel quiet %{cmdline} \n\tinitrd$efi /%{install_prefix}/initrd.img\n}" > $grubcfg
42 echo -e "menuentry \"%{?title}%{!?title:Android-x86} %{ver} (DEBUG mode)\" {\n\tsearch --set=root --file /%{install_prefix}/kernel\n\tlinux$efi /%{install_prefix}/kernel %{cmdline} DEBUG=2\n\tinitrd$efi /%{install_prefix}/initrd.img\n}" >> $grubcfg
44 if [ "$ID" = "debian" -o "$ID_LIKE" = "debian" ]; then
45 sed -i 's/^GRUB_HIDDEN_/#GRUB_HIDDEN_/' /etc/default/grub
51 if [ "$ID" = "debian" -o "$ID_LIKE" = "debian" ]; then
52 grubcfg=/boot/grub/custom.cfg
53 elif mountpoint -q /boot/efi; then
54 grubcfg=/boot/efi/EFI/$ID/custom.cfg
56 grubcfg=/boot/grub2/custom.cfg
58 if [ "$1" = "1" ]; then
59 new_prefix=`dirname $(grep initrd $grubcfg | head -1 | awk '{print $2}')`
60 if [ "$new_prefix" != "/%{install_prefix}" ]; then
61 rmdir $new_prefix/data
62 mv /%{install_prefix}/data $new_prefix
63 rmdir /%{install_prefix}
66 rmdir /%{install_prefix}/data /%{install_prefix}