]>
Commit | Line | Data |
---|---|---|
4676c0af DM |
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 | ||
13 | # These are used for cross-compiling and for saving the configure script | |
14 | # from having to guess our platform (since we know it already) | |
15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | |
16 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | |
17 | ||
1be2b948 WB |
18 | ARCH ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) |
19 | ||
4676c0af DM |
20 | PACKAGE=pve-qemu-kvm |
21 | destdir := $(CURDIR)/debian/$(PACKAGE) | |
22 | ||
23 | ifneq "$(wildcard /usr/share/quilt/quilt.make)" "" | |
24 | include /usr/share/quilt/quilt.make | |
25 | endif | |
26 | ||
27 | CFLAGS = -Wall | |
28 | ||
29 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) | |
30 | CFLAGS += -O0 | |
31 | else | |
32 | CFLAGS += -O2 | |
33 | endif | |
34 | ||
35 | config.status: configure | |
36 | dh_testdir | |
37 | # Add here commands to configure the package. | |
1be2b948 | 38 | ./configure --with-confsuffix="/kvm" --target-list=$(ARCH)-softmmu --prefix=/usr --datadir=/usr/share --docdir=/usr/share/doc/pve-qemu-kvm --sysconfdir=/etc --localstatedir=/var --disable-xen --enable-gnutls --enable-sdl --enable-uuid --enable-linux-aio --enable-rbd --enable-libiscsi --disable-smartcard --audio-drv-list="alsa" --enable-spice --enable-usb-redir --enable-glusterfs --enable-libusb --disable-gtk --enable-xfsctl --enable-numa --disable-strip --enable-jemalloc --disable-libnfs --disable-fdt |
4676c0af DM |
39 | |
40 | build: patch build-stamp | |
41 | ||
42 | build-stamp: config.status | |
43 | dh_testdir | |
44 | ||
45 | # Add here commands to compile the package. | |
49adae7d | 46 | $(MAKE) |
4676c0af DM |
47 | |
48 | #docbook-to-man debian/kvm.sgml > kvm.1 | |
49 | ||
50 | touch $@ | |
51 | ||
52 | clean: unpatch | |
53 | dh_testdir | |
54 | dh_testroot | |
e96de165 | 55 | rm -f build-stamp |
4676c0af DM |
56 | |
57 | # Add here commands to clean up after the build process. | |
58 | -$(MAKE) distclean | |
59 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" | |
60 | cp -f /usr/share/misc/config.sub config.sub | |
61 | endif | |
62 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" | |
63 | cp -f /usr/share/misc/config.guess config.guess | |
64 | endif | |
65 | ||
66 | ||
e96de165 | 67 | dh_clean |
4676c0af DM |
68 | |
69 | install: build | |
70 | dh_testdir | |
71 | dh_testroot | |
e96de165 | 72 | dh_clean -k |
4676c0af DM |
73 | dh_installdirs |
74 | ||
75 | # Add here commands to install the package into debian/pve-kvm. | |
76 | $(MAKE) DESTDIR=$(destdir) install | |
77 | ||
1be2b948 | 78 | mv $(destdir)/usr/bin/qemu-system-$(ARCH) $(destdir)/usr/bin/kvm |
4676c0af DM |
79 | mv $(destdir)/usr/share/man/man1/qemu.1 $(destdir)/usr/share/man/man1/kvm.1 |
80 | ||
81 | # Install the userspace utilities | |
b668dc80 | 82 | install -s -m 0755 vma $(destdir)/usr/bin/ |
4676c0af DM |
83 | |
84 | install -D -m 0755 $(CURDIR)/debian/kvm-ifup $(destdir)/etc/kvm/kvm-ifup | |
85 | install -D -m 0755 $(CURDIR)/debian/kvm-ifdown $(destdir)/etc/kvm/kvm-ifdown | |
8b7e3518 | 86 | |
36fe10c5 | 87 | #install ovmf uefi rom |
e514cee9 | 88 | install -D -m 0644 $(CURDIR)/debian/OVMF_CODE-pure-efi.fd $(destdir)/usr/share/kvm/OVMF_CODE-pure-efi.fd |
de6afa06 | 89 | install -D -m 0644 $(CURDIR)/debian/OVMF_VARS-pure-efi.fd $(destdir)/usr/share/kvm/OVMF_VARS-pure-efi.fd |
36fe10c5 | 90 | |
4676c0af DM |
91 | # we do not need openbios files (sparc/ppc) |
92 | rm -rf $(destdir)/usr/share/kvm/openbios-* | |
93 | # remove ppc files | |
94 | rm $(destdir)/usr/share/kvm/*.dtb | |
95 | rm $(destdir)/usr/share/kvm/ppc_rom.bin | |
14f659ce | 96 | rm $(destdir)/usr/share/kvm/s390-ccw.img |
4676c0af DM |
97 | rm $(destdir)/usr/share/kvm/slof.bin |
98 | rm $(destdir)/usr/share/kvm/spapr-rtas.bin | |
9ad52b2d | 99 | rm $(destdir)/usr/share/kvm/u-boot.e500 |
7e037317 DM |
100 | # remove Aplha files |
101 | rm $(destdir)/usr/share/kvm/palcode-clipper | |
4676c0af DM |
102 | |
103 | # remove guest agent (that is only required for a guest) | |
104 | rm $(destdir)/usr/bin/qemu-ga | |
105 | ||
106 | # Remove things we don't package at all, would be a "kvm-dev" package | |
107 | rm -Rf $(destdir)/usr/include/linux/ | |
108 | rm -Rf $(destdir)/usr/include | |
109 | rm -Rf $(destdir)/usr/lib* | |
110 | ||
111 | # Build architecture-independent files here. | |
112 | binary-indep: build install | |
113 | # We have nothing to do by default. | |
114 | ||
115 | # Build architecture-dependent files here. | |
116 | binary-arch: build install | |
117 | dh_testdir | |
118 | dh_testroot | |
e96de165 | 119 | dh_installchangelogs |
4676c0af DM |
120 | dh_installdocs |
121 | dh_installexamples | |
122 | # dh_install | |
123 | # dh_installmenu | |
e96de165 | 124 | # dh_installdebconf |
4676c0af DM |
125 | # dh_installlogrotate |
126 | # dh_installemacsen | |
127 | # dh_installpam | |
128 | # dh_installmime | |
129 | # dh_python | |
130 | # dh_installinit | |
131 | # dh_installcron | |
132 | # dh_installinfo | |
133 | dh_installman | |
134 | dh_link | |
a222f2c8 | 135 | dh_strip --dbg-package=pve-qemu-kvm-dbg |
4676c0af DM |
136 | dh_compress |
137 | dh_fixperms | |
138 | # dh_perl | |
139 | # dh_makeshlibs | |
140 | dh_installdeb | |
141 | dh_shlibdeps | |
142 | dh_gencontrol | |
143 | dh_md5sums | |
144 | dh_builddeb | |
145 | ||
146 | binary: binary-indep binary-arch | |
e96de165 | 147 | .PHONY: build clean binary-indep binary-arch binary install |