]>
Commit | Line | Data |
---|---|---|
95259824 WB |
1 | #!/usr/bin/make -f |
2 | # -*- makefile -*- | |
3 | # Sample debian/rules that uses debhelper. | |
4 | # This file was originally written by Joey Hess and Craig Small. | |
5 | # As a special exception, when this file is copied by dh-make into a | |
6 | # dh-make output file, you may use that output file without restriction. | |
7 | # This special exception was added by Craig Small in version 0.37 of dh-make. | |
8 | ||
9 | # Uncomment this to turn on verbose mode. | |
10 | #export DH_VERBOSE=1 | |
11 | ||
1024d894 | 12 | include /usr/share/dpkg/pkg-info.mk |
95259824 WB |
13 | |
14 | # These are used for cross-compiling and for saving the configure script | |
15 | # from having to guess our platform (since we know it already) | |
16 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | |
17 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | |
18 | ||
a544966d WB |
19 | ARCH ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) |
20 | ||
95259824 WB |
21 | PACKAGE=pve-qemu-kvm |
22 | destdir := $(CURDIR)/debian/$(PACKAGE) | |
23 | ||
376d9ce8 | 24 | flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64 |
6503e6e0 | 25 | machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64.json |
376d9ce8 | 26 | |
817b7667 SR |
27 | # default QEMU out-of-tree build directory is ./build |
28 | BUILDDIR=build | |
29 | ||
95259824 WB |
30 | CFLAGS = -Wall |
31 | ||
32 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) | |
33 | CFLAGS += -O0 | |
34 | else | |
35 | CFLAGS += -O2 | |
36 | endif | |
37 | ||
817b7667 | 38 | ${BUILDDIR}/config.status: configure |
95259824 WB |
39 | dh_testdir |
40 | # Add here commands to configure the package. | |
a21f5778 EK |
41 | |
42 | # guest-agent is only required for guest systems | |
964a487a | 43 | ./configure \ |
eb96e850 | 44 | --with-git-submodules=ignore \ |
2fb093cf | 45 | --docdir=/usr/share/doc/pve-qemu-kvm \ |
964a487a TL |
46 | --localstatedir=/var \ |
47 | --prefix=/usr \ | |
48 | --sysconfdir=/etc \ | |
49 | --target-list=$(ARCH)-softmmu,aarch64-softmmu \ | |
817b7667 | 50 | --with-suffix="kvm" \ |
2b259b70 | 51 | --with-pkgversion="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM_REVISION}" \ |
964a487a TL |
52 | --audio-drv-list="alsa" \ |
53 | --datadir=/usr/share \ | |
44813695 | 54 | --libexecdir=/usr/lib/kvm \ |
edf1ab9a | 55 | --disable-capstone \ |
964a487a TL |
56 | --disable-gtk \ |
57 | --disable-guest-agent \ | |
58 | --disable-guest-agent-msi \ | |
59 | --disable-libnfs \ | |
fe0542be | 60 | --disable-libssh \ |
b7022279 | 61 | --disable-sdl \ |
964a487a TL |
62 | --disable-smartcard \ |
63 | --disable-strip \ | |
64 | --disable-xen \ | |
42dfcf97 | 65 | --enable-curl \ |
8dfe6145 | 66 | --enable-docs \ |
964a487a TL |
67 | --enable-glusterfs \ |
68 | --enable-gnutls \ | |
964a487a TL |
69 | --enable-libiscsi \ |
70 | --enable-libusb \ | |
71 | --enable-linux-aio \ | |
403f23a0 | 72 | --enable-linux-io-uring \ |
964a487a | 73 | --enable-numa \ |
13d3e10a | 74 | --enable-opengl \ |
964a487a | 75 | --enable-rbd \ |
73e12bd7 | 76 | --enable-seccomp \ |
964a487a TL |
77 | --enable-spice \ |
78 | --enable-usb-redir \ | |
13d3e10a | 79 | --enable-virglrenderer \ |
964a487a | 80 | --enable-virtfs \ |
44813695 | 81 | --enable-virtiofsd \ |
3aa5b759 | 82 | --enable-zstd |
95259824 | 83 | |
8e326f30 | 84 | build: build-stamp |
95259824 | 85 | |
817b7667 | 86 | build-stamp: ${BUILDDIR}/config.status |
95259824 WB |
87 | dh_testdir |
88 | ||
89 | # Add here commands to compile the package. | |
90 | $(MAKE) | |
91 | ||
92 | #docbook-to-man debian/kvm.sgml > kvm.1 | |
93 | ||
94 | touch $@ | |
95 | ||
8e326f30 | 96 | clean: |
95259824 WB |
97 | dh_testdir |
98 | dh_testroot | |
99 | rm -f build-stamp | |
100 | ||
101 | # Add here commands to clean up after the build process. | |
102 | -$(MAKE) distclean | |
103 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" | |
104 | cp -f /usr/share/misc/config.sub config.sub | |
105 | endif | |
106 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" | |
107 | cp -f /usr/share/misc/config.guess config.guess | |
108 | endif | |
109 | ||
110 | ||
111 | dh_clean | |
112 | ||
113 | install: build | |
114 | dh_testdir | |
115 | dh_testroot | |
68ba098a | 116 | dh_prep |
95259824 | 117 | dh_installdirs |
7df330a9 | 118 | dh_lintian |
95259824 WB |
119 | |
120 | # Add here commands to install the package into debian/pve-kvm. | |
121 | $(MAKE) DESTDIR=$(destdir) install | |
122 | ||
95259824 WB |
123 | # we do not need openbios files (sparc/ppc) |
124 | rm -rf $(destdir)/usr/share/kvm/openbios-* | |
125 | # remove ppc files | |
126 | rm $(destdir)/usr/share/kvm/*.dtb | |
95259824 | 127 | rm $(destdir)/usr/share/kvm/s390-ccw.img |
8fefb882 TL |
128 | rm $(destdir)/usr/share/kvm/s390-netboot.img |
129 | rm $(destdir)/usr/share/kvm/qemu_vga.ndrv | |
95259824 | 130 | rm $(destdir)/usr/share/kvm/slof.bin |
95259824 | 131 | rm $(destdir)/usr/share/kvm/u-boot.e500 |
a6ede898 | 132 | # remove Alpha files |
95259824 | 133 | rm $(destdir)/usr/share/kvm/palcode-clipper |
817b7667 | 134 | # remove RISC-V files |
eba403aa FE |
135 | rm $(destdir)/usr/share/kvm/opensbi-riscv32-generic-fw_dynamic.bin |
136 | rm $(destdir)/usr/share/kvm/opensbi-riscv64-generic-fw_dynamic.bin | |
95259824 | 137 | |
95259824 WB |
138 | # Remove things we don't package at all, would be a "kvm-dev" package |
139 | rm -Rf $(destdir)/usr/include/linux/ | |
140 | rm -Rf $(destdir)/usr/include | |
44813695 TL |
141 | rm -f $(destdir)/usr/lib/kvm/qemu-bridge-helper |
142 | rm -f $(destdir)/usr/lib/kvm/virtfs-proxy-helper | |
95259824 | 143 | |
376d9ce8 TL |
144 | # CPU flags are static for QEMU version, allows avoiding more costly checks |
145 | $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile) | |
a6ede898 | 146 | $(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machinefile) |
376d9ce8 | 147 | |
95259824 WB |
148 | # Build architecture-independent files here. |
149 | binary-indep: build install | |
150 | # We have nothing to do by default. | |
151 | ||
152 | # Build architecture-dependent files here. | |
153 | binary-arch: build install | |
154 | dh_testdir | |
155 | dh_testroot | |
2c2626dd EK |
156 | # exclude historic Changelog file, which stops at release 0.14 |
157 | dh_installchangelogs --exclude=Changelog | |
95259824 WB |
158 | dh_installdocs |
159 | dh_installexamples | |
fd202a5a | 160 | dh_install |
95259824 WB |
161 | # dh_installmenu |
162 | # dh_installdebconf | |
163 | # dh_installlogrotate | |
164 | # dh_installemacsen | |
165 | # dh_installpam | |
166 | # dh_installmime | |
167 | # dh_python | |
168 | # dh_installinit | |
169 | # dh_installcron | |
170 | # dh_installinfo | |
171 | dh_installman | |
172 | dh_link | |
173 | dh_strip --dbg-package=pve-qemu-kvm-dbg | |
174 | dh_compress | |
175 | dh_fixperms | |
176 | # dh_perl | |
177 | # dh_makeshlibs | |
178 | dh_installdeb | |
f3c1e326 FG |
179 | # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common |
180 | # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead | |
181 | dh_shlibdeps -- -xlibglusterfs0 -xlibgfxdr0 -xlibgfrpc0 -xlibgfdb0 -xlibgfchangelog0 -xlibgfapi0 | |
95259824 WB |
182 | dh_gencontrol |
183 | dh_md5sums | |
184 | dh_builddeb | |
185 | ||
186 | binary: binary-indep binary-arch | |
187 | .PHONY: build clean binary-indep binary-arch binary install |