Makefile 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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-rh:
  37. install -m 0644 -D misc/fstab $(DESTDIR)/etc/fstab
  38. install -d $(DESTDIR)/etc/init.d
  39. install vm-init.d/* $(DESTDIR)/etc/init.d/
  40. install -d $(DESTDIR)/lib/systemd/system $(DESTDIR)/usr/lib/qubes/init
  41. install -m 0755 vm-systemd/*.sh $(DESTDIR)/usr/lib/qubes/init/
  42. install -m 0644 vm-systemd/qubes-*.service $(DESTDIR)/lib/systemd/system/
  43. install -m 0644 vm-systemd/qubes-*.timer $(DESTDIR)/lib/systemd/system/
  44. install -m 0644 vm-systemd/ModemManager.service $(DESTDIR)/usr/lib/qubes/init/
  45. install -m 0644 vm-systemd/NetworkManager.service $(DESTDIR)/usr/lib/qubes/init/
  46. install -m 0644 vm-systemd/NetworkManager-wait-online.service $(DESTDIR)/usr/lib/qubes/init/
  47. install -m 0644 vm-systemd/cups.* $(DESTDIR)/usr/lib/qubes/init/
  48. install -m 0644 vm-systemd/ntpd.service $(DESTDIR)/usr/lib/qubes/init/
  49. install -m 0644 vm-systemd/chronyd.service $(DESTDIR)/usr/lib/qubes/init/
  50. install -D -m 0644 misc/qubes-r2.repo $(DESTDIR)/etc/yum.repos.d/qubes-r2.repo
  51. install -d $(DESTDIR)/usr/share/glib-2.0/schemas/
  52. install -m 0644 misc/org.gnome.settings-daemon.plugins.updates.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
  53. install -m 0644 misc/org.gnome.nautilus.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
  54. install -d $(DESTDIR)/usr/lib/yum-plugins/
  55. install -m 0644 misc/yum-qubes-hooks.py* $(DESTDIR)/usr/lib/yum-plugins/
  56. install -D -m 0644 misc/yum-qubes-hooks.conf $(DESTDIR)/etc/yum/pluginconf.d/yum-qubes-hooks.conf
  57. install -d -m 755 $(DESTDIR)/etc/pki/rpm-gpg
  58. install -m 644 misc/RPM-GPG-KEY-qubes* $(DESTDIR)/etc/pki/rpm-gpg/
  59. install -D -m 644 misc/session-stop-timeout.conf $(DESTDIR)/usr/lib/systemd/system/user@.service.d/90-session-stop-timeout.conf
  60. install -D misc/qubes-core.modules $(DESTDIR)/etc/sysconfig/modules/qubes-core.modules
  61. install -D misc/qubes-misc.modules $(DESTDIR)/etc/sysconfig/modules/qubes-misc.modules
  62. install -d $(DESTDIR)/etc/yum.conf.d
  63. touch $(DESTDIR)/etc/yum.conf.d/qubes-proxy.conf
  64. install-common:
  65. install -D -m 0440 misc/qubes.sudoers $(DESTDIR)/etc/sudoers.d/qubes
  66. install -D -m 0644 misc/serial.conf $(DESTDIR)/usr/share/qubes/serial.conf
  67. install -D misc/qubes-serial-login $(DESTDIR)/$(SBINDIR)/qubes-serial-login
  68. install -d $(DESTDIR)/var/lib/qubes
  69. install -D misc/xenstore-watch $(DESTDIR)/usr/bin/xenstore-watch-qubes
  70. install -d $(DESTDIR)/etc/udev/rules.d
  71. install -m 0644 misc/udev-qubes-misc.rules $(DESTDIR)/etc/udev/rules.d/50-qubes-misc.rules
  72. install -d $(DESTDIR)/usr/lib/qubes/
  73. install misc/qubes-download-dom0-updates.sh $(DESTDIR)/usr/lib/qubes/
  74. install misc/vusb-ctl.py $(DESTDIR)/usr/lib/qubes/
  75. install misc/qubes-trigger-sync-appmenus.sh $(DESTDIR)/usr/lib/qubes/
  76. install -D -m 0644 misc/qubes-trigger-sync-appmenus.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-sync-appmenus.action
  77. install -D misc/polkit-1-qubes-allow-all.pkla $(DESTDIR)/etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
  78. install -D misc/polkit-1-qubes-allow-all.rules $(DESTDIR)/etc/polkit-1/rules.d/00-qubes-allow-all.rules
  79. install -D -m 0644 misc/mime-globs $(DESTDIR)/usr/share/qubes/mime-override/globs
  80. mkdir -p $(DESTDIR)/usr/lib/qubes
  81. if [ -r misc/dispvm-dotfiles.$(DIST).tbz ] ; \
  82. then \
  83. install misc/dispvm-dotfiles.$(DIST).tbz $(DESTDIR)/etc/dispvm-dotfiles.tbz ; \
  84. else \
  85. install misc/dispvm-dotfiles.tbz $(DESTDIR)/etc/dispvm-dotfiles.tbz ; \
  86. fi;
  87. install misc/dispvm-prerun.sh $(DESTDIR)/usr/lib/qubes/dispvm-prerun.sh
  88. install misc/close-window $(DESTDIR)/usr/lib/qubes/close-window
  89. install -m 0644 network/udev-qubes-network.rules $(DESTDIR)/etc/udev/rules.d/99-qubes-network.rules
  90. install network/qubes-setup-dnat-to-ns $(DESTDIR)/usr/lib/qubes
  91. install network/qubes-fix-nm-conf.sh $(DESTDIR)/usr/lib/qubes
  92. install network/setup-ip $(DESTDIR)/usr/lib/qubes/
  93. install network/network-manager-prepare-conf-dir $(DESTDIR)/usr/lib/qubes/
  94. install -d $(DESTDIR)/etc/dhclient.d
  95. ln -s /usr/lib/qubes/qubes-setup-dnat-to-ns $(DESTDIR)/etc/dhclient.d/qubes-setup-dnat-to-ns.sh
  96. install -d $(DESTDIR)/etc/NetworkManager/dispatcher.d/
  97. install network/{qubes-nmhook,30-qubes-external-ip} $(DESTDIR)/etc/NetworkManager/dispatcher.d/
  98. install -D network/vif-route-qubes $(DESTDIR)/etc/xen/scripts/vif-route-qubes
  99. install -m 0400 -D network/iptables $(DESTDIR)/etc/sysconfig/iptables
  100. install -m 0400 -D network/ip6tables $(DESTDIR)/etc/sysconfig/ip6tables
  101. install -m 0644 -D network/tinyproxy-updates.conf $(DESTDIR)/etc/tinyproxy/tinyproxy-updates.conf
  102. install -m 0644 -D network/filter-updates $(DESTDIR)/etc/tinyproxy/filter-updates
  103. install -m 0755 -D network/iptables-updates-proxy $(DESTDIR)/usr/lib/qubes/iptables-updates-proxy
  104. install -d $(DESTDIR)/etc/xdg/autostart
  105. install -m 0755 network/show-hide-nm-applet.sh $(DESTDIR)/usr/lib/qubes/show-hide-nm-applet.sh
  106. install -m 0644 network/show-hide-nm-applet.desktop $(DESTDIR)/etc/xdg/autostart/00-qubes-show-hide-nm-applet.desktop
  107. install -d $(DESTDIR)/$(SBINDIR)
  108. install network/qubes-firewall $(DESTDIR)/$(SBINDIR)/
  109. install network/qubes-netwatcher $(DESTDIR)/$(SBINDIR)/
  110. install -d $(DESTDIR)/usr/bin
  111. 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
  112. install qubes-rpc/wrap-in-html-if-url.sh $(DESTDIR)/usr/lib/qubes
  113. install qubes-rpc/qvm-copy-to-vm.kde $(DESTDIR)/usr/lib/qubes
  114. install qubes-rpc/qvm-copy-to-vm.gnome $(DESTDIR)/usr/lib/qubes
  115. install qubes-rpc/qvm-move-to-vm.kde $(DESTDIR)/usr/lib/qubes
  116. install qubes-rpc/qvm-move-to-vm.gnome $(DESTDIR)/usr/lib/qubes
  117. install qubes-rpc/{vm-file-editor,qfile-agent,qopen-in-vm} $(DESTDIR)/usr/lib/qubes
  118. install qubes-rpc/tar2qfile $(DESTDIR)/usr/lib/qubes
  119. # Install qfile-unpacker as SUID - because it will fail to receive files from other vm
  120. install -m 4755 qubes-rpc/qfile-unpacker $(DESTDIR)/usr/lib/qubes
  121. install qubes-rpc/qrun-in-vm $(DESTDIR)/usr/lib/qubes
  122. install qubes-rpc/sync-ntp-clock $(DESTDIR)/usr/lib/qubes
  123. install qubes-rpc/prepare-suspend $(DESTDIR)/usr/lib/qubes
  124. install -d $(DESTDIR)/$(KDESERVICEDIR)
  125. install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-move.desktop,qvm-dvm.desktop} $(DESTDIR)/$(KDESERVICEDIR)
  126. install -d $(DESTDIR)/etc/qubes-rpc
  127. install -m 0644 qubes-rpc/{qubes.Filecopy,qubes.OpenInVM,qubes.VMShell,qubes.SyncNtpClock} $(DESTDIR)/etc/qubes-rpc
  128. install -m 0644 qubes-rpc/{qubes.SuspendPre,qubes.SuspendPost,qubes.GetAppmenus} $(DESTDIR)/etc/qubes-rpc
  129. install -m 0644 qubes-rpc/qubes.WaitForSession $(DESTDIR)/etc/qubes-rpc
  130. install -m 0644 qubes-rpc/qubes.DetachPciDevice $(DESTDIR)/etc/qubes-rpc
  131. install -m 0644 qubes-rpc/qubes.{Backup,Restore} $(DESTDIR)/etc/qubes-rpc
  132. install -m 0644 qubes-rpc/qubes.Select{File,Directory} $(DESTDIR)/etc/qubes-rpc
  133. install -m 0644 qubes-rpc/qubes.GetImageRGBA $(DESTDIR)/etc/qubes-rpc
  134. install -d $(DESTDIR)/usr/share/file-manager/actions
  135. install -m 0644 qubes-rpc/*-gnome.desktop $(DESTDIR)/usr/share/file-manager/actions
  136. install -D misc/nautilus-actions.conf $(DESTDIR)/etc/xdg/nautilus-actions/nautilus-actions.conf
  137. install -d $(DESTDIR)/mnt/removable
  138. install -d $(DESTDIR)/var/lib/qubes/dom0-updates
  139. install -D -m 0644 misc/xorg-preload-apps.conf $(DESTDIR)/etc/X11/xorg-preload-apps.conf
  140. install -d $(DESTDIR)/var/run/qubes
  141. install -d $(DESTDIR)/home_volatile/user
  142. install-deb:
  143. mkdir -p $(DESTDIR)/etc/apt/sources.list.d
  144. 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
  145. install -D -m 644 misc/qubes-archive-keyring.gpg $(DESTDIR)/etc/apt/trusted.gpg.d/qubes-archive-keyring.gpg
  146. install-vm: install-rh install-common