Makefile 9.8 KB

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