Makefile 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. RPMS_DIR=rpm/
  2. VERSION := $(shell cat version)
  3. DIST ?= fc18
  4. KDESERVICEDIR ?= /usr/share/kde4/services
  5. KDE5SERVICEDIR ?= /usr/share/kservices5/ServiceMenus/
  6. APPLICATIONSDIR ?= /usr/share/applications
  7. SBINDIR ?= /usr/sbin
  8. BINDIR ?= /usr/bin
  9. LIBDIR ?= /usr/lib
  10. SYSLIBDIR ?= /lib
  11. PYTHON ?= /usr/bin/python2
  12. PYTHON_SITEARCH = $(shell python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)')
  13. PYTHON2_SITELIB = $(shell python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()')
  14. PYTHON3_SITELIB = $(shell python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
  15. # This makefile uses some bash-isms, make uses /bin/sh by default.
  16. SHELL = /bin/bash
  17. help:
  18. @echo "make rpms -- generate binary rpm packages"
  19. @echo "make rpms-vm -- generate binary rpm packages for VM"
  20. @echo "make clean -- cleanup"
  21. @echo "make install-vm -- install VM related files"
  22. @echo ""
  23. @echo "You must have lsb_release, rpm-sign and pandoc installed."
  24. rpms: rpms-vm
  25. rpms-vm:
  26. [ "$$BACKEND_VMM" != "" ] || { echo "error: you must define variable BACKEND_VMM" >&2 ; exit 1 ; }
  27. lsb_release >/dev/null 2>&1 || { echo "error: you need lsb_release (package lsb) installed" >&2 ; exit 1 ; }
  28. type pandoc >/dev/null 2>&1 || { echo "error: you need pandoc installed" >&2 ; exit 1 ; }
  29. type rpmsign >/dev/null 2>&1 || { echo "error: you need rpm-sign installed" >&2 ; exit 1 ; }
  30. rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm.spec
  31. rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm-doc.spec
  32. [ "$$SKIP_SIGNING" != "" ] || rpm --addsign \
  33. $(RPMS_DIR)/x86_64/qubes-core-vm-*$(VERSION)*.rpm \
  34. $(RPMS_DIR)/x86_64/qubes-core-vm-doc-*$(VERSION)*.rpm
  35. rpms-dom0:
  36. @true
  37. clean:
  38. make -C misc clean
  39. make -C qrexec clean
  40. make -C qubes-rpc clean
  41. make -C doc clean
  42. rm -rf qubesagent/*.pyc qubesagent/__pycache__
  43. rm -rf test-packages/__pycache__
  44. rm -rf test-packages/qubesagent.egg-info
  45. rm -rf __pycache__
  46. rm -f .coverage
  47. all:
  48. make -C misc
  49. make -C qrexec
  50. make -C qubes-rpc
  51. # Dropin Directory
  52. SYSTEM_DROPIN_DIR ?= "lib/systemd/system"
  53. USER_DROPIN_DIR ?= "usr/lib/systemd/user"
  54. SYSTEM_DROPINS := chronyd.service crond.service
  55. SYSTEM_DROPINS += cups.service cups-browsed.service cups.path cups.socket ModemManager.service
  56. SYSTEM_DROPINS += getty@tty.service
  57. SYSTEM_DROPINS += tmp.mount
  58. SYSTEM_DROPINS += org.cups.cupsd.service org.cups.cupsd.path org.cups.cupsd.socket
  59. SYSTEM_DROPINS += systemd-random-seed.service
  60. SYSTEM_DROPINS += tor.service tor@default.service
  61. SYSTEM_DROPINS += systemd-timesyncd.service
  62. SYSTEM_DROPINS_NETWORKING := NetworkManager.service NetworkManager-wait-online.service
  63. SYSTEM_DROPINS_NETWORKING += tinyproxy.service
  64. USER_DROPINS := pulseaudio.service pulseaudio.socket
  65. # Ubuntu Dropins
  66. ifeq ($(shell lsb_release -is), Ubuntu)
  67. # 'crond.service' is named 'cron.service in Debian
  68. SYSTEM_DROPINS := $(strip $(patsubst crond.service, cron.service, $(SYSTEM_DROPINS)))
  69. SYSTEM_DROPINS += anacron.service
  70. SYSTEM_DROPINS += anacron-resume.service
  71. SYSTEM_DROPINS += netfilter-persistent.service
  72. SYSTEM_DROPINS += exim4.service
  73. SYSTEM_DROPINS += avahi-daemon.service
  74. endif
  75. # Debian Dropins
  76. ifeq ($(shell lsb_release -is), Debian)
  77. # 'crond.service' is named 'cron.service in Debian
  78. SYSTEM_DROPINS := $(strip $(patsubst crond.service, cron.service, $(SYSTEM_DROPINS)))
  79. # Wheezy System Dropins
  80. # Disable sysinit 'network-manager.service' since systemd 'NetworkManager.service' is already installed
  81. SYSTEM_DROPINS += $(strip $(if $(filter wheezy, $(shell lsb_release -cs)), network-manager.service,))
  82. # handled by qubes-iptables service now
  83. SYSTEM_DROPINS += netfilter-persistent.service
  84. SYSTEM_DROPINS += anacron.service
  85. SYSTEM_DROPINS += anacron-resume.service
  86. SYSTEM_DROPINS += exim4.service
  87. SYSTEM_DROPINS += avahi-daemon.service
  88. endif
  89. install-systemd-dropins:
  90. # Install system dropins
  91. @for dropin in $(SYSTEM_DROPINS); do \
  92. install -d $(DESTDIR)/$(SYSTEM_DROPIN_DIR)/$${dropin}.d ;\
  93. install -m 0644 vm-systemd/$${dropin}.d/*.conf $(DESTDIR)/$(SYSTEM_DROPIN_DIR)/$${dropin}.d/ ;\
  94. done
  95. # Install user dropins
  96. @for dropin in $(USER_DROPINS); do \
  97. install -d $(DESTDIR)/$(USER_DROPIN_DIR)/$${dropin}.d ;\
  98. install -m 0644 vm-systemd/user/$${dropin}.d/*.conf $(DESTDIR)/$(USER_DROPIN_DIR)/$${dropin}.d/ ;\
  99. done
  100. install-systemd-networking-dropins:
  101. # Install system dropins
  102. @for dropin in $(SYSTEM_DROPINS_NETWORKING); do \
  103. install -d $(DESTDIR)/$(SYSTEM_DROPIN_DIR)/$${dropin}.d ;\
  104. install -m 0644 vm-systemd/$${dropin}.d/*.conf $(DESTDIR)/$(SYSTEM_DROPIN_DIR)/$${dropin}.d/ ;\
  105. done
  106. install-init:
  107. install -d $(DESTDIR)$(LIBDIR)/qubes/init
  108. # FIXME: do a source code move vm-systemd/*.sh to init/
  109. # since those scripts are shared between sysvinit and systemd.
  110. install -m 0755 init/*.sh vm-systemd/*.sh $(DESTDIR)$(LIBDIR)/qubes/init/
  111. install -m 0644 init/functions $(DESTDIR)$(LIBDIR)/qubes/init/
  112. # Systemd service files
  113. SYSTEMD_ALL_SERVICES := $(wildcard vm-systemd/qubes-*.service)
  114. SYSTEMD_NETWORK_SERVICES := vm-systemd/qubes-firewall.service vm-systemd/qubes-iptables.service vm-systemd/qubes-updates-proxy.service
  115. SYSTEMD_CORE_SERVICES := $(filter-out $(SYSTEMD_NETWORK_SERVICES), $(SYSTEMD_ALL_SERVICES))
  116. install-systemd: install-init
  117. install -d $(DESTDIR)$(SYSLIBDIR)/systemd/system{,-preset} $(DESTDIR)$(LIBDIR)/qubes/init $(DESTDIR)$(SYSLIBDIR)/modules-load.d
  118. install -m 0644 $(SYSTEMD_CORE_SERVICES) $(DESTDIR)$(SYSLIBDIR)/systemd/system/
  119. install -m 0644 vm-systemd/qubes-*.timer $(DESTDIR)$(SYSLIBDIR)/systemd/system/
  120. install -m 0644 vm-systemd/75-qubes-vm.preset $(DESTDIR)$(SYSLIBDIR)/systemd/system-preset/
  121. install -m 0644 vm-systemd/qubes-core.conf $(DESTDIR)$(SYSLIBDIR)/modules-load.d/
  122. install-sysvinit: install-init
  123. install -d $(DESTDIR)/etc/init.d
  124. install vm-init.d/qubes-sysinit $(DESTDIR)/etc/init.d/
  125. install vm-init.d/qubes-core-early $(DESTDIR)/etc/init.d/
  126. install vm-init.d/qubes-core $(DESTDIR)/etc/init.d/
  127. install vm-init.d/qubes-core-netvm $(DESTDIR)/etc/init.d/
  128. install vm-init.d/qubes-firewall $(DESTDIR)/etc/init.d/
  129. install vm-init.d/qubes-qrexec-agent $(DESTDIR)/etc/init.d/
  130. install vm-init.d/qubes-updates-proxy $(DESTDIR)/etc/init.d/
  131. install vm-init.d/qubes-updates-proxy-forwarder $(DESTDIR)/etc/init.d/
  132. install -D vm-init.d/qubes-core.modules $(DESTDIR)/etc/sysconfig/modules/qubes-core.modules
  133. install network/qubes-iptables $(DESTDIR)/etc/init.d/
  134. install-rh: install-systemd install-systemd-dropins install-sysvinit
  135. install -D -m 0644 misc/qubes-r4.repo.in $(DESTDIR)/etc/yum.repos.d/qubes-r4.repo
  136. DIST='$(DIST)'; sed -i "s/@DIST@/$${DIST%%[0-9]*}/g" $(DESTDIR)/etc/yum.repos.d/qubes-r4.repo
  137. install -d $(DESTDIR)$(LIBDIR)/yum-plugins/
  138. install -m 0644 misc/yum-qubes-hooks.py* $(DESTDIR)$(LIBDIR)/yum-plugins/
  139. install -D -m 0644 misc/yum-qubes-hooks.conf $(DESTDIR)/etc/yum/pluginconf.d/yum-qubes-hooks.conf
  140. install -d -m 755 $(DESTDIR)/etc/pki/rpm-gpg
  141. install -m 644 misc/RPM-GPG-KEY-qubes* $(DESTDIR)/etc/pki/rpm-gpg/
  142. install -D -m 644 misc/session-stop-timeout.conf $(DESTDIR)$(LIBDIR)/systemd/system/user@.service.d/90-session-stop-timeout.conf
  143. install -d $(DESTDIR)/etc/yum.conf.d
  144. touch $(DESTDIR)/etc/yum.conf.d/qubes-proxy.conf
  145. install -D -m 0644 misc/grub.qubes $(DESTDIR)/etc/default/grub.qubes
  146. install -D -m 0644 misc/serial.conf $(DESTDIR)/usr/share/qubes/serial.conf
  147. install -D misc/qubes-serial-login $(DESTDIR)/$(SBINDIR)/qubes-serial-login
  148. install -D -m 0644 misc/dracut-qubes.conf \
  149. $(DESTDIR)/usr/lib/dracut/dracut.conf.d/30-qubes.conf
  150. install -D -m 0644 misc/dnf-qubes-hooks.py \
  151. $(DESTDIR)$(PYTHON2_SITELIB)/dnf-plugins/qubes-hooks.py
  152. install -D -m 0644 misc/dnf-qubes-hooks.py \
  153. $(DESTDIR)$(PYTHON3_SITELIB)/dnf-plugins/qubes-hooks.py
  154. install -D -m 0644 misc/dnf-qubes-hooks.conf $(DESTDIR)/etc/dnf/plugins/qubes-hooks.conf
  155. install-doc:
  156. $(MAKE) -C doc install
  157. install-common: install-doc
  158. $(MAKE) -C autostart-dropins install
  159. install -m 0644 -D misc/fstab $(DESTDIR)/etc/fstab
  160. # force /usr/bin before /bin to have /usr/bin/python instead of /bin/python
  161. PATH="/usr/bin:$(PATH)" $(PYTHON) setup.py install $(PYTHON_PREFIX_ARG) -O1 --root $(DESTDIR)
  162. mkdir -p $(DESTDIR)$(SBINDIR)
  163. install -d -m 0750 $(DESTDIR)/etc/sudoers.d/
  164. install -D -m 0440 misc/qubes.sudoers $(DESTDIR)/etc/sudoers.d/qubes
  165. install -D -m 0440 misc/sudoers.d_qt_x11_no_mitshm $(DESTDIR)/etc/sudoers.d/qt_x11_no_mitshm
  166. install -D -m 0644 misc/20_tcp_timestamps.conf $(DESTDIR)/etc/sysctl.d/20_tcp_timestamps.conf
  167. install -d $(DESTDIR)/var/lib/qubes
  168. install -D misc/xenstore-watch $(DESTDIR)$(BINDIR)/xenstore-watch-qubes
  169. install -d $(DESTDIR)/etc/udev/rules.d
  170. install -m 0644 misc/udev-qubes-misc.rules $(DESTDIR)/etc/udev/rules.d/50-qubes-misc.rules
  171. install -d $(DESTDIR)$(LIBDIR)/qubes/
  172. install misc/qubes-trigger-sync-appmenus.sh $(DESTDIR)$(LIBDIR)/qubes/
  173. install -d -m 0750 $(DESTDIR)/etc/polkit-1/rules.d
  174. install -D -m 0644 misc/polkit-1-qubes-allow-all.pkla $(DESTDIR)/etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
  175. install -D -m 0644 misc/polkit-1-qubes-allow-all.rules $(DESTDIR)/etc/polkit-1/rules.d/00-qubes-allow-all.rules
  176. install -D -m 0644 misc/mime-globs $(DESTDIR)/usr/share/qubes/mime-override/globs
  177. install misc/qubes-download-dom0-updates.sh $(DESTDIR)$(LIBDIR)/qubes/
  178. install -d $(DESTDIR)/usr/share/glib-2.0/schemas/
  179. install -m 0644 \
  180. misc/20_org.gnome.settings-daemon.plugins.updates.qubes.gschema.override \
  181. misc/20_org.gnome.nautilus.qubes.gschema.override \
  182. misc/20_org.mate.NotificationDaemon.qubes.gschema.override \
  183. misc/20_org.gnome.desktop.wm.preferences.qubes.gschema.override \
  184. $(DESTDIR)/usr/share/glib-2.0/schemas/
  185. install -m 2775 -d $(DESTDIR)/var/lib/qubes/dom0-updates
  186. install -D -m 0644 misc/qubes-master-key.asc $(DESTDIR)/usr/share/qubes/qubes-master-key.asc
  187. install misc/resize-rootfs $(DESTDIR)$(LIBDIR)/qubes/
  188. install misc/close-window $(DESTDIR)$(LIBDIR)/qubes/close-window
  189. install misc/upgrades-installed-check $(DESTDIR)$(LIBDIR)/qubes/upgrades-installed-check
  190. install misc/upgrades-status-notify $(DESTDIR)$(LIBDIR)/qubes/upgrades-status-notify
  191. install -m 0644 network/udev-qubes-network.rules $(DESTDIR)/etc/udev/rules.d/99-qubes-network.rules
  192. install -m 0755 network/update-proxy-configs $(DESTDIR)$(LIBDIR)/qubes/
  193. install -d $(DESTDIR)$(BINDIR)
  194. install -m 0755 misc/qubes-session-autostart $(DESTDIR)$(BINDIR)/qubes-session-autostart
  195. install -m 0755 misc/qvm-features-request $(DESTDIR)$(BINDIR)/qvm-features-request
  196. install -m 0755 misc/qubes-run-terminal $(DESTDIR)/$(BINDIR)
  197. install -D -m 0644 misc/qubes-run-terminal.desktop $(DESTDIR)/$(APPLICATIONSDIR)/qubes-run-terminal.desktop
  198. install -m 0755 qubes-rpc/qvm-sync-clock $(DESTDIR)$(BINDIR)/qvm-sync-clock
  199. install qubes-rpc/{qvm-open-in-dvm,qvm-open-in-vm,qvm-copy-to-vm,qvm-run-vm} $(DESTDIR)/usr/bin
  200. install qubes-rpc/qvm-copy $(DESTDIR)/usr/bin
  201. ln -s qvm-copy-to-vm $(DESTDIR)/usr/bin/qvm-move-to-vm
  202. ln -s qvm-copy $(DESTDIR)/usr/bin/qvm-move
  203. install qubes-rpc/qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes
  204. ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes/qvm-move-to-vm.gnome
  205. ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes/qvm-copy-to-vm.kde
  206. ln -s qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes/qvm-move-to-vm.kde
  207. install qubes-rpc/qvm-actions.sh $(DESTDIR)$(LIBDIR)/qubes
  208. install -m 0644 misc/uca_qubes.xml $(DESTDIR)$(LIBDIR)/qubes
  209. mkdir -p $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml
  210. install -m 0644 misc/thunar.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml
  211. install qubes-rpc/xdg-icon $(DESTDIR)$(LIBDIR)/qubes
  212. install qubes-rpc/{vm-file-editor,qfile-agent,qopen-in-vm} $(DESTDIR)$(LIBDIR)/qubes
  213. install qubes-rpc/qubes-open $(DESTDIR)$(BINDIR)
  214. install qubes-rpc/tar2qfile $(DESTDIR)$(LIBDIR)/qubes
  215. # Install qfile-unpacker as SUID - because it will fail to receive files from other vm
  216. install -m 4755 qubes-rpc/qfile-unpacker $(DESTDIR)$(LIBDIR)/qubes
  217. install qubes-rpc/qrun-in-vm $(DESTDIR)$(LIBDIR)/qubes
  218. install qubes-rpc/prepare-suspend $(DESTDIR)$(LIBDIR)/qubes
  219. install qubes-rpc/qubes-sync-clock $(DESTDIR)$(LIBDIR)/qubes
  220. install -m 0644 misc/qubes-suspend-module-blacklist $(DESTDIR)/etc/qubes-suspend-module-blacklist
  221. install -d $(DESTDIR)/$(KDESERVICEDIR)
  222. install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-move.desktop,qvm-dvm.desktop} $(DESTDIR)/$(KDESERVICEDIR)
  223. install -d $(DESTDIR)/$(KDE5SERVICEDIR)
  224. install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-move.desktop,qvm-dvm.desktop} $(DESTDIR)/$(KDE5SERVICEDIR)
  225. install -d $(DESTDIR)/etc/qubes-rpc
  226. install -m 0755 qubes-rpc/{qubes.Filecopy,qubes.OpenInVM,qubes.VMShell} $(DESTDIR)/etc/qubes-rpc
  227. install -m 0755 qubes-rpc/qubes.VMRootShell $(DESTDIR)/etc/qubes-rpc
  228. install -m 0755 qubes-rpc/qubes.OpenURL $(DESTDIR)/etc/qubes-rpc
  229. install -m 0755 qubes-rpc/{qubes.SuspendPre,qubes.SuspendPost,qubes.GetAppmenus} $(DESTDIR)/etc/qubes-rpc
  230. install -m 0755 qubes-rpc/qubes.SuspendPreAll $(DESTDIR)/etc/qubes-rpc
  231. install -m 0755 qubes-rpc/qubes.SuspendPostAll $(DESTDIR)/etc/qubes-rpc
  232. install -m 0755 qubes-rpc/qubes.WaitForSession $(DESTDIR)/etc/qubes-rpc
  233. install -m 0755 qubes-rpc/qubes.DetachPciDevice $(DESTDIR)/etc/qubes-rpc
  234. install -m 0755 qubes-rpc/qubes.{Backup,Restore} $(DESTDIR)/etc/qubes-rpc
  235. install -m 0755 qubes-rpc/qubes.Select{File,Directory} $(DESTDIR)/etc/qubes-rpc
  236. install -m 0755 qubes-rpc/qubes.GetImageRGBA $(DESTDIR)/etc/qubes-rpc
  237. install -m 0755 qubes-rpc/qubes.SetDateTime $(DESTDIR)/etc/qubes-rpc
  238. install -m 0755 qubes-rpc/qubes.InstallUpdatesGUI $(DESTDIR)/etc/qubes-rpc
  239. install -m 0755 qubes-rpc/qubes.ResizeDisk $(DESTDIR)/etc/qubes-rpc
  240. install -m 0755 qubes-rpc/qubes.StartApp $(DESTDIR)/etc/qubes-rpc
  241. install -m 0755 qubes-rpc/qubes.PostInstall $(DESTDIR)/etc/qubes-rpc
  242. install -m 0755 qubes-rpc/qubes.GetDate $(DESTDIR)/etc/qubes-rpc
  243. install -d $(DESTDIR)/etc/qubes/rpc-config
  244. install -m 0644 qubes-rpc/rpc-config.README $(DESTDIR)/etc/qubes/rpc-config/README
  245. for config in qubes-rpc/*.config; do \
  246. install -m 0644 $$config $(DESTDIR)/etc/qubes/rpc-config/`basename $$config .config`; \
  247. done
  248. install -d $(DESTDIR)/etc/qubes/suspend-pre.d
  249. install -m 0644 qubes-rpc/suspend-pre.README $(DESTDIR)/etc/qubes/suspend-pre.d/README
  250. install -d $(DESTDIR)/etc/qubes/suspend-post.d
  251. install -m 0644 qubes-rpc/suspend-post.README $(DESTDIR)/etc/qubes/suspend-post.d/README
  252. install -m 0755 qubes-rpc/suspend-post-qvm-sync-clock.sh \
  253. $(DESTDIR)/etc/qubes/suspend-post.d/qvm-sync-clock.sh
  254. install -d $(DESTDIR)/etc/qubes/post-install.d
  255. install -m 0644 post-install.d/README $(DESTDIR)/etc/qubes/post-install.d/
  256. install -m 0755 post-install.d/*.sh $(DESTDIR)/etc/qubes/post-install.d/
  257. install -d $(DESTDIR)/usr/share/nautilus-python/extensions
  258. install -m 0644 qubes-rpc/*_nautilus.py $(DESTDIR)/usr/share/nautilus-python/extensions
  259. install -D -m 0644 misc/dconf-db-local-dpi $(DESTDIR)/etc/dconf/db/local.d/dpi
  260. install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)$(BINDIR)/qubes-desktop-run
  261. install -d $(DESTDIR)/mnt/removable
  262. install -D -m 0644 misc/xorg-preload-apps.conf $(DESTDIR)/etc/X11/xorg-preload-apps.conf
  263. install -d $(DESTDIR)/usr/lib/qubes-bind-dirs.d
  264. install -D -m 0644 misc/30_cron.conf $(DESTDIR)/usr/lib/qubes-bind-dirs.d/30_cron.conf
  265. install -d $(DESTDIR)/var/run/qubes
  266. install -d $(DESTDIR)/rw
  267. # Networking install target includes:
  268. # * basic network functionality (setting IP address, DNS, default gateway)
  269. # * package update proxy client
  270. install-networking:
  271. install -d $(DESTDIR)$(SYSLIBDIR)/systemd/system
  272. install -m 0644 vm-systemd/qubes-*.socket $(DESTDIR)$(SYSLIBDIR)/systemd/system/
  273. install -d $(DESTDIR)$(LIBDIR)/qubes/
  274. install network/setup-ip $(DESTDIR)$(LIBDIR)/qubes/
  275. # Netvm install target includes:
  276. # * qubes-firewall service (FirewallVM)
  277. # * DNS redirection setup
  278. # * proxy service used by TemplateVMs to download updates
  279. install-netvm:
  280. install -D -m 0644 $(SYSTEMD_NETWORK_SERVICES) $(DESTDIR)$(SYSLIBDIR)/systemd/system/
  281. install -D -m 0755 network/qubes-iptables $(DESTDIR)$(LIBDIR)/qubes/init/qubes-iptables
  282. install -D -m 0644 vm-systemd/qubes-core-agent-linux.tmpfiles \
  283. $(DESTDIR)/usr/lib/tmpfiles.d/qubes-core-agent-linux.conf
  284. mkdir -p $(DESTDIR)$(SBINDIR)
  285. ifneq ($(SBINDIR),/usr/bin)
  286. mv $(DESTDIR)/usr/bin/qubes-firewall $(DESTDIR)$(SBINDIR)/qubes-firewall
  287. endif
  288. install -D network/qubes-setup-dnat-to-ns $(DESTDIR)$(LIBDIR)/qubes/qubes-setup-dnat-to-ns
  289. install -d $(DESTDIR)/etc/dhclient.d
  290. ln -s /usr/lib/qubes/qubes-setup-dnat-to-ns $(DESTDIR)/etc/dhclient.d/qubes-setup-dnat-to-ns.sh
  291. install -D network/vif-route-qubes $(DESTDIR)/etc/xen/scripts/vif-route-qubes
  292. install -D network/vif-qubes-nat.sh $(DESTDIR)/etc/xen/scripts/vif-qubes-nat.sh
  293. install -m 0644 -D network/tinyproxy-updates.conf $(DESTDIR)/etc/tinyproxy/tinyproxy-updates.conf
  294. install -m 0644 -D network/updates-blacklist $(DESTDIR)/etc/tinyproxy/updates-blacklist
  295. install -m 0755 -D network/iptables-updates-proxy $(DESTDIR)$(LIBDIR)/qubes/iptables-updates-proxy
  296. install -m 0400 -D network/iptables $(DESTDIR)/etc/qubes/iptables.rules
  297. install -m 0400 -D network/ip6tables $(DESTDIR)/etc/qubes/ip6tables.rules
  298. install -m 0400 -D network/ip6tables-enabled $(DESTDIR)/etc/qubes/ip6tables-enabled.rules
  299. install -m 0755 -D qubes-rpc/qubes.UpdatesProxy $(DESTDIR)/etc/qubes-rpc/qubes.UpdatesProxy
  300. # networkmanager install target allow integration of NetworkManager for Qubes VM:
  301. # * make connections config persistent
  302. # * adjust DNS redirections when needed
  303. # * show/hide NetworkManager applet icon
  304. install-networkmanager:
  305. install -d $(DESTDIR)$(LIBDIR)/qubes/
  306. install network/qubes-fix-nm-conf.sh $(DESTDIR)$(LIBDIR)/qubes/
  307. install network/network-manager-prepare-conf-dir $(DESTDIR)$(LIBDIR)/qubes/
  308. install -d $(DESTDIR)/etc/NetworkManager/dispatcher.d/
  309. install network/{qubes-nmhook,30-qubes-external-ip} $(DESTDIR)/etc/NetworkManager/dispatcher.d/
  310. install -d $(DESTDIR)/usr/lib/NetworkManager/conf.d
  311. install -m 0644 network/nm-30-qubes.conf $(DESTDIR)/usr/lib/NetworkManager/conf.d/30-qubes.conf
  312. install -d $(DESTDIR)/etc/xdg/autostart
  313. install -m 0755 network/show-hide-nm-applet.sh $(DESTDIR)$(LIBDIR)/qubes/
  314. install -m 0644 network/show-hide-nm-applet.desktop $(DESTDIR)/etc/xdg/autostart/00-qubes-show-hide-nm-applet.desktop
  315. install-deb: install-common install-systemd install-systemd-dropins install-systemd-networking-dropins install-networking install-networkmanager install-netvm
  316. mkdir -p $(DESTDIR)/etc/apt/sources.list.d
  317. sed -e "s/@DIST@/`lsb_release -cs`/" misc/qubes-r4.list.in > $(DESTDIR)/etc/apt/sources.list.d/qubes-r4.list
  318. install -D -m 644 misc/qubes-archive-keyring.gpg $(DESTDIR)/etc/apt/trusted.gpg.d/qubes-archive-keyring.gpg
  319. install -D -m 644 network/00notify-hook $(DESTDIR)/etc/apt/apt.conf.d/00notify-hook
  320. install -d $(DESTDIR)/etc/sysctl.d
  321. install -m 644 network/80-qubes.conf $(DESTDIR)/etc/sysctl.d/
  322. install -D -m 644 misc/profile.d_qt_x11_no_mitshm.sh $(DESTDIR)/etc/profile.d/qt_x11_no_mitshm.sh
  323. install -D -m 440 misc/sudoers.d_umask $(DESTDIR)/etc/sudoers.d/umask
  324. install -d $(DESTDIR)/etc/pam.d
  325. install -m 0644 misc/pam.d_su.qubes $(DESTDIR)/etc/pam.d/su.qubes
  326. install -d $(DESTDIR)/etc/needrestart/conf.d
  327. install -D -m 0644 misc/50_qubes.conf $(DESTDIR)/etc/needrestart/conf.d/50_qubes.conf
  328. install -D -m 0644 misc/grub.qubes $(DESTDIR)/etc/default/grub.d/30-qubes.cfg
  329. install -D -m 0644 misc/apt-conf-70no-unattended $(DESTDIR)/etc/apt/apt.conf.d/70no-unattended
  330. mkdir -p $(DESTDIR)/etc/systemd/system/
  331. install -m 0644 vm-systemd/haveged.service $(DESTDIR)/etc/systemd/system/
  332. install-corevm: install-rh install-common install-systemd install-sysvinit install-systemd-dropins install-networking
  333. install-netvm: install-systemd-networking-dropins install-networkmanager
  334. install-vm: install-corevm install-netvm