core-dom0.spec 15 KB

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