Makefile 11 KB

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