]>
Commit | Line | Data |
---|---|---|
95259824 WB |
1 | #!/usr/bin/make -f |
2 | # -*- makefile -*- | |
95259824 WB |
3 | |
4 | # Uncomment this to turn on verbose mode. | |
5 | #export DH_VERBOSE=1 | |
6 | ||
d80ca49d | 7 | include /usr/share/dpkg/default.mk |
95259824 | 8 | |
d80ca49d | 9 | HOST_CPU ?= $(DEB_HOST_GNU_CPU) |
a544966d | 10 | |
95259824 WB |
11 | PACKAGE=pve-qemu-kvm |
12 | destdir := $(CURDIR)/debian/$(PACKAGE) | |
13 | ||
376d9ce8 | 14 | flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64 |
6503e6e0 | 15 | machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64.json |
376d9ce8 | 16 | |
817b7667 SR |
17 | # default QEMU out-of-tree build directory is ./build |
18 | BUILDDIR=build | |
19 | ||
95259824 WB |
20 | CFLAGS = -Wall |
21 | ||
ade9f501 FE |
22 | # FIXME: There is a second -02 added because of meson.build in the subproject |
23 | # and that is appended after -O0 from here (last -O wins), so supporting noopt | |
24 | # doesn't work like this. | |
95259824 WB |
25 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
26 | CFLAGS += -O0 | |
27 | else | |
28 | CFLAGS += -O2 | |
29 | endif | |
30 | ||
0fde60fd FE |
31 | export CFLAGS |
32 | ||
023b9163 FE |
33 | # DEB_BUILD_OPTIONS=parallel=N |
34 | MAKEFLAGS += $(subst parallel=,-j,$(filter parallel=%,${DEB_BUILD_OPTIONS})) | |
35 | ||
817b7667 | 36 | ${BUILDDIR}/config.status: configure |
95259824 WB |
37 | dh_testdir |
38 | # Add here commands to configure the package. | |
a21f5778 | 39 | |
c913853b FE |
40 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" |
41 | cp -f /usr/share/misc/config.sub config.sub | |
42 | endif | |
43 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" | |
44 | cp -f /usr/share/misc/config.guess config.guess | |
45 | endif | |
46 | ||
a21f5778 | 47 | # guest-agent is only required for guest systems |
964a487a | 48 | ./configure \ |
04e0262e TL |
49 | --with-git-submodules=ignore \ |
50 | --docdir=/usr/share/doc/pve-qemu-kvm \ | |
51 | --localstatedir=/var \ | |
52 | --prefix=/usr \ | |
53 | --sysconfdir=/etc \ | |
54 | --target-list=$(HOST_CPU)-softmmu,aarch64-softmmu \ | |
55 | --with-suffix="kvm" \ | |
56 | --with-pkgversion="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM_REVISION}" \ | |
57 | --audio-drv-list="alsa" \ | |
58 | --datadir=/usr/share \ | |
59 | --libexecdir=/usr/lib/kvm \ | |
60 | --disable-capstone \ | |
61 | --disable-gtk \ | |
62 | --disable-guest-agent \ | |
63 | --disable-guest-agent-msi \ | |
64 | --disable-libnfs \ | |
65 | --disable-libssh \ | |
66 | --disable-sdl \ | |
67 | --disable-smartcard \ | |
68 | --disable-strip \ | |
69 | --disable-xen \ | |
70 | --enable-curl \ | |
71 | --enable-docs \ | |
72 | --enable-glusterfs \ | |
73 | --enable-gnutls \ | |
74 | --enable-libiscsi \ | |
75 | --enable-libusb \ | |
76 | --enable-linux-aio \ | |
77 | --enable-linux-io-uring \ | |
78 | --enable-numa \ | |
79 | --enable-opengl \ | |
80 | --enable-rbd \ | |
81 | --enable-seccomp \ | |
82 | --enable-slirp \ | |
83 | --enable-spice \ | |
84 | --enable-usb-redir \ | |
85 | --enable-virglrenderer \ | |
86 | --enable-virtfs \ | |
87 | --enable-zstd | |
95259824 | 88 | |
2e416ad9 TL |
89 | build: build-arch build-indep |
90 | build-arch: build-stamp | |
91 | build-indep: build-stamp | |
8e326f30 | 92 | build: build-stamp |
95259824 | 93 | |
817b7667 | 94 | build-stamp: ${BUILDDIR}/config.status |
95259824 WB |
95 | dh_testdir |
96 | ||
97 | # Add here commands to compile the package. | |
98 | $(MAKE) | |
99 | ||
100 | #docbook-to-man debian/kvm.sgml > kvm.1 | |
101 | ||
102 | touch $@ | |
103 | ||
8e326f30 | 104 | clean: |
95259824 WB |
105 | dh_testdir |
106 | dh_testroot | |
107 | rm -f build-stamp | |
108 | ||
6eb3e319 | 109 | # Add here commands to clean up before the build process. |
95259824 | 110 | -$(MAKE) distclean |
95259824 WB |
111 | |
112 | dh_clean | |
113 | ||
114 | install: build | |
115 | dh_testdir | |
116 | dh_testroot | |
68ba098a | 117 | dh_prep |
95259824 | 118 | dh_installdirs |
7df330a9 | 119 | dh_lintian |
95259824 WB |
120 | |
121 | # Add here commands to install the package into debian/pve-kvm. | |
122 | $(MAKE) DESTDIR=$(destdir) install | |
123 | ||
95259824 WB |
124 | # Remove things we don't package at all, would be a "kvm-dev" package |
125 | rm -Rf $(destdir)/usr/include/linux/ | |
126 | rm -Rf $(destdir)/usr/include | |
44813695 TL |
127 | rm -f $(destdir)/usr/lib/kvm/qemu-bridge-helper |
128 | rm -f $(destdir)/usr/lib/kvm/virtfs-proxy-helper | |
95259824 | 129 | |
376d9ce8 TL |
130 | # CPU flags are static for QEMU version, allows avoiding more costly checks |
131 | $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile) | |
a6ede898 | 132 | $(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machinefile) |
376d9ce8 | 133 | |
95259824 WB |
134 | # Build architecture-independent files here. |
135 | binary-indep: build install | |
136 | # We have nothing to do by default. | |
137 | ||
138 | # Build architecture-dependent files here. | |
139 | binary-arch: build install | |
140 | dh_testdir | |
141 | dh_testroot | |
2c2626dd EK |
142 | # exclude historic Changelog file, which stops at release 0.14 |
143 | dh_installchangelogs --exclude=Changelog | |
95259824 WB |
144 | dh_installdocs |
145 | dh_installexamples | |
fd202a5a | 146 | dh_install |
95259824 WB |
147 | # dh_installmenu |
148 | # dh_installdebconf | |
149 | # dh_installlogrotate | |
150 | # dh_installemacsen | |
151 | # dh_installpam | |
152 | # dh_installmime | |
153 | # dh_python | |
154 | # dh_installinit | |
155 | # dh_installcron | |
156 | # dh_installinfo | |
157 | dh_installman | |
158 | dh_link | |
d0603efa | 159 | dh_strip --dbgsym-migration='pve-qemu-kvm-dbg (<<8.0.0-1~)' |
95259824 WB |
160 | dh_compress |
161 | dh_fixperms | |
162 | # dh_perl | |
163 | # dh_makeshlibs | |
164 | dh_installdeb | |
f3c1e326 FG |
165 | # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common |
166 | # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead | |
167 | dh_shlibdeps -- -xlibglusterfs0 -xlibgfxdr0 -xlibgfrpc0 -xlibgfdb0 -xlibgfchangelog0 -xlibgfapi0 | |
95259824 WB |
168 | dh_gencontrol |
169 | dh_md5sums | |
170 | dh_builddeb | |
171 | ||
172 | binary: binary-indep binary-arch | |
173 | .PHONY: build clean binary-indep binary-arch binary install |