Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. LIBDIR ?= /usr/lib
  2. STATEDIR ?= /var/lib
  3. SYSCONFDIR ?= /etc
  4. PYTHON2_SITELIB = $(shell python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()')
  5. PYTHON3_SITELIB = $(shell $(PYTHON) -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
  6. ifeq ($(shell rpm --eval %{centos_ver} 2>/dev/null),8)
  7. PLATEFORM_PYTHON3_SITELIB = $(shell /usr/libexec/platform-python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
  8. endif
  9. APTCONFDIR = $(SYSCONFDIR)/apt
  10. YUMCONFDIR = $(SYSCONFDIR)/yum.conf.d
  11. QUBESLIBDIR = $(LIBDIR)/qubes
  12. QUBESSTATEDIR = $(STATEDIR)/qubes
  13. ifneq (,$(wildcard /etc/fedora-release))
  14. DIST = fc$(shell rpm --eval %{fedora})
  15. else ifneq (,$(wildcard /etc/os-release))
  16. DIST = $(shell grep VERSION_CODENAME= /etc/os-release | cut -d'=' -f2)
  17. endif
  18. ifeq (,$(DIST))
  19. # On debian if previous attempt failed
  20. # it means we are on sid
  21. ifneq (,$(wildcard /etc/debian_version))
  22. DIST = $(shell cut -d'/' -f1 /etc/debian_version)
  23. endif
  24. endif
  25. DIST ?= fc33
  26. .PHONY: install install-apt install-dnf install-rpm install-yum
  27. install:
  28. install -d $(DESTDIR)$(QUBESLIBDIR)
  29. install -t $(DESTDIR)$(QUBESLIBDIR) \
  30. qubes-download-dom0-updates.sh \
  31. upgrades-installed-check \
  32. upgrades-status-notify
  33. install -d -m 2775 $(DESTDIR)$(QUBESSTATEDIR)/dom0-updates
  34. install-apt:
  35. install -d $(DESTDIR)$(APTCONFDIR)/sources.list.d
  36. sed "s/@DIST@/$(DIST)/" apt-qubes-r4.list.in \
  37. > $(DESTDIR)$(APTCONFDIR)/sources.list.d/qubes-r4.list
  38. install -D -m 0644 apt-qubes-archive-keyring.gpg \
  39. $(DESTDIR)$(APTCONFDIR)/trusted.gpg.d/qubes-archive-keyring.gpg
  40. install -D -m 0644 apt-conf-00notify-hook \
  41. $(DESTDIR)$(APTCONFDIR)/apt.conf.d/00notify-hook
  42. install -D -m 0644 apt-conf-70no-unattended \
  43. $(DESTDIR)$(APTCONFDIR)/apt.conf.d/70no-unattended
  44. install -D -m 0644 apt-conf-10no-cache \
  45. $(DESTDIR)$(APTCONFDIR)/apt.conf.d/10no-cache
  46. install-dnf: install-rpm
  47. install -D -m 0644 dnf-qubes-hooks.py \
  48. $(DESTDIR)$(PYTHON2_SITELIB)/dnf-plugins/qubes-hooks.py
  49. ifeq ($(shell rpm --eval %{centos_ver} 2>/dev/null),8)
  50. # we need to stick to related DNF python version
  51. # which is given by platform-python
  52. install -D -m 0644 dnf-qubes-hooks.py \
  53. $(DESTDIR)$(PLATEFORM_PYTHON3_SITELIB)/dnf-plugins/qubes-hooks.py
  54. else
  55. install -D -m 0644 dnf-qubes-hooks.py \
  56. $(DESTDIR)$(PYTHON3_SITELIB)/dnf-plugins/qubes-hooks.py
  57. endif
  58. install -D -m 0644 dnf-qubes-hooks.conf $(DESTDIR)$(SYSCONFDIR)/dnf/plugins/qubes-hooks.conf
  59. install-yum: install-rpm
  60. install -d $(DESTDIR)$(LIBDIR)/yum-plugins
  61. install -D -m 0644 yum-qubes-hooks.py \
  62. $(DESTDIR)$(LIBDIR)/yum-plugins/yum-qubes-hooks.py
  63. install -D -m 0644 yum-qubes-hooks.conf \
  64. $(DESTDIR)$(SYSCONFDIR)/yum/pluginconf.d/yum-qubes-hooks.conf
  65. install-rpm:
  66. install -d $(DESTDIR)$(SYSCONFDIR)/yum.repos.d
  67. DIST='$(DIST)'; sed -e "s/@DIST@/$${DIST%%[0-9]*}/g" yum-qubes-r4.repo.in \
  68. > $(DESTDIR)$(SYSCONFDIR)/yum.repos.d/qubes-r4.repo
  69. install -d $(DESTDIR)$(SYSCONFDIR)/pki/rpm-gpg
  70. install -t $(DESTDIR)$(SYSCONFDIR)/pki/rpm-gpg -m 0644 RPM-GPG-KEY-qubes*
  71. install -d $(DESTDIR)$(YUMCONFDIR)
  72. > $(DESTDIR)$(YUMCONFDIR)/qubes-proxy.conf