core-dom0.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #
  2. # This is the SPEC file for creating binary RPMs for the Dom0.
  3. #
  4. #
  5. # The Qubes OS Project, http://www.qubes-os.org
  6. #
  7. # Copyright (C) 2010 Joanna Rutkowska <joanna@invisiblethingslab.com>
  8. # Copyright (C) 2010 Rafal Wojtczuk <rafal@invisiblethingslab.com>
  9. #
  10. # This program is free software; you can redistribute it and/or
  11. # modify it under the terms of the GNU General Public License
  12. # as published by the Free Software Foundation; either version 2
  13. # of the License, or (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  23. #
  24. #
  25. %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
  26. %{!?version: %define version %(cat version_dom0)}
  27. Name: qubes-core-dom0
  28. Version: %{version}
  29. Release: 1
  30. Summary: The Qubes core files (Dom0-side)
  31. Group: Qubes
  32. Vendor: Invisible Things Lab
  33. License: GPL
  34. URL: http://www.qubes-os.org
  35. Requires: python, xen-runtime, pciutils, python-inotify, python-daemon, kernel-qubes-dom0
  36. %define _builddir %(pwd)/dom0
  37. %description
  38. The Qubes core files for installation on Dom0.
  39. %install
  40. mkdir -p $RPM_BUILD_ROOT/etc/init.d
  41. cp init.d/qubes_core $RPM_BUILD_ROOT/etc/init.d/
  42. cp init.d/qubes_netvm $RPM_BUILD_ROOT/etc/init.d/
  43. mkdir -p $RPM_BUILD_ROOT/usr/bin/
  44. cp qvm-tools/qvm-* $RPM_BUILD_ROOT/usr/bin
  45. cp clipboard_notifier/qclipd $RPM_BUILD_ROOT/usr/bin
  46. cp pendrive_swapper/qfilexchgd $RPM_BUILD_ROOT/usr/bin
  47. mkdir -p $RPM_BUILD_ROOT%{python_sitearch}/qubes
  48. cp qvm-core/qubes.py $RPM_BUILD_ROOT%{python_sitearch}/qubes
  49. cp qvm-core/__init__.py $RPM_BUILD_ROOT%{python_sitearch}/qubes
  50. mkdir -p $RPM_BUILD_ROOT/usr/lib/qubes
  51. cp aux-tools/patch_appvm_initramfs.sh $RPM_BUILD_ROOT/usr/lib/qubes
  52. cp aux-tools/unbind_pci_device.sh $RPM_BUILD_ROOT/usr/lib/qubes
  53. cp aux-tools/unbind_all_network_devices $RPM_BUILD_ROOT/usr/lib/qubes
  54. cp aux-tools/convert_apptemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes
  55. cp aux-tools/convert_dirtemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes
  56. cp aux-tools/create_apps_for_appvm.sh $RPM_BUILD_ROOT/usr/lib/qubes
  57. cp aux-tools/remove_appvm_appmenus.sh $RPM_BUILD_ROOT/usr/lib/qubes
  58. cp pendrive_swapper/qubes_pencmd $RPM_BUILD_ROOT/usr/lib/qubes
  59. mkdir -p $RPM_BUILD_ROOT/var/lib/qubes
  60. mkdir -p $RPM_BUILD_ROOT/var/lib/qubes/vm-templates
  61. mkdir -p $RPM_BUILD_ROOT/var/lib/qubes/appvms
  62. mkdir -p $RPM_BUILD_ROOT/var/lib/qubes/backup
  63. mkdir -p $RPM_BUILD_ROOT/usr/share/qubes/icons
  64. cp icons/*.png $RPM_BUILD_ROOT/usr/share/qubes/icons
  65. %post
  66. if [ "$1" != 1 ] ; then
  67. # do this whole %post thing only when updating for the first time...
  68. exit 0
  69. fi
  70. #echo "Enabling essential services..."
  71. chkconfig haldaemon on
  72. chkconfig messagebus on
  73. chkconfig xenstored on
  74. chkconfig xend on
  75. chkconfig xenconsoled on
  76. chkconfig --add qubes_core || echo "WARNING: Cannot add service qubes_core!"
  77. chkconfig --add qubes_netvm || echo "WARNING: Cannot add service qubes_netvm!"
  78. chkconfig qubes_core on || echo "WARNING: Cannot enable service qubes_core!"
  79. chkconfig qubes_netvm on || echo "WARNING: Cannot enable service qubes_netvm!"
  80. if ! [ -e /var/lib/qubes/qubes.xml ]; then
  81. # echo "Initializing Qubes DB..."
  82. umask 007; sg qubes -c qvm-init-storage
  83. fi
  84. for i in /usr/share/qubes/icons/*.png ; do
  85. xdg-icon-resource install --novendor --size 48 $i
  86. done
  87. %clean
  88. rm -rf $RPM_BUILD_ROOT
  89. %pre
  90. if ! grep -q ^qubes: /etc/group ; then
  91. groupadd qubes
  92. fi
  93. %preun
  94. if [ "$1" = 0 ] ; then
  95. for i in /usr/share/qubes/icons/*.png ; do
  96. xdg-icon-resource uninstall --novendor --size 48 $i
  97. done
  98. fi
  99. %postun
  100. if [ "$1" = 0 ] ; then
  101. # no more packages left
  102. chgrp root /etc/xen
  103. chmod 700 /etc/xen
  104. groupdel qubes
  105. fi
  106. %files
  107. %defattr(-,root,root,-)
  108. /etc/init.d/qubes_core
  109. /etc/init.d/qubes_netvm
  110. /usr/bin/qvm-*
  111. /usr/bin/qclipd
  112. /usr/bin/qfilexchgd
  113. %{python_sitearch}/qubes/qubes.py
  114. %{python_sitearch}/qubes/qubes.pyc
  115. %{python_sitearch}/qubes/qubes.pyo
  116. %{python_sitearch}/qubes/__init__.py
  117. %{python_sitearch}/qubes/__init__.pyc
  118. %{python_sitearch}/qubes/__init__.pyo
  119. /usr/lib/qubes/patch_appvm_initramfs.sh
  120. /usr/lib/qubes/unbind_pci_device.sh
  121. /usr/lib/qubes/unbind_all_network_devices
  122. /usr/lib/qubes/convert_apptemplate2vm.sh
  123. /usr/lib/qubes/convert_dirtemplate2vm.sh
  124. /usr/lib/qubes/create_apps_for_appvm.sh
  125. /usr/lib/qubes/remove_appvm_appmenus.sh
  126. /usr/lib/qubes/qubes_pencmd
  127. %attr(770,root,qubes) %dir /var/lib/qubes
  128. %attr(770,root,qubes) %dir /var/lib/qubes/vm-templates
  129. %attr(770,root,qubes) %dir /var/lib/qubes/appvms
  130. %attr(770,root,qubes) %dir /var/lib/qubes/backup
  131. %dir /usr/share/qubes/icons/*.png