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.
9 # Uncomment this to turn on verbose mode.
12 include /usr
/share
/dpkg
/pkg-info.mk
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
)
19 ARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_CPU
)
22 destdir
:= $(CURDIR
)/debian
/$(PACKAGE
)
24 flagfile
:= $(destdir
)/usr
/share
/kvm
/recognized-CPUID-flags-x86_64
25 machinefile
:= $(destdir
)/usr
/share
/kvm
/machine-versions-x86_64.json
27 # default QEMU out-of-tree build directory is ./build
32 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
38 ${BUILDDIR}/config.status
: configure
40 # Add here commands to configure the package.
42 # guest-agent is only required for guest systems
44 --with-git-submodules
=ignore \
45 --docdir
=/usr
/share
/doc
/pve-qemu-kvm \
46 --localstatedir
=/var \
49 --target-list
=$(ARCH
)-softmmu
,aarch64-softmmu \
51 --with-pkgversion
="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM_REVISION}" \
52 --audio-drv-list
="alsa" \
53 --datadir=/usr
/share \
54 --libexecdir
=/usr
/lib
/kvm \
57 --disable-guest-agent \
58 --disable-guest-agent-msi \
73 --enable-linux-io-uring \
80 --enable-virglrenderer \
87 build-stamp
: ${BUILDDIR}/config.status
90 # Add here commands to compile the package.
93 #docbook-to-man debian/kvm.sgml > kvm.1
102 # Add here commands to clean up after the build process.
104 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
105 cp
-f
/usr
/share
/misc
/config.sub config.sub
107 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
108 cp
-f
/usr
/share
/misc
/config.guess config.guess
121 # Add here commands to install the package into debian/pve-kvm.
122 $(MAKE
) DESTDIR
=$(destdir
) install
124 # we do not need openbios files (sparc/ppc)
125 rm -rf
$(destdir
)/usr
/share
/kvm
/openbios-
*
127 rm $(destdir
)/usr
/share
/kvm
/*.dtb
128 rm $(destdir
)/usr
/share
/kvm
/s390-ccw.img
129 rm $(destdir
)/usr
/share
/kvm
/s390-netboot.img
130 rm $(destdir
)/usr
/share
/kvm
/qemu_vga.ndrv
131 rm $(destdir
)/usr
/share
/kvm
/slof.bin
132 rm $(destdir
)/usr
/share
/kvm
/u-boot.e500
134 rm $(destdir
)/usr
/share
/kvm
/palcode-clipper
135 # remove RISC-V files
136 rm $(destdir
)/usr
/share
/kvm
/opensbi-riscv32-generic-fw_dynamic.bin
137 rm $(destdir
)/usr
/share
/kvm
/opensbi-riscv64-generic-fw_dynamic.bin
139 # Remove things we don't package at all, would be a "kvm-dev" package
140 rm -Rf
$(destdir
)/usr
/include/linux
/
141 rm -Rf
$(destdir
)/usr
/include
142 rm -f
$(destdir
)/usr
/lib
/kvm
/qemu-bridge-helper
143 rm -f
$(destdir
)/usr
/lib
/kvm
/virtfs-proxy-helper
145 # CPU flags are static for QEMU version, allows avoiding more costly checks
146 $(destdir
)/usr
/bin
/qemu-system-x86_64
-cpu help | .
/debian
/parse-cpu-flags.pl
> $(flagfile
)
147 $(destdir
)/usr
/bin
/qemu-system-x86_64
-machine help | .
/debian
/parse-machines.pl
> $(machinefile
)
149 # Build architecture-independent files here.
150 binary-indep
: build
install
151 # We have nothing to do by default.
153 # Build architecture-dependent files here.
154 binary-arch
: build
install
157 # exclude historic Changelog file, which stops at release 0.14
158 dh_installchangelogs
--exclude
=Changelog
164 # dh_installlogrotate
174 dh_strip
--dbg-package
=pve-qemu-kvm-dbg
180 # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common
181 # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead
182 dh_shlibdeps
-- -xlibglusterfs0
-xlibgfxdr0
-xlibgfrpc0
-xlibgfdb0
-xlibgfchangelog0
-xlibgfapi0
187 binary
: binary-indep binary-arch
188 .PHONY
: build
clean binary-indep binary-arch binary
install