2019-10-21 00:57:19 +02:00
|
|
|
LIBDIR ?= /usr/lib
|
|
|
|
STATEDIR ?= /var/lib
|
|
|
|
SYSCONFDIR ?= /etc
|
|
|
|
PYTHON2_SITELIB = $(shell python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()')
|
2020-10-29 22:54:57 +01:00
|
|
|
PYTHON3_SITELIB = $(shell $(PYTHON) -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
|
|
|
|
ifeq ($(shell rpm --eval %{centos_ver} 2>/dev/null),8)
|
|
|
|
PLATEFORM_PYTHON3_SITELIB = $(shell /usr/libexec/platform-python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())')
|
|
|
|
endif
|
2019-10-21 00:57:19 +02:00
|
|
|
APTCONFDIR = $(SYSCONFDIR)/apt
|
|
|
|
YUMCONFDIR = $(SYSCONFDIR)/yum.conf.d
|
|
|
|
QUBESLIBDIR = $(LIBDIR)/qubes
|
|
|
|
QUBESSTATEDIR = $(STATEDIR)/qubes
|
|
|
|
|
2021-01-25 21:48:51 +01:00
|
|
|
ifneq (,$(wildcard /etc/fedora-release))
|
|
|
|
DIST = fc$(shell rpm --eval %{fedora})
|
2021-05-18 18:46:12 +02:00
|
|
|
else ifneq (,$(wildcard /etc/centos-release))
|
|
|
|
ifeq (CentOSStream, $(shell lsb_release -is))
|
|
|
|
DIST = centos-stream
|
|
|
|
else
|
|
|
|
DIST = centos
|
|
|
|
endif
|
2021-01-25 21:48:51 +01:00
|
|
|
else ifneq (,$(wildcard /etc/os-release))
|
|
|
|
DIST = $(shell grep VERSION_CODENAME= /etc/os-release | cut -d'=' -f2)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (,$(DIST))
|
|
|
|
# On debian if previous attempt failed
|
|
|
|
# it means we are on sid
|
|
|
|
ifneq (,$(wildcard /etc/debian_version))
|
|
|
|
DIST = $(shell cut -d'/' -f1 /etc/debian_version)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
DIST ?= fc33
|
2019-10-21 00:57:19 +02:00
|
|
|
|
|
|
|
.PHONY: install install-apt install-dnf install-rpm install-yum
|
|
|
|
|
|
|
|
install:
|
|
|
|
install -d $(DESTDIR)$(QUBESLIBDIR)
|
|
|
|
install -t $(DESTDIR)$(QUBESLIBDIR) \
|
|
|
|
qubes-download-dom0-updates.sh \
|
|
|
|
upgrades-installed-check \
|
|
|
|
upgrades-status-notify
|
|
|
|
install -d -m 2775 $(DESTDIR)$(QUBESSTATEDIR)/dom0-updates
|
|
|
|
|
|
|
|
install-apt:
|
|
|
|
install -d $(DESTDIR)$(APTCONFDIR)/sources.list.d
|
2021-01-25 21:48:51 +01:00
|
|
|
sed "s/@DIST@/$(DIST)/" apt-qubes-r4.list.in \
|
2019-10-21 00:57:19 +02:00
|
|
|
> $(DESTDIR)$(APTCONFDIR)/sources.list.d/qubes-r4.list
|
|
|
|
install -D -m 0644 apt-qubes-archive-keyring.gpg \
|
|
|
|
$(DESTDIR)$(APTCONFDIR)/trusted.gpg.d/qubes-archive-keyring.gpg
|
|
|
|
install -D -m 0644 apt-conf-00notify-hook \
|
|
|
|
$(DESTDIR)$(APTCONFDIR)/apt.conf.d/00notify-hook
|
|
|
|
install -D -m 0644 apt-conf-70no-unattended \
|
|
|
|
$(DESTDIR)$(APTCONFDIR)/apt.conf.d/70no-unattended
|
2020-01-15 19:42:00 +01:00
|
|
|
install -D -m 0644 apt-conf-10no-cache \
|
|
|
|
$(DESTDIR)$(APTCONFDIR)/apt.conf.d/10no-cache
|
2019-10-21 00:57:19 +02:00
|
|
|
|
|
|
|
install-dnf: install-rpm
|
|
|
|
install -D -m 0644 dnf-qubes-hooks.py \
|
|
|
|
$(DESTDIR)$(PYTHON2_SITELIB)/dnf-plugins/qubes-hooks.py
|
2020-10-29 22:54:57 +01:00
|
|
|
ifeq ($(shell rpm --eval %{centos_ver} 2>/dev/null),8)
|
|
|
|
# we need to stick to related DNF python version
|
|
|
|
# which is given by platform-python
|
|
|
|
install -D -m 0644 dnf-qubes-hooks.py \
|
|
|
|
$(DESTDIR)$(PLATEFORM_PYTHON3_SITELIB)/dnf-plugins/qubes-hooks.py
|
|
|
|
else
|
2019-10-21 00:57:19 +02:00
|
|
|
install -D -m 0644 dnf-qubes-hooks.py \
|
|
|
|
$(DESTDIR)$(PYTHON3_SITELIB)/dnf-plugins/qubes-hooks.py
|
2020-10-29 22:54:57 +01:00
|
|
|
endif
|
2019-10-21 00:57:19 +02:00
|
|
|
install -D -m 0644 dnf-qubes-hooks.conf $(DESTDIR)$(SYSCONFDIR)/dnf/plugins/qubes-hooks.conf
|
|
|
|
|
|
|
|
install-yum: install-rpm
|
|
|
|
install -d $(DESTDIR)$(LIBDIR)/yum-plugins
|
|
|
|
install -D -m 0644 yum-qubes-hooks.py \
|
|
|
|
$(DESTDIR)$(LIBDIR)/yum-plugins/yum-qubes-hooks.py
|
|
|
|
install -D -m 0644 yum-qubes-hooks.conf \
|
|
|
|
$(DESTDIR)$(SYSCONFDIR)/yum/pluginconf.d/yum-qubes-hooks.conf
|
|
|
|
|
|
|
|
install-rpm:
|
|
|
|
install -d $(DESTDIR)$(SYSCONFDIR)/yum.repos.d
|
|
|
|
DIST='$(DIST)'; sed -e "s/@DIST@/$${DIST%%[0-9]*}/g" yum-qubes-r4.repo.in \
|
|
|
|
> $(DESTDIR)$(SYSCONFDIR)/yum.repos.d/qubes-r4.repo
|
|
|
|
install -d $(DESTDIR)$(SYSCONFDIR)/pki/rpm-gpg
|
|
|
|
install -t $(DESTDIR)$(SYSCONFDIR)/pki/rpm-gpg -m 0644 RPM-GPG-KEY-qubes*
|
|
|
|
install -d $(DESTDIR)$(YUMCONFDIR)
|
|
|
|
> $(DESTDIR)$(YUMCONFDIR)/qubes-proxy.conf
|