core-agent-linux/Makefile

236 lines
12 KiB
Makefile
Raw Normal View History

RPMS_DIR=rpm/
VERSION := $(shell cat version)
2013-04-17 01:44:28 +02:00
DIST ?= fc18
KDESERVICEDIR ?= /usr/share/kde4/services
SBINDIR ?= /usr/sbin
LIBDIR ?= /usr/lib
SYSLIBDIR ?= /lib
PYTHON = /usr/bin/python2
PYTHON_SITEARCH = `python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)'`
# This makefile uses some bash-isms, make uses /bin/sh by default.
SHELL = /bin/bash
help:
@echo "make rpms -- generate binary rpm packages"
@echo "make rpms-vm -- generate binary rpm packages for VM"
@echo "make update-repo-current -- copy newly generated rpms to qubes yum repo"
@echo "make update-repo-current-testing -- same, but to -current-testing repo"
@echo "make update-repo-unstable -- same, but to -testing repo"
2011-04-06 15:35:30 +02:00
@echo "make update-repo-installer -- copy dom0 rpms to installer repo"
@echo "make clean -- cleanup"
2013-04-17 01:44:28 +02:00
@echo "make install-vm -- install VM related files"
rpms: rpms-vm
rpms-vm:
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm.spec
2013-03-12 17:10:49 +01:00
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm-doc.spec
rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-vm-kernel-placeholder.spec
rpm --addsign \
$(RPMS_DIR)/x86_64/qubes-core-vm-*$(VERSION)*.rpm \
2013-03-12 17:10:49 +01:00
$(RPMS_DIR)/x86_64/qubes-core-vm-doc-*$(VERSION)*.rpm \
$(RPMS_DIR)/x86_64/qubes-core-vm-kernel-placeholder-*.rpm
rpms-dom0:
@true
clean:
make -C misc clean
2011-03-07 16:13:15 +01:00
make -C qrexec clean
2014-04-21 17:14:32 +02:00
make -C qubes-rpc clean
2013-04-17 01:44:28 +02:00
all:
make -C misc
make -C qrexec
make -C qubes-rpc
# Dropin Directory
DROPIN_DIR ?= "lib/systemd/system"
# Fedora Dropins
DROPINS := chronyd.service crond.service cups.service cups.path cups.socket ModemManager.service
DROPINS += NetworkManager.service NetworkManager-wait-online.service ntpd.service getty@tty.service
# Debian Dropins
ifeq ($(shell lsb_release -is), Debian)
# Don't have 'ntpd' in Debian
DROPINS := $(filter-out ntpd.service, $(DROPINS))
# 'crond.service' is named 'cron.service in Debian
DROPINS := $(strip $(patsubst crond.service, cron.service, $(DROPINS)))
# Wheezy Dropins
# Disable sysinit 'network-manager.service' since systemd 'NetworkManager.service' is already installed
DROPINS += $(strip $(if $(filter wheezy, $(shell lsb_release -cs)), network-manager.service,))
endif
install-systemd-dropins:
@for dropin in $(DROPINS); do \
install -d $(DESTDIR)/$(DROPIN_DIR)/$${dropin}.d ;\
install -m 0644 vm-systemd/$${dropin}.d/*.conf $(DESTDIR)/$(DROPIN_DIR)/$${dropin}.d/ ;\
done
install-systemd:
install -d $(DESTDIR)$(SYSLIBDIR)/systemd/system{,-preset} $(DESTDIR)$(LIBDIR)/qubes/init $(DESTDIR)$(SYSLIBDIR)/modules-load.d
install -m 0755 vm-systemd/*.sh $(DESTDIR)$(LIBDIR)/qubes/init/
install -m 0644 vm-systemd/qubes-*.service $(DESTDIR)$(SYSLIBDIR)/systemd/system/
install -m 0644 vm-systemd/qubes-*.timer $(DESTDIR)$(SYSLIBDIR)/systemd/system/
install -m 0644 vm-systemd/75-qubes-vm.preset $(DESTDIR)$(SYSLIBDIR)/systemd/system-preset/
install -m 0644 vm-systemd/qubes-core.conf $(DESTDIR)$(SYSLIBDIR)/modules-load.d/
install -m 0644 vm-systemd/qubes-misc.conf $(DESTDIR)$(SYSLIBDIR)/modules-load.d/
2013-04-17 01:44:28 +02:00
install-sysvinit:
install -d $(DESTDIR)/etc/init.d
install vm-init.d/qubes-core $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-core-appvm $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-core-netvm $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-firewall $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-netwatcher $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-qrexec-agent $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-updates-proxy $(DESTDIR)/etc/init.d/
install -D vm-init.d/qubes-core.modules $(DESTDIR)/etc/sysconfig/modules/qubes-core.modules
install -D vm-init.d/qubes-misc.modules $(DESTDIR)/etc/sysconfig/modules/qubes-misc.modules
install-rh: install-systemd install-systemd-dropins install-sysvinit
2014-11-20 16:52:55 +01:00
install -D -m 0644 misc/qubes-r3.repo $(DESTDIR)/etc/yum.repos.d/qubes-r3.repo
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/usr/share/glib-2.0/schemas/
install -m 0644 misc/org.gnome.settings-daemon.plugins.updates.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
install -m 0644 misc/org.gnome.nautilus.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
install -m 0644 misc/org.mate.NotificationDaemon.gschema.override $(DESTDIR)/usr/share/glib-2.0/schemas/
install -d $(DESTDIR)$(LIBDIR)/yum-plugins/
install -m 0644 misc/yum-qubes-hooks.py* $(DESTDIR)$(LIBDIR)/yum-plugins/
2013-04-17 01:44:28 +02:00
install -D -m 0644 misc/yum-qubes-hooks.conf $(DESTDIR)/etc/yum/pluginconf.d/yum-qubes-hooks.conf
install -d -m 755 $(DESTDIR)/etc/pki/rpm-gpg
install -m 644 misc/RPM-GPG-KEY-qubes* $(DESTDIR)/etc/pki/rpm-gpg/
install -D -m 644 misc/session-stop-timeout.conf $(DESTDIR)$(LIBDIR)/systemd/system/user@.service.d/90-session-stop-timeout.conf
install -d $(DESTDIR)/etc/yum.conf.d
touch $(DESTDIR)/etc/yum.conf.d/qubes-proxy.conf
install -D -m 0644 misc/qubes-trigger-sync-appmenus.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-sync-appmenus.action
qubes-desktop-file-install: Manages xdg desktop entry files qubes-desktop-file-install is called by qubes-triggers-desktop-file-install. It's arguments are based on the Gnome desktop-install-file utility to allow it to be replaced by same. Currently the Gnome utility can not be used since it automatically validates the .desktop entry files with no option to skip validation and will fail on some third party .desktop files that are not formed properly. A single trigger script is shared between Fedora, Debian. This script is used by the package managers triggers and will copy original .desktop files from `/etc/xdg/autostart` to `/usr/share/qubes/xdg/autostart` and modify the OnlyShownIn / NotShownIn, etc. The original .desktop files are left untouched and left in place. Qubes modifies the XDG_CONFIG_DIRS to first include the `/usr/share/qubes/xdg` directory (XDG_CONFIG_DIRS=/usr/share/qubes/xdg:/etc/xdg). If a package gets removed, it's desktop entry is also removed from the /usr/share/qubes/xdg directory. 'qubes-desktop-file-install' options: --dir DIR Install desktop files to the DIR directory (default: <FILE>) --force Force overwrite of existing desktop files (default: False) --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) --remove-key KEY Remove the KEY key from the desktop files, if present --set-key (KEY VALUE) Set the KEY key to VALUE --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed
2015-08-02 23:30:26 +02:00
install -D -m 0644 misc/qubes-trigger-desktop-file-install.action $(DESTDIR)/etc/yum/post-actions/qubes-trigger-desktop-file-install.action
install -D -m 0644 misc/serial.conf $(DESTDIR)/usr/share/qubes/serial.conf
install -D misc/qubes-serial-login $(DESTDIR)/$(SBINDIR)/qubes-serial-login
2013-04-17 01:44:28 +02:00
install -m 0400 -D network/iptables $(DESTDIR)/usr/lib/qubes/init/iptables
install -m 0400 -D network/ip6tables $(DESTDIR)/usr/lib/qubes/init/ip6tables
install-common:
install -m 0644 -D misc/fstab $(DESTDIR)/etc/fstab
install -D -m 0440 misc/qubes.sudoers $(DESTDIR)/etc/sudoers.d/qubes
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/var/lib/qubes
install -D misc/xenstore-watch $(DESTDIR)/usr/bin/xenstore-watch-qubes
install -d $(DESTDIR)/etc/udev/rules.d
install -m 0644 misc/udev-qubes-misc.rules $(DESTDIR)/etc/udev/rules.d/50-qubes-misc.rules
install -d $(DESTDIR)$(LIBDIR)/qubes/
install misc/vusb-ctl.py $(DESTDIR)$(LIBDIR)/qubes/
install misc/qubes-trigger-sync-appmenus.sh $(DESTDIR)$(LIBDIR)/qubes/
2013-04-17 01:44:28 +02:00
install -D misc/polkit-1-qubes-allow-all.pkla $(DESTDIR)/etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
install -D misc/polkit-1-qubes-allow-all.rules $(DESTDIR)/etc/polkit-1/rules.d/00-qubes-allow-all.rules
install -D -m 0644 misc/mime-globs $(DESTDIR)/usr/share/qubes/mime-override/globs
install misc/qubes-download-dom0-updates.sh $(DESTDIR)$(LIBDIR)/qubes/
install -g user -m 2775 -d $(DESTDIR)/var/lib/qubes/dom0-updates
2013-04-17 01:44:28 +02:00
if [ -r misc/dispvm-dotfiles.$(DIST).tbz ] ; \
then \
install misc/dispvm-dotfiles.$(DIST).tbz $(DESTDIR)/etc/dispvm-dotfiles.tbz ; \
else \
install misc/dispvm-dotfiles.tbz $(DESTDIR)/etc/dispvm-dotfiles.tbz ; \
fi;
install misc/dispvm-prerun.sh $(DESTDIR)$(LIBDIR)/qubes/dispvm-prerun.sh
install misc/close-window $(DESTDIR)$(LIBDIR)/qubes/close-window
2013-04-17 01:44:28 +02:00
install -m 0644 network/udev-qubes-network.rules $(DESTDIR)/etc/udev/rules.d/99-qubes-network.rules
install network/qubes-setup-dnat-to-ns $(DESTDIR)$(LIBDIR)/qubes
install network/qubes-fix-nm-conf.sh $(DESTDIR)$(LIBDIR)/qubes
install network/setup-ip $(DESTDIR)$(LIBDIR)/qubes/
install network/network-manager-prepare-conf-dir $(DESTDIR)$(LIBDIR)/qubes/
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/etc/dhclient.d
ln -s /usr/lib/qubes/qubes-setup-dnat-to-ns $(DESTDIR)/etc/dhclient.d/qubes-setup-dnat-to-ns.sh
install -d $(DESTDIR)/etc/NetworkManager/dispatcher.d/
install network/{qubes-nmhook,30-qubes-external-ip} $(DESTDIR)/etc/NetworkManager/dispatcher.d/
install -D network/vif-route-qubes $(DESTDIR)/etc/xen/scripts/vif-route-qubes
install -m 0644 -D network/tinyproxy-updates.conf $(DESTDIR)/etc/tinyproxy/tinyproxy-updates.conf
install -m 0644 -D network/filter-updates $(DESTDIR)/etc/tinyproxy/filter-updates
install -m 0755 -D network/iptables-updates-proxy $(DESTDIR)$(LIBDIR)/qubes/iptables-updates-proxy
install -d $(DESTDIR)/etc/xdg/autostart
install -m 0755 network/show-hide-nm-applet.sh $(DESTDIR)$(LIBDIR)/qubes/show-hide-nm-applet.sh
install -m 0644 network/show-hide-nm-applet.desktop $(DESTDIR)/etc/xdg/autostart/00-qubes-show-hide-nm-applet.desktop
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/$(SBINDIR)
install network/qubes-firewall $(DESTDIR)/$(SBINDIR)/
install network/qubes-netwatcher $(DESTDIR)/$(SBINDIR)/
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/usr/bin
qubes-desktop-file-install: Manages xdg desktop entry files qubes-desktop-file-install is called by qubes-triggers-desktop-file-install. It's arguments are based on the Gnome desktop-install-file utility to allow it to be replaced by same. Currently the Gnome utility can not be used since it automatically validates the .desktop entry files with no option to skip validation and will fail on some third party .desktop files that are not formed properly. A single trigger script is shared between Fedora, Debian. This script is used by the package managers triggers and will copy original .desktop files from `/etc/xdg/autostart` to `/usr/share/qubes/xdg/autostart` and modify the OnlyShownIn / NotShownIn, etc. The original .desktop files are left untouched and left in place. Qubes modifies the XDG_CONFIG_DIRS to first include the `/usr/share/qubes/xdg` directory (XDG_CONFIG_DIRS=/usr/share/qubes/xdg:/etc/xdg). If a package gets removed, it's desktop entry is also removed from the /usr/share/qubes/xdg directory. 'qubes-desktop-file-install' options: --dir DIR Install desktop files to the DIR directory (default: <FILE>) --force Force overwrite of existing desktop files (default: False) --remove-show-in Remove the "OnlyShowIn" and "NotShowIn" entries from the desktop file (default: False) --remove-key KEY Remove the KEY key from the desktop files, if present --set-key (KEY VALUE) Set the KEY key to VALUE --remove-only-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-only-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-not-show-in ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --add-not-show-in ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed
2015-08-02 23:30:26 +02:00
install -m 0755 misc/qubes-desktop-file-install $(DESTDIR)/usr/bin/qubes-desktop-file-install
install -m 0755 misc/qubes-trigger-desktop-file-install $(DESTDIR)$(LIBDIR)/qubes/qubes-trigger-desktop-file-install
2013-04-17 01:44:28 +02:00
2014-03-24 05:19:16 +01:00
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
install qubes-rpc/wrap-in-html-if-url.sh $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/qvm-copy-to-vm.kde $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/qvm-copy-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/qvm-move-to-vm.kde $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/qvm-move-to-vm.gnome $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/{vm-file-editor,qfile-agent,qopen-in-vm} $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/tar2qfile $(DESTDIR)$(LIBDIR)/qubes
2013-04-17 01:44:28 +02:00
# Install qfile-unpacker as SUID - because it will fail to receive files from other vm
install -m 4755 qubes-rpc/qfile-unpacker $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/qrun-in-vm $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/sync-ntp-clock $(DESTDIR)$(LIBDIR)/qubes
install qubes-rpc/prepare-suspend $(DESTDIR)$(LIBDIR)/qubes
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/$(KDESERVICEDIR)
2014-03-24 05:19:16 +01:00
install -m 0644 qubes-rpc/{qvm-copy.desktop,qvm-move.desktop,qvm-dvm.desktop} $(DESTDIR)/$(KDESERVICEDIR)
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/etc/qubes-rpc
install -m 0644 qubes-rpc/{qubes.Filecopy,qubes.OpenInVM,qubes.VMShell,qubes.SyncNtpClock} $(DESTDIR)/etc/qubes-rpc
install -m 0644 qubes-rpc/{qubes.SuspendPre,qubes.SuspendPost,qubes.GetAppmenus} $(DESTDIR)/etc/qubes-rpc
install -m 0644 qubes-rpc/qubes.WaitForSession $(DESTDIR)/etc/qubes-rpc
install -m 0644 qubes-rpc/qubes.DetachPciDevice $(DESTDIR)/etc/qubes-rpc
install -m 0644 qubes-rpc/qubes.{Backup,Restore} $(DESTDIR)/etc/qubes-rpc
install -m 0644 qubes-rpc/qubes.Select{File,Directory} $(DESTDIR)/etc/qubes-rpc
2014-01-30 16:30:17 +01:00
install -m 0644 qubes-rpc/qubes.GetImageRGBA $(DESTDIR)/etc/qubes-rpc
install -m 0644 qubes-rpc/qubes.SetDateTime $(DESTDIR)/etc/qubes-rpc
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/usr/share/nautilus-python/extensions
install -m 0644 qubes-rpc/*_nautilus.py $(DESTDIR)/usr/share/nautilus-python/extensions
2013-04-17 01:44:28 +02:00
install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)/usr/bin/qubes-desktop-run
2013-04-17 01:44:28 +02:00
mkdir -p $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
ifeq (1,${DEBIANBUILD})
install -m 0644 misc/xdg.py $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
else
install -m 0644 misc/xdg.py* $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
endif
2013-04-17 01:44:28 +02:00
install -d $(DESTDIR)/mnt/removable
install -D -m 0644 misc/xorg-preload-apps.conf $(DESTDIR)/etc/X11/xorg-preload-apps.conf
install -d $(DESTDIR)/var/run/qubes
install -d $(DESTDIR)/home_volatile/user
install -d $(DESTDIR)/rw
install-deb: install-common install-systemd install-systemd-dropins
mkdir -p $(DESTDIR)/etc/apt/sources.list.d
sed -e "s/@DIST@/`lsb_release -cs`/" misc/qubes-r3.list.in > $(DESTDIR)/etc/apt/sources.list.d/qubes-r3.list
install -D -m 644 misc/qubes-archive-keyring.gpg $(DESTDIR)/etc/apt/trusted.gpg.d/qubes-archive-keyring.gpg
2014-09-26 18:55:42 +02:00
install -D -m 644 network/iptables $(DESTDIR)/etc/iptables/rules.v4
install -D -m 644 network/ip6tables $(DESTDIR)/etc/iptables/rules.v6
install -D -m 644 network/00notify-hook $(DESTDIR)/etc/apt/apt.conf.d/00notify-hook
2014-09-26 18:55:42 +02:00
install -d $(DESTDIR)/etc/sysctl.d
install -m 644 network/80-qubes.conf $(DESTDIR)/etc/sysctl.d/
install -D -m 644 misc/profile.d_qt_x11_no_mitshm.sh $(DESTDIR)/etc/profile.d/qt_x11_no_mitshm.sh
install -D -m 440 misc/sudoers.d_umask $(DESTDIR)/etc/sudoers.d/umask
install -D -m 440 misc/sudoers.d_qt_x11_no_mitshm $(DESTDIR)/etc/sudoers.d/qt_x11_no_mitshm
install-vm: install-rh install-common