core-dom0.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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. #%{!?python3_sitelib: %define python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(False)")}
  26. %{!?version: %define version %(cat version)}
  27. # debug_package hack should be removed when BuildArch:noarch is enabled below
  28. %define debug_package %{nil}
  29. %define _dracutmoddir /usr/lib/dracut/modules.d
  30. %if %{fedora} < 17
  31. %define _dracutmoddir /usr/share/dracut/modules.d
  32. %endif
  33. Name: qubes-core-dom0
  34. Version: %{version}
  35. Release: 1%{dist}
  36. Summary: The Qubes core files (Dom0-side)
  37. Group: Qubes
  38. Vendor: Invisible Things Lab
  39. License: GPL
  40. URL: http://www.qubes-os.org
  41. # because we have "#!/usr/bin/env python" shebangs, RPM puts
  42. # "Requires: $(which # python)" dependency, which, depending on $PATH order,
  43. # may point to /usr/bin/python or /bin/python (because Fedora has this stupid
  44. # /bin -> usr/bin symlink). python*.rpm provides only /usr/bin/python.
  45. AutoReq: no
  46. # FIXME: Enable this and disable debug_package
  47. #BuildArch: noarch
  48. BuildRequires: ImageMagick
  49. BuildRequires: systemd-units
  50. BuildRequires: python3-devel
  51. # for building documentation
  52. BuildRequires: python3-sphinx
  53. BuildRequires: libvirt-python3
  54. BuildRequires: python3-dbus
  55. Requires(post): systemd-units
  56. Requires(preun): systemd-units
  57. Requires(postun): systemd-units
  58. Requires: python, pciutils, python-inotify, python-daemon
  59. Requires: python-setuptools
  60. Requires: qubes-core-dom0-linux >= 3.1.8
  61. Requires: qubes-core-dom0-doc
  62. Requires: qubes-db-dom0
  63. Requires: python3-lxml
  64. # TODO: R: qubes-gui-dom0 >= 2.1.11
  65. Conflicts: qubes-gui-dom0 < 1.1.13
  66. Requires: libvirt-python3
  67. %if x%{?backend_vmm} == xxen
  68. Requires: xen-runtime
  69. Requires: xen-hvm
  70. Requires: libvirt-daemon-xen >= 1.2.20-6
  71. %endif
  72. Requires: createrepo
  73. Requires: gnome-packagekit
  74. Requires: cronie
  75. Requires: bsdtar
  76. Requires: python3-jinja2
  77. # for qubes-hcl-report
  78. Requires: dmidecode
  79. Requires: PyQt4
  80. # for property's docstrings
  81. Requires: python3-docutils
  82. # for lvm support
  83. Requires: lvm2-python-libs
  84. # Prevent preupgrade from installation (it pretend to provide distribution upgrade)
  85. Obsoletes: preupgrade < 2.0
  86. Provides: preupgrade = 2.0
  87. %define _builddir %(pwd)
  88. %description
  89. The Qubes core files for installation on Dom0.
  90. %prep
  91. # we operate on the current directory, so no need to unpack anything
  92. # symlink is to generate useful debuginfo packages
  93. rm -f %{name}-%{version}
  94. ln -sf . %{name}-%{version}
  95. %setup -T -D
  96. %build
  97. make all
  98. %install
  99. make install \
  100. DESTDIR=$RPM_BUILD_ROOT \
  101. UNITDIR=%{_unitdir} \
  102. PYTHON_SITEPATH=%{python3_sitelib} \
  103. SYSCONFDIR=%{_sysconfdir}
  104. %post
  105. # Create NetworkManager configuration if we do not have it
  106. if ! [ -e /etc/NetworkManager/NetworkManager.conf ]; then
  107. echo '[main]' > /etc/NetworkManager/NetworkManager.conf
  108. echo 'plugins = keyfile' >> /etc/NetworkManager/NetworkManager.conf
  109. echo '[keyfile]' >> /etc/NetworkManager/NetworkManager.conf
  110. fi
  111. sed '/^autoballoon=/d;/^lockfile=/d' -i /etc/xen/xl.conf
  112. echo 'autoballoon=0' >> /etc/xen/xl.conf
  113. echo 'lockfile="/var/run/qubes/xl-lock"' >> /etc/xen/xl.conf
  114. if [ -e /etc/sysconfig/prelink ]; then
  115. sed 's/^PRELINKING\s*=.*/PRELINKING=no/' -i /etc/sysconfig/prelink
  116. fi
  117. systemctl --no-reload enable qubes-core.service >/dev/null 2>&1
  118. systemctl --no-reload enable qubes-netvm.service >/dev/null 2>&1
  119. systemctl --no-reload enable qubes-setupdvm.service >/dev/null 2>&1
  120. # Conflicts with libxl stack, so disable it
  121. systemctl --no-reload disable xend.service >/dev/null 2>&1
  122. systemctl --no-reload disable xendomains.service >/dev/null 2>&1
  123. systemctl daemon-reload >/dev/null 2>&1 || :
  124. HAD_SYSCONFIG_NETWORK=yes
  125. if ! [ -e /etc/sysconfig/network ]; then
  126. HAD_SYSCONFIG_NETWORK=no
  127. # supplant empty one so NetworkManager init script does not complain
  128. touch /etc/sysconfig/network
  129. fi
  130. # Load evtchn module - xenstored needs it
  131. modprobe evtchn 2> /dev/null || modprobe xen-evtchn
  132. service xenstored start
  133. if ! [ -e /var/lib/qubes/qubes.xml ]; then
  134. # echo "Initializing Qubes DB..."
  135. umask 007; sg qubes -c 'qubes-create --offline-mode'
  136. qubes-prefs --force-root --offline-mode default-kernel `ls /var/lib/qubes/vm-kernels|head -n 1` 2> /dev/null
  137. fi
  138. # Because we now have an installer
  139. # this script is always executed during upgrade
  140. # and we decided not to restart core during upgrade
  141. #service qubes_core start
  142. if [ "x"$HAD_SYSCONFIG_NETWORK = "xno" ]; then
  143. rm -f /etc/sysconfig/network
  144. fi
  145. %clean
  146. rm -rf $RPM_BUILD_ROOT
  147. rm -f %{name}-%{version}
  148. %pre
  149. if ! grep -q ^qubes: /etc/group ; then
  150. groupadd qubes
  151. fi
  152. %triggerin -- xen-runtime
  153. /usr/lib/qubes/fix-dir-perms.sh
  154. %preun
  155. if [ "$1" = 0 ] ; then
  156. # no more packages left
  157. service qubes_netvm stop
  158. service qubes_core stop
  159. fi
  160. %postun
  161. if [ "$1" = 0 ] ; then
  162. # no more packages left
  163. chgrp root /etc/xen
  164. chmod 700 /etc/xen
  165. groupdel qubes
  166. fi
  167. %files
  168. %defattr(-,root,root,-)
  169. %config(noreplace) %attr(0664,root,qubes) %{_sysconfdir}/qubes/qmemman.conf
  170. /usr/bin/qvm-*
  171. /usr/bin/qubes-*
  172. /usr/bin/qmemmand
  173. /usr/bin/qubesd
  174. %dir %{python3_sitelib}/qubes-*.egg-info
  175. %{python3_sitelib}/qubes-*.egg-info/*
  176. %dir %{python3_sitelib}/qubes
  177. %dir %{python3_sitelib}/qubes/__pycache__
  178. %{python3_sitelib}/qubes/__pycache__/*
  179. %{python3_sitelib}/qubes/__init__.py
  180. %{python3_sitelib}/qubes/app.py
  181. %{python3_sitelib}/qubes/backup.py
  182. %{python3_sitelib}/qubes/config.py
  183. %{python3_sitelib}/qubes/core2migration.py
  184. %{python3_sitelib}/qubes/devices.py
  185. %{python3_sitelib}/qubes/dochelpers.py
  186. %{python3_sitelib}/qubes/events.py
  187. %{python3_sitelib}/qubes/exc.py
  188. %{python3_sitelib}/qubes/firewall.py
  189. %{python3_sitelib}/qubes/libvirtaio.py
  190. %{python3_sitelib}/qubes/log.py
  191. %{python3_sitelib}/qubes/rngdoc.py
  192. %{python3_sitelib}/qubes/tarwriter.py
  193. %{python3_sitelib}/qubes/utils.py
  194. %dir %{python3_sitelib}/qubes/vm
  195. %dir %{python3_sitelib}/qubes/vm/__pycache__
  196. %{python3_sitelib}/qubes/vm/__pycache__/*
  197. %{python3_sitelib}/qubes/vm/__init__.py
  198. %{python3_sitelib}/qubes/vm/adminvm.py
  199. %{python3_sitelib}/qubes/vm/appvm.py
  200. %{python3_sitelib}/qubes/vm/dispvm.py
  201. %{python3_sitelib}/qubes/vm/qubesvm.py
  202. %{python3_sitelib}/qubes/vm/standalonevm.py
  203. %{python3_sitelib}/qubes/vm/templatevm.py
  204. %dir %{python3_sitelib}/qubes/vm/mix
  205. %dir %{python3_sitelib}/qubes/vm/mix/__pycache__
  206. %{python3_sitelib}/qubes/vm/mix/__pycache__/*
  207. %{python3_sitelib}/qubes/vm/mix/__init__.py
  208. %{python3_sitelib}/qubes/vm/mix/net.py
  209. %dir %{python3_sitelib}/qubes/storage
  210. %dir %{python3_sitelib}/qubes/storage/__pycache__
  211. %{python3_sitelib}/qubes/storage/__pycache__/*
  212. %{python3_sitelib}/qubes/storage/__init__.py
  213. %{python3_sitelib}/qubes/storage/file.py
  214. %{python3_sitelib}/qubes/storage/domain.py
  215. %{python3_sitelib}/qubes/storage/kernels.py
  216. %{python3_sitelib}/qubes/storage/lvm.py
  217. %dir %{python3_sitelib}/qubes/tools
  218. %dir %{python3_sitelib}/qubes/tools/__pycache__
  219. %{python3_sitelib}/qubes/tools/__pycache__/*
  220. %{python3_sitelib}/qubes/tools/__init__.py
  221. %{python3_sitelib}/qubes/tools/qmemmand.py
  222. %{python3_sitelib}/qubes/tools/qubes_create.py
  223. %{python3_sitelib}/qubes/tools/qubes_monitor_layout_notify.py
  224. %{python3_sitelib}/qubes/tools/qubes_prefs.py
  225. %{python3_sitelib}/qubes/tools/qubesd.py
  226. %{python3_sitelib}/qubes/tools/qvm_block.py
  227. %{python3_sitelib}/qubes/tools/qvm_backup.py
  228. %{python3_sitelib}/qubes/tools/qvm_backup_restore.py
  229. %{python3_sitelib}/qubes/tools/qvm_create.py
  230. %{python3_sitelib}/qubes/tools/qvm_device.py
  231. %{python3_sitelib}/qubes/tools/qvm_features.py
  232. %{python3_sitelib}/qubes/tools/qvm_firewall.py
  233. %{python3_sitelib}/qubes/tools/qvm_check.py
  234. %{python3_sitelib}/qubes/tools/qvm_clone.py
  235. %{python3_sitelib}/qubes/tools/qvm_kill.py
  236. %{python3_sitelib}/qubes/tools/qvm_ls.py
  237. %{python3_sitelib}/qubes/tools/qvm_pause.py
  238. %{python3_sitelib}/qubes/tools/qvm_pool.py
  239. %{python3_sitelib}/qubes/tools/qvm_prefs.py
  240. %{python3_sitelib}/qubes/tools/qvm_remove.py
  241. %{python3_sitelib}/qubes/tools/qvm_run.py
  242. %{python3_sitelib}/qubes/tools/qvm_shutdown.py
  243. %{python3_sitelib}/qubes/tools/qvm_start.py
  244. %{python3_sitelib}/qubes/tools/qvm_tags.py
  245. %{python3_sitelib}/qubes/tools/qvm_template_commit.py
  246. %{python3_sitelib}/qubes/tools/qvm_template_postprocess.py
  247. %{python3_sitelib}/qubes/tools/qvm_unpause.py
  248. %dir %{python3_sitelib}/qubes/ext
  249. %dir %{python3_sitelib}/qubes/ext/__pycache__
  250. %{python3_sitelib}/qubes/ext/__pycache__/*
  251. %{python3_sitelib}/qubes/ext/__init__.py
  252. %{python3_sitelib}/qubes/ext/gui.py
  253. %{python3_sitelib}/qubes/ext/pci.py
  254. %{python3_sitelib}/qubes/ext/qubesmanager.py
  255. %{python3_sitelib}/qubes/ext/r3compatibility.py
  256. %dir %{python3_sitelib}/qubes/tests
  257. %dir %{python3_sitelib}/qubes/tests/__pycache__
  258. %{python3_sitelib}/qubes/tests/__pycache__/*
  259. %{python3_sitelib}/qubes/tests/__init__.py
  260. %{python3_sitelib}/qubes/tests/run.py
  261. %{python3_sitelib}/qubes/tests/extra.py
  262. %{python3_sitelib}/qubes/tests/app.py
  263. %{python3_sitelib}/qubes/tests/devices.py
  264. %{python3_sitelib}/qubes/tests/events.py
  265. %{python3_sitelib}/qubes/tests/firewall.py
  266. %{python3_sitelib}/qubes/tests/init.py
  267. %{python3_sitelib}/qubes/tests/storage.py
  268. %{python3_sitelib}/qubes/tests/storage_file.py
  269. %{python3_sitelib}/qubes/tests/storage_lvm.py
  270. %{python3_sitelib}/qubes/tests/tarwriter.py
  271. %dir %{python3_sitelib}/qubes/tests/vm
  272. %dir %{python3_sitelib}/qubes/tests/vm/__pycache__
  273. %{python3_sitelib}/qubes/tests/vm/__pycache__/*
  274. %{python3_sitelib}/qubes/tests/vm/__init__.py
  275. %{python3_sitelib}/qubes/tests/vm/init.py
  276. %{python3_sitelib}/qubes/tests/vm/adminvm.py
  277. %{python3_sitelib}/qubes/tests/vm/qubesvm.py
  278. %dir %{python3_sitelib}/qubes/tests/vm/mix
  279. %dir %{python3_sitelib}/qubes/tests/vm/mix/__pycache__
  280. %{python3_sitelib}/qubes/tests/vm/mix/__pycache__/*
  281. %{python3_sitelib}/qubes/tests/vm/mix/__init__.py
  282. %{python3_sitelib}/qubes/tests/vm/mix/net.py
  283. %dir %{python3_sitelib}/qubes/tests/tools
  284. %dir %{python3_sitelib}/qubes/tests/tools/__pycache__
  285. %{python3_sitelib}/qubes/tests/tools/__pycache__/*
  286. %{python3_sitelib}/qubes/tests/tools/__init__.py
  287. %{python3_sitelib}/qubes/tests/tools/init.py
  288. %{python3_sitelib}/qubes/tests/tools/qvm_device.py
  289. %{python3_sitelib}/qubes/tests/tools/qvm_firewall.py
  290. %{python3_sitelib}/qubes/tests/tools/qvm_ls.py
  291. %dir %{python3_sitelib}/qubes/tests/integ
  292. %dir %{python3_sitelib}/qubes/tests/integ/__pycache__
  293. %{python3_sitelib}/qubes/tests/integ/__pycache__/*
  294. %{python3_sitelib}/qubes/tests/integ/__init__.py
  295. %{python3_sitelib}/qubes/tests/integ/backup.py
  296. %{python3_sitelib}/qubes/tests/integ/backupcompatibility.py
  297. %{python3_sitelib}/qubes/tests/integ/basic.py
  298. %{python3_sitelib}/qubes/tests/integ/devices_pci.py
  299. %{python3_sitelib}/qubes/tests/integ/dispvm.py
  300. %{python3_sitelib}/qubes/tests/integ/dom0_update.py
  301. %{python3_sitelib}/qubes/tests/integ/network.py
  302. %{python3_sitelib}/qubes/tests/integ/storage.py
  303. %{python3_sitelib}/qubes/tests/integ/vm_qrexec_gui.py
  304. %dir %{python3_sitelib}/qubes/tests/integ/tools
  305. %dir %{python3_sitelib}/qubes/tests/integ/tools/__pycache__
  306. %{python3_sitelib}/qubes/tests/integ/tools/__pycache__/*
  307. %{python3_sitelib}/qubes/tests/integ/tools/__init__.py
  308. %{python3_sitelib}/qubes/tests/integ/tools/qubes_create.py
  309. %{python3_sitelib}/qubes/tests/integ/tools/qvm_firewall.py
  310. %{python3_sitelib}/qubes/tests/integ/tools/qvm_check.py
  311. %{python3_sitelib}/qubes/tests/integ/tools/qvm_prefs.py
  312. %{python3_sitelib}/qubes/tests/integ/tools/qvm_run.py
  313. %dir %{python3_sitelib}/qubes/qmemman
  314. %dir %{python3_sitelib}/qubes/qmemman/__pycache__
  315. %{python3_sitelib}/qubes/qmemman/__pycache__/*
  316. %{python3_sitelib}/qubes/qmemman/__init__.py
  317. %{python3_sitelib}/qubes/qmemman/algo.py
  318. %{python3_sitelib}/qubes/qmemman/client.py
  319. /usr/lib/qubes/unbind-pci-device.sh
  320. /usr/lib/qubes/cleanup-dispvms
  321. /usr/lib/qubes/qfile-daemon-dvm*
  322. /usr/lib/qubes/block-cleaner-daemon.py*
  323. /usr/lib/qubes/vusb-ctl.py*
  324. /usr/lib/qubes/xl-qvm-usb-attach.py*
  325. /usr/lib/qubes/xl-qvm-usb-detach.py*
  326. /usr/lib/qubes/fix-dir-perms.sh
  327. /usr/lib/qubes/startup-dvm.sh
  328. /usr/lib/qubes/startup-misc.sh
  329. /usr/lib/qubes/prepare-volatile-img.sh
  330. /usr/libexec/qubes/qubes-notify-tools
  331. /usr/libexec/qubes/qubes-notify-updates
  332. %{_unitdir}/qubes-block-cleaner.service
  333. %{_unitdir}/qubes-core.service
  334. %{_unitdir}/qubes-setupdvm.service
  335. %{_unitdir}/qubes-netvm.service
  336. %{_unitdir}/qubes-qmemman.service
  337. %{_unitdir}/qubes-vm@.service
  338. %{_unitdir}/qubesd.service
  339. %{_unitdir}/qubes-reload-firewall@.service
  340. %{_unitdir}/qubes-reload-firewall@.timer
  341. %attr(2770,root,qubes) %dir /var/lib/qubes
  342. %attr(2770,root,qubes) %dir /var/lib/qubes/vm-templates
  343. %attr(2770,root,qubes) %dir /var/lib/qubes/appvms
  344. %attr(2770,root,qubes) %dir /var/lib/qubes/servicevms
  345. %attr(2770,root,qubes) %dir /var/lib/qubes/backup
  346. %attr(2770,root,qubes) %dir /var/lib/qubes/dvmdata
  347. %attr(2770,root,qubes) %dir /var/lib/qubes/vm-kernels
  348. /usr/share/qubes/templates/libvirt/xen.xml
  349. /usr/share/qubes/templates/libvirt/devices/pci.xml
  350. /usr/share/qubes/templates/libvirt/devices/net.xml
  351. /usr/lib/tmpfiles.d/qubes.conf
  352. /usr/lib/qubes/qubes-prepare-saved-domain.sh
  353. /usr/lib/qubes/qubes-update-dispvm-savefile-with-progress.sh
  354. /etc/xen/scripts/block.qubes
  355. /etc/xen/scripts/block-snapshot
  356. /etc/xen/scripts/block-origin
  357. /etc/xen/scripts/vif-route-qubes
  358. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.FeaturesRequest
  359. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.Filecopy
  360. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.GetImageRGBA
  361. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.GetRandomizedTime
  362. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.NotifyTools
  363. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.NotifyUpdates
  364. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.OpenInVM
  365. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.OpenURL
  366. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.VMShell
  367. /etc/qubes-rpc/qubes.FeaturesRequest
  368. /etc/qubes-rpc/qubes.GetRandomizedTime
  369. /etc/qubes-rpc/qubes.NotifyTools
  370. /etc/qubes-rpc/qubes.NotifyUpdates
  371. %attr(2770,root,qubes) %dir /var/log/qubes
  372. %attr(0770,root,qubes) %dir /var/run/qubes
  373. /etc/xdg/autostart/qubes-guid.desktop
  374. /usr/share/doc/qubes/relaxng/*.rng