]> git.proxmox.com Git - pve-qemu.git/blob - debian/rules
d/rules: fix debian-rules-missing-required-target
[pve-qemu.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 include /usr/share/dpkg/default.mk
8
9 HOST_CPU ?= $(DEB_HOST_GNU_CPU)
10
11 PACKAGE=pve-qemu-kvm
12 destdir := $(CURDIR)/debian/$(PACKAGE)
13
14 flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64
15 machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64.json
16
17 # default QEMU out-of-tree build directory is ./build
18 BUILDDIR=build
19
20 CFLAGS = -Wall
21
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.
25 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
26 CFLAGS += -O0
27 else
28 CFLAGS += -O2
29 endif
30
31 export CFLAGS
32
33 # DEB_BUILD_OPTIONS=parallel=N
34 MAKEFLAGS += $(subst parallel=,-j,$(filter parallel=%,${DEB_BUILD_OPTIONS}))
35
36 ${BUILDDIR}/config.status: configure
37 dh_testdir
38 # Add here commands to configure the package.
39
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
47 # guest-agent is only required for guest systems
48 ./configure \
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-virtiofsd \
88 --enable-zstd
89
90 build: build-arch build-indep
91 build-arch: build-stamp
92 build-indep: build-stamp
93 build: build-stamp
94
95 build-stamp: ${BUILDDIR}/config.status
96 dh_testdir
97
98 # Add here commands to compile the package.
99 $(MAKE)
100
101 #docbook-to-man debian/kvm.sgml > kvm.1
102
103 touch $@
104
105 clean:
106 dh_testdir
107 dh_testroot
108 rm -f build-stamp
109
110 # Add here commands to clean up before the build process.
111 -$(MAKE) distclean
112
113 dh_clean
114
115 install: build
116 dh_testdir
117 dh_testroot
118 dh_prep
119 dh_installdirs
120 dh_lintian
121
122 # Add here commands to install the package into debian/pve-kvm.
123 $(MAKE) DESTDIR=$(destdir) install
124
125 # we do not need openbios files (sparc/ppc)
126 rm -rf $(destdir)/usr/share/kvm/openbios-*
127 # remove ppc files
128 rm $(destdir)/usr/share/kvm/*.dtb
129 rm $(destdir)/usr/share/kvm/s390-ccw.img
130 rm $(destdir)/usr/share/kvm/s390-netboot.img
131 rm $(destdir)/usr/share/kvm/qemu_vga.ndrv
132 rm $(destdir)/usr/share/kvm/slof.bin
133 rm $(destdir)/usr/share/kvm/u-boot.e500
134 # remove Alpha files
135 rm $(destdir)/usr/share/kvm/palcode-clipper
136 # remove RISC-V files
137 rm $(destdir)/usr/share/kvm/opensbi-riscv32-generic-fw_dynamic.bin
138 rm $(destdir)/usr/share/kvm/opensbi-riscv64-generic-fw_dynamic.bin
139
140 # Remove things we don't package at all, would be a "kvm-dev" package
141 rm -Rf $(destdir)/usr/include/linux/
142 rm -Rf $(destdir)/usr/include
143 rm -f $(destdir)/usr/lib/kvm/qemu-bridge-helper
144 rm -f $(destdir)/usr/lib/kvm/virtfs-proxy-helper
145
146 # CPU flags are static for QEMU version, allows avoiding more costly checks
147 $(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile)
148 $(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machinefile)
149
150 # Build architecture-independent files here.
151 binary-indep: build install
152 # We have nothing to do by default.
153
154 # Build architecture-dependent files here.
155 binary-arch: build install
156 dh_testdir
157 dh_testroot
158 # exclude historic Changelog file, which stops at release 0.14
159 dh_installchangelogs --exclude=Changelog
160 dh_installdocs
161 dh_installexamples
162 dh_install
163 # dh_installmenu
164 # dh_installdebconf
165 # dh_installlogrotate
166 # dh_installemacsen
167 # dh_installpam
168 # dh_installmime
169 # dh_python
170 # dh_installinit
171 # dh_installcron
172 # dh_installinfo
173 dh_installman
174 dh_link
175 dh_strip --dbg-package=pve-qemu-kvm-dbg
176 dh_compress
177 dh_fixperms
178 # dh_perl
179 # dh_makeshlibs
180 dh_installdeb
181 # Debian >= Buster has libglusterfs0 and lots of libgfFOO, upstream has the libs in glusterfs-common
182 # pass -x to dpkg-shlibdeps and specify dependencies in d/control instead
183 dh_shlibdeps -- -xlibglusterfs0 -xlibgfxdr0 -xlibgfrpc0 -xlibgfdb0 -xlibgfchangelog0 -xlibgfapi0
184 dh_gencontrol
185 dh_md5sums
186 dh_builddeb
187
188 binary: binary-indep binary-arch
189 .PHONY: build clean binary-indep binary-arch binary install