core-dom0.spec.in 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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 library is free software; you can redistribute it and/or
  11. # modify it under the terms of the GNU Lesser General Public
  12. # License as published by the Free Software Foundation; either
  13. # version 2.1 of the License, or (at your option) any later version.
  14. #
  15. # This library 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 GNU
  18. # Lesser General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU Lesser General Public
  21. # License along with this library; if not, see <https://www.gnu.org/licenses/>.
  22. #
  23. #
  24. %define _dracutmoddir /usr/lib/dracut/modules.d
  25. %define backend_vmm @BACKEND_VMM@
  26. Name: qubes-core-dom0
  27. Version: @VERSION@
  28. Release: 1%{dist}
  29. Summary: The Qubes core files (Dom0-side)
  30. Group: Qubes
  31. Vendor: Invisible Things Lab
  32. License: GPL
  33. URL: http://www.qubes-os.org
  34. # because we have "#!/usr/bin/env python" shebangs, RPM puts
  35. # "Requires: $(which # python)" dependency, which, depending on $PATH order,
  36. # may point to /usr/bin/python or /bin/python (because Fedora has this stupid
  37. # /bin -> usr/bin symlink). python*.rpm provides only /usr/bin/python.
  38. AutoReq: no
  39. # FIXME: Enable this and disable debug_package
  40. #BuildArch: noarch
  41. BuildRequires: ImageMagick
  42. BuildRequires: systemd-units
  43. BuildRequires: systemd
  44. BuildRequires: python3-devel
  45. # for building documentation
  46. BuildRequires: python3-sphinx
  47. BuildRequires: python3-lxml
  48. BuildRequires: libvirt-python3
  49. BuildRequires: python3-dbus
  50. BuildRequires: python3-PyYAML
  51. Requires(post): systemd-units
  52. Requires(preun): systemd-units
  53. Requires(postun): systemd-units
  54. Requires: python3
  55. #Requires: python3-aiofiles
  56. Requires: python3-docutils
  57. Requires: python3-jinja2
  58. Requires: python3-lxml
  59. Requires: python3-pydbus
  60. Requires: python3-qubesdb
  61. Requires: python3-setuptools
  62. Requires: python3-PyYAML
  63. Requires: python3-xen
  64. Requires: libvirt-python3
  65. Requires: pciutils
  66. Requires: qubes-core-dom0-linux >= 4.0.11
  67. Requires: qubes-db-dom0
  68. # TODO: R: qubes-gui-dom0 >= 2.1.11
  69. Conflicts: qubes-gui-dom0 < 1.1.13
  70. %if x%{?backend_vmm} == xxen
  71. Requires: xen-runtime
  72. Requires: xen-hvm
  73. Requires: xen-hvm-stubdom-linux
  74. Requires: libvirt-daemon-xen >= 3.3.0-7
  75. %endif
  76. Requires: createrepo
  77. Requires: cronie
  78. Requires: scrypt
  79. # for qubes-hcl-report
  80. Requires: dmidecode
  81. Requires: PyQt4
  82. %{?systemd_requires}
  83. Obsoletes: qubes-core-dom0-doc <= 4.0
  84. Provides: qubes-core-dom0-doc
  85. # Prevent preupgrade from installation (it pretend to provide distribution upgrade)
  86. Obsoletes: preupgrade < 2.0
  87. Provides: preupgrade = 2.0
  88. Source0: %{name}-%{version}.tar.gz
  89. %description
  90. The Qubes core files for installation on Dom0.
  91. %prep
  92. %setup -q
  93. %build
  94. make all
  95. make -C doc PYTHON=%{__python3} SPHINXBUILD=sphinx-build-%{python3_version} man
  96. %install
  97. make install \
  98. DESTDIR=$RPM_BUILD_ROOT \
  99. BACKEND_VMM=%{backend_vmm} \
  100. UNITDIR=%{_unitdir} \
  101. PYTHON_SITEPATH=%{python3_sitelib} \
  102. SYSCONFDIR=%{_sysconfdir}
  103. make -C doc DESTDIR=$RPM_BUILD_ROOT \
  104. PYTHON=%{__python3} SPHINXBUILD=sphinx-build-%{python3_version} \
  105. install
  106. mkdir -p $RPM_BUILD_ROOT/etc/qubes/backup
  107. %post
  108. %systemd_post qubes-core.service
  109. %systemd_post qubes-qmemman.service
  110. %systemd_post qubesd.service
  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. # Conflicts with libxl stack, so disable it
  118. systemctl --no-reload disable xend.service >/dev/null 2>&1
  119. systemctl --no-reload disable xendomains.service >/dev/null 2>&1
  120. systemctl daemon-reload >/dev/null 2>&1 || :
  121. if ! [ -e /var/lib/qubes/qubes.xml ]; then
  122. # echo "Initializing Qubes DB..."
  123. umask 007; sg qubes -c 'qubes-create --offline-mode'
  124. fi
  125. %clean
  126. rm -rf $RPM_BUILD_ROOT
  127. rm -f %{name}-%{version}
  128. %pre
  129. if ! grep -q ^qubes: /etc/group ; then
  130. groupadd qubes
  131. fi
  132. %triggerin -- xen-runtime
  133. /usr/lib/qubes/fix-dir-perms.sh
  134. %preun
  135. %systemd_preun qubes-core.service
  136. %systemd_preun qubes-qmemman.service
  137. %systemd_preun qubesd.service
  138. if [ "$1" = 0 ] ; then
  139. # no more packages left
  140. service qubes_netvm stop
  141. service qubes_core stop
  142. fi
  143. %postun
  144. %systemd_postun qubes-core.service
  145. %systemd_postun_with_restart qubes-qmemman.service
  146. %systemd_postun_with_restart qubesd.service
  147. if [ "$1" = 0 ] ; then
  148. # no more packages left
  149. chgrp root /etc/xen
  150. chmod 700 /etc/xen
  151. groupdel qubes
  152. fi
  153. %files
  154. %defattr(-,root,root,-)
  155. %config(noreplace) %attr(0664,root,qubes) %{_sysconfdir}/qubes/qmemman.conf
  156. %config(noreplace) /etc/dbus-1/system.d/org.qubesos.PolicyAgent.conf
  157. %config(noreplace) /etc/logrotate.d/qubes
  158. %attr(770,root,qubes) %dir /etc/qubes/backup
  159. /usr/bin/qvm-*
  160. /usr/bin/qubes-*
  161. /usr/bin/qmemmand
  162. /usr/bin/qubesd*
  163. /usr/bin/qrexec-policy
  164. /usr/bin/qrexec-policy-agent
  165. /usr/bin/qrexec-policy-graph
  166. %{_mandir}/man1/qrexec-policy-graph.1*
  167. %{_mandir}/man1/qubes*.1*
  168. %{_mandir}/man1/qvm-*.1*
  169. %dir %{python3_sitelib}/qubes-*.egg-info
  170. %{python3_sitelib}/qubes-*.egg-info/*
  171. %dir %{python3_sitelib}/qubes
  172. %dir %{python3_sitelib}/qubes/__pycache__
  173. %{python3_sitelib}/qubes/__pycache__/*
  174. %{python3_sitelib}/qubes/__init__.py
  175. %{python3_sitelib}/qubes/app.py
  176. %{python3_sitelib}/qubes/backup.py
  177. %{python3_sitelib}/qubes/config.py
  178. %{python3_sitelib}/qubes/devices.py
  179. %{python3_sitelib}/qubes/dochelpers.py
  180. %{python3_sitelib}/qubes/events.py
  181. %{python3_sitelib}/qubes/exc.py
  182. %{python3_sitelib}/qubes/features.py
  183. %{python3_sitelib}/qubes/firewall.py
  184. %{python3_sitelib}/qubes/log.py
  185. %{python3_sitelib}/qubes/rngdoc.py
  186. %{python3_sitelib}/qubes/tarwriter.py
  187. %{python3_sitelib}/qubes/utils.py
  188. %dir %{python3_sitelib}/qubes/api
  189. %dir %{python3_sitelib}/qubes/api/__pycache__
  190. %{python3_sitelib}/qubes/api/__pycache__/*
  191. %{python3_sitelib}/qubes/api/__init__.py
  192. %{python3_sitelib}/qubes/api/admin.py
  193. %{python3_sitelib}/qubes/api/internal.py
  194. %{python3_sitelib}/qubes/api/misc.py
  195. %dir %{python3_sitelib}/qubes/vm
  196. %dir %{python3_sitelib}/qubes/vm/__pycache__
  197. %{python3_sitelib}/qubes/vm/__pycache__/*
  198. %{python3_sitelib}/qubes/vm/__init__.py
  199. %{python3_sitelib}/qubes/vm/adminvm.py
  200. %{python3_sitelib}/qubes/vm/appvm.py
  201. %{python3_sitelib}/qubes/vm/dispvm.py
  202. %{python3_sitelib}/qubes/vm/qubesvm.py
  203. %{python3_sitelib}/qubes/vm/standalonevm.py
  204. %{python3_sitelib}/qubes/vm/templatevm.py
  205. %dir %{python3_sitelib}/qubes/vm/mix
  206. %dir %{python3_sitelib}/qubes/vm/mix/__pycache__
  207. %{python3_sitelib}/qubes/vm/mix/__pycache__/*
  208. %{python3_sitelib}/qubes/vm/mix/__init__.py
  209. %{python3_sitelib}/qubes/vm/mix/net.py
  210. %dir %{python3_sitelib}/qubes/storage
  211. %dir %{python3_sitelib}/qubes/storage/__pycache__
  212. %{python3_sitelib}/qubes/storage/__pycache__/*
  213. %{python3_sitelib}/qubes/storage/__init__.py
  214. %{python3_sitelib}/qubes/storage/file.py
  215. %{python3_sitelib}/qubes/storage/reflink.py
  216. %{python3_sitelib}/qubes/storage/kernels.py
  217. %{python3_sitelib}/qubes/storage/lvm.py
  218. %dir %{python3_sitelib}/qubes/tools
  219. %dir %{python3_sitelib}/qubes/tools/__pycache__
  220. %{python3_sitelib}/qubes/tools/__pycache__/*
  221. %{python3_sitelib}/qubes/tools/__init__.py
  222. %{python3_sitelib}/qubes/tools/qmemmand.py
  223. %{python3_sitelib}/qubes/tools/qubes_create.py
  224. %{python3_sitelib}/qubes/tools/qubesd.py
  225. %{python3_sitelib}/qubes/tools/qubesd_query.py
  226. %dir %{python3_sitelib}/qubes/ext
  227. %dir %{python3_sitelib}/qubes/ext/__pycache__
  228. %{python3_sitelib}/qubes/ext/__pycache__/*
  229. %{python3_sitelib}/qubes/ext/__init__.py
  230. %{python3_sitelib}/qubes/ext/admin.py
  231. %{python3_sitelib}/qubes/ext/block.py
  232. %{python3_sitelib}/qubes/ext/core_features.py
  233. %{python3_sitelib}/qubes/ext/gui.py
  234. %{python3_sitelib}/qubes/ext/pci.py
  235. %{python3_sitelib}/qubes/ext/qubesmanager.py
  236. %{python3_sitelib}/qubes/ext/r3compatibility.py
  237. %{python3_sitelib}/qubes/ext/services.py
  238. %{python3_sitelib}/qubes/ext/windows.py
  239. %dir %{python3_sitelib}/qubes/tests
  240. %dir %{python3_sitelib}/qubes/tests/__pycache__
  241. %{python3_sitelib}/qubes/tests/__pycache__/*
  242. %{python3_sitelib}/qubes/tests/__init__.py
  243. %{python3_sitelib}/qubes/tests/run.py
  244. %{python3_sitelib}/qubes/tests/extra.py
  245. %{python3_sitelib}/qubes/tests/api.py
  246. %{python3_sitelib}/qubes/tests/api_admin.py
  247. %{python3_sitelib}/qubes/tests/api_misc.py
  248. %{python3_sitelib}/qubes/tests/app.py
  249. %{python3_sitelib}/qubes/tests/devices.py
  250. %{python3_sitelib}/qubes/tests/devices_block.py
  251. %{python3_sitelib}/qubes/tests/events.py
  252. %{python3_sitelib}/qubes/tests/ext.py
  253. %{python3_sitelib}/qubes/tests/firewall.py
  254. %{python3_sitelib}/qubes/tests/init.py
  255. %{python3_sitelib}/qubes/tests/storage.py
  256. %{python3_sitelib}/qubes/tests/storage_file.py
  257. %{python3_sitelib}/qubes/tests/storage_reflink.py
  258. %{python3_sitelib}/qubes/tests/storage_kernels.py
  259. %{python3_sitelib}/qubes/tests/storage_lvm.py
  260. %{python3_sitelib}/qubes/tests/tarwriter.py
  261. %dir %{python3_sitelib}/qubes/tests/vm
  262. %dir %{python3_sitelib}/qubes/tests/vm/__pycache__
  263. %{python3_sitelib}/qubes/tests/vm/__pycache__/*
  264. %{python3_sitelib}/qubes/tests/vm/__init__.py
  265. %{python3_sitelib}/qubes/tests/vm/init.py
  266. %{python3_sitelib}/qubes/tests/vm/adminvm.py
  267. %{python3_sitelib}/qubes/tests/vm/appvm.py
  268. %{python3_sitelib}/qubes/tests/vm/dispvm.py
  269. %{python3_sitelib}/qubes/tests/vm/qubesvm.py
  270. %dir %{python3_sitelib}/qubes/tests/vm/mix
  271. %dir %{python3_sitelib}/qubes/tests/vm/mix/__pycache__
  272. %{python3_sitelib}/qubes/tests/vm/mix/__pycache__/*
  273. %{python3_sitelib}/qubes/tests/vm/mix/__init__.py
  274. %{python3_sitelib}/qubes/tests/vm/mix/net.py
  275. %dir %{python3_sitelib}/qubes/tests/tools
  276. %dir %{python3_sitelib}/qubes/tests/tools/__pycache__
  277. %{python3_sitelib}/qubes/tests/tools/__pycache__/*
  278. %{python3_sitelib}/qubes/tests/tools/__init__.py
  279. %dir %{python3_sitelib}/qubes/tests/integ
  280. %dir %{python3_sitelib}/qubes/tests/integ/__pycache__
  281. %{python3_sitelib}/qubes/tests/integ/__pycache__/*
  282. %{python3_sitelib}/qubes/tests/integ/__init__.py
  283. %{python3_sitelib}/qubes/tests/integ/backup.py
  284. %{python3_sitelib}/qubes/tests/integ/backupcompatibility.py
  285. %{python3_sitelib}/qubes/tests/integ/basic.py
  286. %{python3_sitelib}/qubes/tests/integ/devices_block.py
  287. %{python3_sitelib}/qubes/tests/integ/devices_pci.py
  288. %{python3_sitelib}/qubes/tests/integ/dispvm.py
  289. %{python3_sitelib}/qubes/tests/integ/dom0_update.py
  290. %{python3_sitelib}/qubes/tests/integ/mime.py
  291. %{python3_sitelib}/qubes/tests/integ/network.py
  292. %{python3_sitelib}/qubes/tests/integ/grub.py
  293. %{python3_sitelib}/qubes/tests/integ/salt.py
  294. %{python3_sitelib}/qubes/tests/integ/storage.py
  295. %{python3_sitelib}/qubes/tests/integ/vm_qrexec_gui.py
  296. %dir %{python3_sitelib}/qubes/tests/integ/tools
  297. %dir %{python3_sitelib}/qubes/tests/integ/tools/__pycache__
  298. %{python3_sitelib}/qubes/tests/integ/tools/__pycache__/*
  299. %{python3_sitelib}/qubes/tests/integ/tools/__init__.py
  300. %{python3_sitelib}/qubes/tests/integ/tools/qubes_create.py
  301. %dir %{python3_sitelib}/qubes/qmemman
  302. %dir %{python3_sitelib}/qubes/qmemman/__pycache__
  303. %{python3_sitelib}/qubes/qmemman/__pycache__/*
  304. %{python3_sitelib}/qubes/qmemman/__init__.py
  305. %{python3_sitelib}/qubes/qmemman/algo.py
  306. %{python3_sitelib}/qubes/qmemman/client.py
  307. %dir %{python3_sitelib}/qubespolicy
  308. %dir %{python3_sitelib}/qubespolicy/__pycache__
  309. %{python3_sitelib}/qubespolicy/__pycache__/*
  310. %{python3_sitelib}/qubespolicy/__init__.py
  311. %{python3_sitelib}/qubespolicy/cli.py
  312. %{python3_sitelib}/qubespolicy/agent.py
  313. %{python3_sitelib}/qubespolicy/gtkhelpers.py
  314. %{python3_sitelib}/qubespolicy/policycreateconfirmation.py
  315. %{python3_sitelib}/qubespolicy/rpcconfirmation.py
  316. %{python3_sitelib}/qubespolicy/utils.py
  317. %{python3_sitelib}/qubespolicy/graph.py
  318. %dir %{python3_sitelib}/qubespolicy/tests
  319. %dir %{python3_sitelib}/qubespolicy/tests/__pycache__
  320. %{python3_sitelib}/qubespolicy/tests/__pycache__/*
  321. %{python3_sitelib}/qubespolicy/tests/__init__.py
  322. %{python3_sitelib}/qubespolicy/tests/cli.py
  323. %{python3_sitelib}/qubespolicy/tests/gtkhelpers.py
  324. %{python3_sitelib}/qubespolicy/tests/rpcconfirmation.py
  325. %dir %{python3_sitelib}/qubespolicy/glade
  326. %{python3_sitelib}/qubespolicy/glade/PolicyCreateConfirmationWindow.glade
  327. %{python3_sitelib}/qubespolicy/glade/RPCConfirmationWindow.glade
  328. /usr/lib/qubes/cleanup-dispvms
  329. /usr/lib/qubes/fix-dir-perms.sh
  330. /usr/lib/qubes/startup-misc.sh
  331. /usr/libexec/qubes/qubesd-query-fast
  332. %{_unitdir}/lvm2-pvscan@.service.d/30_qubes.conf
  333. %{_unitdir}/qubes-core.service
  334. %{_unitdir}/qubes-qmemman.service
  335. %{_unitdir}/qubes-vm@.service
  336. %{_unitdir}/qubesd.service
  337. %attr(2770,root,qubes) %dir /var/lib/qubes
  338. %attr(2770,root,qubes) %dir /var/lib/qubes/vm-templates
  339. %attr(2770,root,qubes) %dir /var/lib/qubes/appvms
  340. %attr(2770,root,qubes) %dir /var/lib/qubes/servicevms
  341. %attr(2770,root,qubes) %dir /var/lib/qubes/backup
  342. %attr(2770,root,qubes) %dir /var/lib/qubes/dvmdata
  343. %attr(2770,root,qubes) %dir /var/lib/qubes/vm-kernels
  344. /usr/share/qubes/templates/libvirt/xen.xml
  345. /usr/share/qubes/templates/libvirt/devices/block.xml
  346. /usr/share/qubes/templates/libvirt/devices/pci.xml
  347. /usr/share/qubes/templates/libvirt/devices/net.xml
  348. /usr/lib/tmpfiles.d/qubes.conf
  349. /etc/xen/scripts/block-snapshot
  350. /etc/xen/scripts/block-origin
  351. /etc/xen/scripts/vif-route-qubes
  352. %attr(2775,root,qubes) %dir /etc/qubes-rpc/policy
  353. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/admin.*
  354. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/include/admin-local-ro
  355. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/include/admin-local-rwx
  356. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/include/admin-global-ro
  357. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/include/admin-global-rwx
  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.StartApp
  367. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.VMShell
  368. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.VMRootShell
  369. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.UpdatesProxy
  370. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/qubes.GetDate
  371. %attr(0664,root,qubes) %config(noreplace) /etc/qubes-rpc/policy/policy.RegisterArgument
  372. /etc/qubes-rpc/admin.*
  373. /etc/qubes-rpc/qubes.FeaturesRequest
  374. /etc/qubes-rpc/qubes.GetDate
  375. /etc/qubes-rpc/qubes.GetRandomizedTime
  376. /etc/qubes-rpc/qubes.NotifyTools
  377. /etc/qubes-rpc/qubes.NotifyUpdates
  378. /etc/qubes-rpc/policy.RegisterArgument
  379. %attr(2770,root,qubes) %dir /var/log/qubes
  380. %attr(0770,root,qubes) %dir /var/run/qubes
  381. /etc/xdg/autostart/qrexec-policy-agent.desktop
  382. /usr/share/doc/qubes/relaxng/*.rng
  383. %changelog
  384. @CHANGELOG@