Makefile 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. RPMS_DIR=rpm/
  2. VERSION := $(shell cat version)
  3. DIST ?= fc18
  4. KDESERVICEDIR ?= /usr/share/kde4/services
  5. SBINDIR ?= /usr/sbin
  6. LIBDIR ?= /usr/lib
  7. SYSLIBDIR ?= /lib
  8. PYTHON = /usr/bin/python2
  9. PYTHON_SITEARCH = `python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)'`
  10. # This makefile uses some bash-isms, make uses /bin/sh by default.
  11. SHELL = /bin/bash
  12. help:
  13. @echo "make rpms -- generate binary rpm packages"
  14. @echo "make rpms-vm -- generate binary rpm packages for VM"
  15. @echo "make update-repo-current -- copy newly generated rpms to qubes yum repo"
  16. @echo "make update-repo-current-testing -- same, but to -current-testing repo"
  17. @echo "make update-repo-unstable -- same, but to -testing repo"
  18. @echo "make update-repo-installer -- copy dom0 rpms to installer repo"
  19. @echo "make clean -- cleanup"
  20. @echo "make install-vm -- install VM related files"
  21. rpms: rpms-vm
  22. rpms-vm:
  23. rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm.spec
  24. rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm-doc.spec
  25. rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm-kernel-placeholder.spec
  26. rpm --addsign \
  27. $(RPMS_DIR)/x86_64/qubes-core-vm-*$(VERSION)*.rpm \
  28. $(RPMS_DIR)/x86_64/qubes-core-vm-doc-*$(VERSION)*.rpm \
  29. $(RPMS_DIR)/x86_64/qubes-core-vm-kernel-placeholder-*.rpm
  30. rpms-dom0:
  31. @true
  32. clean:
  33. make -C misc clean
  34. make -C qrexec clean
  35. make -C qubes-rpc clean
  36. all:
  37. make -C misc
  38. make -C qrexec
  39. make -C qubes-rpc
  40. # Dropin Directory
  41. DROPIN_DIR ?= "lib/systemd/system"
  42. # Fedora Dropins
  43. DROPINS := chronyd.service crond.service cups.service cups.path cups.socket ModemManager.service
  44. DROPINS += NetworkManager.service NetworkManager-wait-online.service ntpd.service getty@tty.service
  45. DROPINS += tmp.mount
  46. # Debian Dropins
  47. ifeq ($(shell lsb_release -is), Debian)
  48. # Don't have 'ntpd' in Debian
  49. DROPINS := $(filter-out ntpd.service, $(DROPINS))
  50. # 'crond.service' is named 'cron.service in Debian
  51. DROPINS := $(strip $(patsubst crond.service, cron.service, $(DROPINS)))
  52. # Wheezy Dropins
  53. # Disable sysinit 'network-manager.service' since systemd 'NetworkManager.service' is already installed
  54. DROPINS += $(strip $(if $(filter wheezy, $(shell lsb_release -cs)), network-manager.service,))
  55. # handled by qubes-iptables service now
  56. DROPINS += netfilter-persistent.service
  57. endif
  58. install-systemd-dropins:
  59. @for dropin in $(DROPINS); do \
  60. install -d $(DESTDIR)/$(DROPIN_DIR)/$${dropin}.d ;\
  61. install -m 0644 vm-systemd/$${dropin}.d/*.conf $(DESTDIR)/$(DROPIN_DIR)/$${dropin}.d/ ;\
  62. done
  63. install-systemd:
  64. install -d $(DESTDIR)$(SYSLIBDIR)/systemd/system{,-preset} $(DESTDIR)$(LIBDIR)/qubes/init $(DESTDIR)$(SYSLIBDIR)/modules-load.d
  65. install -m 0755 vm-systemd/*.sh $(DESTDIR)$(LIBDIR)/qubes/init/
  66. install -m 0644 vm-systemd/qubes-*.service $(DESTDIR)$(SYSLIBDIR)/systemd/system/
  67. install -m 0644 vm-systemd/qubes-*.timer $(DESTDIR)$(SYSLIBDIR)/systemd/system/
  68. install -m 0644 vm-systemd/75-qubes-vm.preset $(DESTDIR)$(SYSLIBDIR)/systemd/system-preset/
  69. install -m 0644 vm-systemd/qubes-core.conf $(DESTDIR)$(SYSLIBDIR)/modules-load.d/
  70. install -m 0644 vm-systemd/qubes-misc.conf $(DESTDIR)$(SYSLIBDIR)/modules-load.d/
  71. install -m 0755 network/qubes-iptables $(DESTDIR)$(LIBDIR)/qubes/init/
  72. install-sysvinit:
  73. install -d $(DESTDIR)/etc/init.d
  74. install vm-init.d/qubes-core $(DESTDIR)/etc/init.d/
  75. install vm-init.d/qubes-core-appvm $(DESTDIR)/etc/init.d/
  76. install vm-init.d/qubes-core-netvm $(DESTDIR)/etc/init.d/
  77. install vm-init.d/qubes-firewall $(DESTDIR)/etc/init.d/
  78. install vm-init.d/qubes-netwatcher $(DESTDIR)/etc/init.d/
  79. install vm-init.d/qubes-qrexec-agent $(DESTDIR)/etc/init.d/
  80. install vm-init.d/qubes-updates-proxy $(DESTDIR)/etc/init.d/
  81. install -D vm-init.d/qubes-core.modules $(DESTDIR)/etc/sysconfig/modules/qubes-core.modules
  82. install -D vm-init.d/qubes-misc.modules $(DESTDIR)/etc/sysconfig/modules/qubes-misc.modules
  83. install network/qubes-iptables $(DESTDIR)/etc/init.d/
  84. install-rh: install-systemd install-systemd-dropins install-sysvinit
  85. install -D -m 0644 misc/qubes-r3.repo $(DESTDIR)/etc/yum.repos.d/qubes-r3.repo
  86. install -d $(DESTDIR)/usr/share/glib-2.0/schemas/
  87. install -m 0644 misc/org.gnome.settings-daemon.plugins.updates.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
  88. install -m 0644 misc/org.gnome.nautilus.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
  89. install -m 0644 misc/org.mate.NotificationDaemon.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
  90. install -d $(DESTDIR)$(LIBDIR)/yum-plugins/
  91. install -m 0644 misc/yum-qubes-hooks.py* $(DESTDIR)$(LIBDIR)/yum-plugins/
  92. install -D -m 0644 misc/yum-qubes-hooks.conf $(DESTDIR)/etc/yum/pluginconf.d/yum-qubes-hooks.conf
  93. install -d -m 755 $(DESTDIR)/etc/pki/rpm-gpg
  94. install -m 644 misc/RPM-GPG-KEY-qubes* $(DESTDIR)/etc/pki/rpm-gpg/
  95. install -D -m 644 misc/session-stop-timeout.conf $(DESTDIR)$(LIBDIR)/systemd/system/user@.service.d/90-session-stop-timeout.conf
  96. install -d $(DESTDIR)/etc/yum.conf.d
  97. touch $(DESTDIR)/etc/yum.conf.d/qubes-proxy.conf
  98. install -D -m 0644 misc/qubes-trigger-sync-appmenus.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-sync-appmenus.action
  99. install -D -m 0644 misc/serial.conf $(DESTDIR)/usr/share/qubes/serial.conf
  100. install -D misc/qubes-serial-login $(DESTDIR)/$(SBINDIR)/qubes-serial-login
  101. install-common:
  102. $(MAKE) -C autostart-dropins install
  103. install -m 0644 -D misc/fstab $(DESTDIR)/etc/fstab
  104. install -D -m 0440 misc/qubes.sudoers $(DESTDIR)/etc/sudoers.d/qubes
  105. install -D -m 0440 misc/sudoers.d_qt_x11_no_mitshm $(DESTDIR)/etc/sudoers.d/qt_x11_no_mitshm
  106. install -d $(DESTDIR)/var/lib/qubes
  107. install -D misc/xenstore-watch $(DESTDIR)/usr/bin/xenstore-watch-qubes
  108. install -d $(DESTDIR)/etc/udev/rules.d
  109. install -m 0644 misc/udev-qubes-misc.rules $(DESTDIR)/etc/udev/rules.d/50-qubes-misc.rules
  110. install -d $(DESTDIR)$(LIBDIR)/qubes/
  111. install misc/vusb-ctl.py $(DESTDIR)$(LIBDIR)/qubes/
  112. install misc/qubes-trigger-sync-appmenus.sh $(DESTDIR)$(LIBDIR)/qubes/
  113. install -D misc/polkit-1-qubes-allow-all.pkla $(DESTDIR)/etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
  114. install -D misc/polkit-1-qubes-allow-all.rules $(DESTDIR)/etc/polkit-1/rules.d/00-qubes-allow-all.rules
  115. install -D -m 0644 misc/mime-globs $(DESTDIR)/usr/share/qubes/mime-override/globs
  116. install misc/qubes-download-dom0-updates.sh $(DESTDIR)$(LIBDIR)/qubes/
  117. install -g user -m 2775 -d $(DESTDIR)/var/lib/qubes/dom0-updates
  118. if [ -r misc/dispvm-dotfiles.$(DIST).tbz ] ; \
  119. then \
  120. install misc/dispvm-dotfiles.$(DIST).tbz $(DESTDIR)/etc/dispvm-dotfiles.tbz ; \
  121. else \
  122. install misc/dispvm-dotfiles.tbz $(DESTDIR)/etc/dispvm-dotfiles.tbz ; \
  123. fi;
  124. install misc/dispvm-prerun.sh $(DESTDIR)$(LIBDIR)/qubes/dispvm-prerun.sh
  125. install misc/close-window $(DESTDIR)$(LIBDIR)/qubes/close-window
  126. install -m 0644 network/udev-qubes-network.rules $(DESTDIR)/etc/udev/rules.d/99-qubes-network.rules
  127. install network/qubes-setup-dnat-to-ns $(DESTDIR)$(LIBDIR)/qubes
  128. install network/setup-ip $(DESTDIR)$(LIBDIR)/qubes/
  129. install network/network-manager-prepare-conf-dir $(DESTDIR)$(LIBDIR)/qubes/
  130. install -d $(DESTDIR)/etc/dhclient.d
  131. ln -s /usr/lib/qubes/qubes-setup-dnat-to-ns $(DESTDIR)/etc/dhclient.d/qubes-setup-dnat-to-ns.sh
  132. install -d $(DESTDIR)/etc/NetworkManager/dispatcher.d/
  133. install network/{qubes-nmhook,30-qubes-external-ip} $(DESTDIR)/etc/NetworkManager/dispatcher.d/
  134. install -m 0644 -D network/NetworkManager-qubes.conf \
  135. $(DESTDIR)/etc/NetworkManager/conf.d/30-qubes.conf
  136. install -D network/vif-route-qubes $(DESTDIR)/etc/xen/scripts/vif-route-qubes
  137. install -m 0644 -D network/tinyproxy-updates.conf $(DESTDIR)/etc/tinyproxy/tinyproxy-updates.conf
  138. install -m 0644 -D network/filter-updates $(DESTDIR)/etc/tinyproxy/filter-updates
  139. install -m 0755 -D network/iptables-updates-proxy $(DESTDIR)$(LIBDIR)/qubes/iptables-updates-proxy
  140. install -d $(DESTDIR)/etc/xdg/autostart
  141. install -m 0755 network/show-hide-nm-applet.sh $(DESTDIR)$(LIBDIR)/qubes/show-hide-nm-applet.sh
  142. install -m 0644 network/show-hide-nm-applet.desktop $(DESTDIR)/etc/xdg/autostart/00-qubes-show-hide-nm-applet.desktop
  143. install -m 0400 -D network/iptables $(DESTDIR)/etc/qubes/iptables.rules
  144. install -m 0400 -D network/ip6tables $(DESTDIR)/etc/qubes/ip6tables.rules
  145. install -d $(DESTDIR)/$(SBINDIR)
  146. install network/qubes-firewall $(DESTDIR)/$(SBINDIR)/
  147. install network/qubes-netwatcher $(DESTDIR)/$(SBINDIR)/
  148. install -d $(DESTDIR)/usr/bin
  149. install -m 0755 misc/qubes-session-autostart $(DESTDIR)/usr/bin/qubes-session-autostart
  150. install qubes-rpc/{qvm-open-in-dvm,qvm-open-in-vm,qvm-copy-to-vm,qvm-move-to-vm,qvm-run,qvm-mru-entry} $(DESTDIR)/usr/bin
  151. install qubes-rpc/wrap-in-html-if-url.sh $(DESTDIR)$(LIBDIR)/qubes
  152. install qubes-rpc/qvm-copy-to-vm.kde $(DESTDIR)$(LIBDIR)/qubes
  153. install qubes-rpc/qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes
  154. install qubes-rpc/qvm-move-to-vm.kde $(DESTDIR)$(LIBDIR)/qubes
  155. install qubes-rpc/qvm-move-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes
  156. install qubes-rpc/xdg-icon $(DESTDIR)$(LIBDIR)/qubes
  157. install qubes-rpc/{vm-file-editor,qfile-agent,qopen-in-vm} $(DESTDIR)$(LIBDIR)/qubes
  158. install qubes-rpc/tar2qfile $(DESTDIR)$(LIBDIR)/qubes
  159. # Install qfile-unpacker as SUID - because it will fail to receive files from other vm
  160. install -m 4755 qubes-rpc/qfile-unpacker $(DESTDIR)$(LIBDIR)/qubes
  161. install qubes-rpc/qrun-in-vm $(DESTDIR)$(LIBDIR)/qubes
  162. install qubes-rpc/sync-ntp-clock $(DESTDIR)$(LIBDIR)/qubes
  163. install qubes-rpc/prepare-suspend $(DESTDIR)$(LIBDIR)/qubes
  164. install -d $(DESTDIR)/$(KDESERVICEDIR)
  165. install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-move.desktop,qvm-dvm.desktop} $(DESTDIR)/$(KDESERVICEDIR)
  166. install -d $(DESTDIR)/etc/qubes-rpc
  167. install -m 0644 qubes-rpc/{qubes.Filecopy,qubes.OpenInVM,qubes.VMShell,qubes.SyncNtpClock} $(DESTDIR)/etc/qubes-rpc
  168. install -m 0644 qubes-rpc/{qubes.SuspendPre,qubes.SuspendPost,qubes.GetAppmenus} $(DESTDIR)/etc/qubes-rpc
  169. install -m 0644 qubes-rpc/qubes.WaitForSession $(DESTDIR)/etc/qubes-rpc
  170. install -m 0644 qubes-rpc/qubes.DetachPciDevice $(DESTDIR)/etc/qubes-rpc
  171. install -m 0644 qubes-rpc/qubes.{Backup,Restore} $(DESTDIR)/etc/qubes-rpc
  172. install -m 0644 qubes-rpc/qubes.Select{File,Directory} $(DESTDIR)/etc/qubes-rpc
  173. install -m 0644 qubes-rpc/qubes.GetImageRGBA $(DESTDIR)/etc/qubes-rpc
  174. install -m 0644 qubes-rpc/qubes.SetDateTime $(DESTDIR)/etc/qubes-rpc
  175. install -d $(DESTDIR)/usr/share/nautilus-python/extensions
  176. install -m 0644 qubes-rpc/*_nautilus.py $(DESTDIR)/usr/share/nautilus-python/extensions
  177. install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)/usr/bin/qubes-desktop-run
  178. mkdir -p $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
  179. ifeq ($(shell lsb_release -is), Debian)
  180. install -m 0644 misc/xdg.py $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
  181. else
  182. install -m 0644 misc/xdg.py* $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
  183. endif
  184. install -d $(DESTDIR)/mnt/removable
  185. install -D -m 0644 misc/xorg-preload-apps.conf $(DESTDIR)/etc/X11/xorg-preload-apps.conf
  186. install -d $(DESTDIR)/var/run/qubes
  187. install -d $(DESTDIR)/home_volatile/user
  188. install -d $(DESTDIR)/rw
  189. install-deb: install-common install-systemd install-systemd-dropins
  190. mkdir -p $(DESTDIR)/etc/apt/sources.list.d
  191. sed -e "s/@DIST@/`lsb_release -cs`/" misc/qubes-r3.list.in > $(DESTDIR)/etc/apt/sources.list.d/qubes-r3.list
  192. install -D -m 644 misc/qubes-archive-keyring.gpg $(DESTDIR)/etc/apt/trusted.gpg.d/qubes-archive-keyring.gpg
  193. install -D -m 644 network/00notify-hook $(DESTDIR)/etc/apt/apt.conf.d/00notify-hook
  194. install -d $(DESTDIR)/etc/sysctl.d
  195. install -m 644 network/80-qubes.conf $(DESTDIR)/etc/sysctl.d/
  196. install -D -m 644 misc/profile.d_qt_x11_no_mitshm.sh $(DESTDIR)/etc/profile.d/qt_x11_no_mitshm.sh
  197. install -D -m 440 misc/sudoers.d_umask $(DESTDIR)/etc/sudoers.d/umask
  198. install -d $(DESTDIR)/etc/pam.d
  199. install -m 0644 misc/pam.d_su.qubes $(DESTDIR)/etc/pam.d/su.qubes
  200. install-vm: install-rh install-common