]> git.proxmox.com Git - pve-qemu.git/blob - debian/rules
pbs block driver: run read in the AIO context of the bs
[pve-qemu.git] / debian / rules
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
12 include /usr/share/dpkg/pkg-info.mk
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
19 ARCH ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
20
21 PACKAGE=pve-qemu-kvm
22 destdir := $(CURDIR)/debian/$(PACKAGE)
23
24 flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64
25 machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64.json
26
27 # default QEMU out-of-tree build directory is ./build
28 BUILDDIR=build
29
30 CFLAGS = -Wall
31
32 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
33 CFLAGS += -O0
34 else
35 CFLAGS += -O2
36 endif
37
38 ${BUILDDIR}/config.status: configure
39 dh_testdir
40 # Add here commands to configure the package.
41
42 # guest-agent is only required for guest systems
43 ./configure \
44 --docdir=/usr/share/doc/pve-qemu-kvm \
45 --localstatedir=/var \
46 --prefix=/usr \
47 --sysconfdir=/etc \
48 --target-list=$(ARCH)-softmmu,aarch64-softmmu \
49 --with-suffix="kvm" \
50 --with-pkgversion="${DEB_SOURCE}_${DEB_VERSION_UPSTREAM}" \
51 --audio-drv-list="alsa" \
52 --datadir=/usr/share \
53 --libexecdir=/usr/lib/kvm \
54 --disable-capstone \
55 --disable-gtk \
56 --disable-guest-agent \
57 --disable-guest-agent-msi \
58 --disable-libnfs \
59 --disable-libxml2 \
60 --disable-sdl \
61 --disable-smartcard \
62 --disable-strip \
63 --disable-xen \
64 --enable-curl \
65 --enable-docs \
66 --enable-glusterfs \
67 --enable-gnutls \
68 --enable-libiscsi \
69 --enable-libusb \
70 --enable-linux-aio \
71 --enable-numa \
72 --enable-rbd \
73 --enable-seccomp \
74 --enable-spice \
75 --enable-usb-redir \
76 --enable-virtfs \
77 --enable-virtiofsd \
78 --enable-xfsctl
79
80 build: build-stamp
81
82 build-stamp: ${BUILDDIR}/config.status
83 dh_testdir
84
85 # Add here commands to compile the package.
86 $(MAKE)
87
88 #docbook-to-man debian/kvm.sgml > kvm.1
89
90 touch $@
91
92 clean:
93 dh_testdir
94 dh_testroot
95 rm -f build-stamp
96
97 # Add here commands to clean up after the build process.
98 -$(MAKE) distclean
99 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
100 cp -f /usr/share/misc/config.sub config.sub
101 endif
102 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
103 cp -f /usr/share/misc/config.guess config.guess
104 endif
105
106
107 dh_clean
108
109 install: build
110 dh_testdir
111 dh_testroot
112 dh_prep
113 dh_installdirs
114 dh_lintian
115
116 # Add here commands to install the package into debian/pve-kvm.
117 $(MAKE) DESTDIR=$(destdir) install
118
119 # we do not need openbios files (sparc/ppc)
120 rm -rf $(destdir)/usr/share/kvm/openbios-*
121 # remove ppc files
122 rm $(destdir)/usr/share/kvm/*.dtb
123 rm $(destdir)/usr/share/kvm/s390-ccw.img
124 rm $(destdir)/usr/share/kvm/s390-netboot.img
125 rm $(destdir)/usr/share/kvm/qemu_vga.ndrv
126 rm $(destdir)/usr/share/kvm/slof.bin
127 rm $(destdir)/usr/share/kvm/u-boot.e500
128 # remove Alpha files
129 rm $(destdir)/usr/share/kvm/palcode-clipper
130 # remove RISC-V files
131 rm $(destdir)/usr/share/kvm/opensbi-riscv32-generic-fw_dynamic.elf
132 rm $(destdir)/usr/share/kvm/opensbi-riscv64-generic-fw_dynamic.elf
133
134 # Remove things we don't package at all, would be a "kvm-dev" package
135 rm -Rf $(destdir)/usr/include/linux/
136 rm -Rf $(destdir)/usr/include
137 rm -f $(destdir)/usr/lib/kvm/qemu-bridge-helper
138 rm -f $(destdir)/usr/lib/kvm/virtfs-proxy-helper
139
140 # CPU flags are static for QEMU version, allows avoiding more costly checks
141 $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile)
142 $(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machinefile)
143
144 # Build architecture-independent files here.
145 binary-indep: build install
146 # We have nothing to do by default.
147
148 # Build architecture-dependent files here.
149 binary-arch: build install
150 dh_testdir
151 dh_testroot
152 # exclude historic Changelog file, which stops at release 0.14
153 dh_installchangelogs --exclude=Changelog
154 dh_installdocs
155 dh_installexamples
156 dh_install
157 # dh_installmenu
158 # dh_installdebconf
159 # dh_installlogrotate
160 # dh_installemacsen
161 # dh_installpam
162 # dh_installmime
163 # dh_python
164 # dh_installinit
165 # dh_installcron
166 # dh_installinfo
167 dh_installman
168 dh_link
169 dh_strip --dbg-package=pve-qemu-kvm-dbg
170 dh_compress
171 dh_fixperms
172 # dh_perl
173 # dh_makeshlibs
174 dh_installdeb
175 # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common
176 # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead
177 dh_shlibdeps -- -xlibglusterfs0 -xlibgfxdr0 -xlibgfrpc0 -xlibgfdb0 -xlibgfchangelog0 -xlibgfapi0
178 dh_gencontrol
179 dh_md5sums
180 dh_builddeb
181
182 binary: binary-indep binary-arch
183 .PHONY: build clean binary-indep binary-arch binary install