forked from nrgaway/qubes-core-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (53 loc) · 2.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ifneq ($(OS),Windows_NT)
default: help
NAME := libvirt
SPECFILE := libvirt.spec libvirt-python.spec
include Makefile.common
.PHONY: verify-sources get-sources clean-sources clean
mrproper: clean
-rm -fr rpm/* srpm/*
else
# Windows build start here
# This script uses three variables that contain Windows environment paths:
# MINGW_DIR should contain path to mingw environment (normally in chroot, prepared in Makefile.windows)
# PYTHON_DIR should contain python install path in chroot
# WIN_PATH is the search path used for configure/make, it should contain msys/mingw binaries and python directory
VERSION := $(shell cat version)
URL := https://libvirt.org/sources/$(mainturl)libvirt-$(VERSION).tar.xz
ifndef SRC_FILE
ifdef URL
SRC_FILE := $(notdir $(URL))
endif
endif
get-sources: $(SRC_FILE)
$(SRC_FILE):
ifneq ($(SRC_FILE), None)
@wget -q $(URL)
@wget -q $(addsuffix .asc,$(URL))
endif
.PHONY: import-keys
import-keys:
@if [ -n "$$GNUPGHOME" ]; then rm -f "$$GNUPGHOME/core-libvirt-trustedkeys.gpg"; fi
@gpg --no-auto-check-trustdb --no-default-keyring --keyring core-libvirt-trustedkeys.gpg -q --import *-key.asc
.PHONY: verify-sources
verify-sources: import-keys
ifneq ($(SRC_FILE), None)
@for f in $(SRC_FILE); do \
gpgv --keyring core-libvirt-trustedkeys.gpg $$f.asc $$f 2>/dev/null || \
{ echo "Wrong signature on $$f!"; exit 1; }; \
done
endif
# TODO: compile libvirt-python, apply patches.python
all:
tar xf $(SRC_FILE)
cd libvirt-$(VERSION) && ../apply-patches ../series-qubes.conf ../patches.qubes
if test -r libvirt-external-driver.patch; then \
patch -d libvirt-$(VERSION) -p1 < libvirt-external-driver.patch; fi
cd libvirt-$(VERSION) && autoreconf
# exported variables below should be initialized by the script that prepares windows build environment
export PATH='$(WIN_PATH)'; export MINGW_DIR='$(MINGW_DIR)'; export PYTHON_DIR='$(PYTHON_DIR)'; cd libvirt-$(VERSION) && ../win-run-configure
export PATH='$(WIN_PATH)'; cd libvirt-$(VERSION) && make -j$(NUMBER_OF_PROCESSORS)
msi:
candle -arch x64 -dversion=$(VERSION) installer.wxs
light -b libvirt-$(VERSION) -o core-libvirt.msm installer.wixobj
endif