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