]>
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 | ||
18 | PACKAGE=pve-qemu-kvm | |
19 | destdir := $(CURDIR)/debian/$(PACKAGE) | |
20 | ||
21 | ifneq "$(wildcard /usr/share/quilt/quilt.make)" "" | |
22 | include /usr/share/quilt/quilt.make | |
23 | endif | |
24 | ||
25 | CFLAGS = -Wall | |
26 | ||
27 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) | |
28 | CFLAGS += -O0 | |
29 | else | |
30 | CFLAGS += -O2 | |
31 | endif | |
32 | ||
33 | config.status: configure | |
34 | dh_testdir | |
35 | # Add here commands to configure the package. | |
92bf040c | 36 | ./configure --with-confsuffix="/kvm" --target-list=x86_64-softmmu --prefix=/usr --datadir=/usr/share --docdir=/usr/share/doc/pve-qemu-kvm --sysconfdir=/etc --disable-xen --enable-vnc-tls --enable-sdl --enable-uuid --enable-linux-aio --enable-rbd --enable-libiscsi --disable-smartcard-nss --audio-drv-list="alsa" |
4676c0af DM |
37 | |
38 | build: patch build-stamp | |
39 | ||
40 | build-stamp: config.status | |
41 | dh_testdir | |
42 | ||
43 | # Add here commands to compile the package. | |
49adae7d | 44 | $(MAKE) |
4676c0af DM |
45 | |
46 | #docbook-to-man debian/kvm.sgml > kvm.1 | |
47 | ||
48 | touch $@ | |
49 | ||
50 | clean: unpatch | |
51 | dh_testdir | |
52 | dh_testroot | |
e96de165 | 53 | rm -f build-stamp |
4676c0af DM |
54 | |
55 | # Add here commands to clean up after the build process. | |
56 | -$(MAKE) distclean | |
57 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" | |
58 | cp -f /usr/share/misc/config.sub config.sub | |
59 | endif | |
60 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" | |
61 | cp -f /usr/share/misc/config.guess config.guess | |
62 | endif | |
63 | ||
64 | ||
e96de165 | 65 | dh_clean |
4676c0af DM |
66 | |
67 | install: build | |
68 | dh_testdir | |
69 | dh_testroot | |
e96de165 | 70 | dh_clean -k |
4676c0af DM |
71 | dh_installdirs |
72 | ||
73 | # Add here commands to install the package into debian/pve-kvm. | |
74 | $(MAKE) DESTDIR=$(destdir) install | |
75 | ||
76 | mv $(destdir)/usr/bin/qemu-system-x86_64 $(destdir)/usr/bin/kvm | |
77 | mv $(destdir)/usr/share/man/man1/qemu.1 $(destdir)/usr/share/man/man1/kvm.1 | |
78 | ||
79 | # Install the userspace utilities | |
a023e148 | 80 | install -m 0755 scripts/kvm/kvm_stat $(destdir)/usr/bin/ |
3f350e0d | 81 | install -s -m 0755 vma $(destdir)/usr/bin/ |
4676c0af DM |
82 | |
83 | install -D -m 0755 $(CURDIR)/debian/kvm-ifup $(destdir)/etc/kvm/kvm-ifup | |
84 | install -D -m 0755 $(CURDIR)/debian/kvm-ifdown $(destdir)/etc/kvm/kvm-ifdown | |
8b7e3518 | 85 | |
e96de165 | 86 | # do not install empty file (now in /usr/share/kvm/cpus-x86_64.conf) |
b259b742 | 87 | rm $(destdir)/etc/kvm/target-x86_64.conf |
8b7e3518 | 88 | |
4676c0af DM |
89 | # we do not need openbios files (sparc/ppc) |
90 | rm -rf $(destdir)/usr/share/kvm/openbios-* | |
91 | # remove ppc files | |
92 | rm $(destdir)/usr/share/kvm/*.dtb | |
93 | rm $(destdir)/usr/share/kvm/ppc_rom.bin | |
94 | rm $(destdir)/usr/share/kvm/s390-zipl.rom | |
95 | rm $(destdir)/usr/share/kvm/slof.bin | |
96 | rm $(destdir)/usr/share/kvm/spapr-rtas.bin | |
7e037317 DM |
97 | # remove Aplha files |
98 | rm $(destdir)/usr/share/kvm/palcode-clipper | |
4676c0af DM |
99 | |
100 | # remove guest agent (that is only required for a guest) | |
101 | rm $(destdir)/usr/bin/qemu-ga | |
102 | ||
103 | # Remove things we don't package at all, would be a "kvm-dev" package | |
104 | rm -Rf $(destdir)/usr/include/linux/ | |
105 | rm -Rf $(destdir)/usr/include | |
106 | rm -Rf $(destdir)/usr/lib* | |
107 | ||
108 | # Build architecture-independent files here. | |
109 | binary-indep: build install | |
110 | # We have nothing to do by default. | |
111 | ||
112 | # Build architecture-dependent files here. | |
113 | binary-arch: build install | |
114 | dh_testdir | |
115 | dh_testroot | |
e96de165 | 116 | dh_installchangelogs |
4676c0af DM |
117 | dh_installdocs |
118 | dh_installexamples | |
119 | # dh_install | |
120 | # dh_installmenu | |
e96de165 | 121 | # dh_installdebconf |
4676c0af DM |
122 | # dh_installlogrotate |
123 | # dh_installemacsen | |
124 | # dh_installpam | |
125 | # dh_installmime | |
126 | # dh_python | |
127 | # dh_installinit | |
128 | # dh_installcron | |
129 | # dh_installinfo | |
130 | dh_installman | |
131 | dh_link | |
132 | dh_strip | |
133 | dh_compress | |
134 | dh_fixperms | |
135 | # dh_perl | |
136 | # dh_makeshlibs | |
137 | dh_installdeb | |
138 | dh_shlibdeps | |
139 | dh_gencontrol | |
140 | dh_md5sums | |
141 | dh_builddeb | |
142 | ||
143 | binary: binary-indep binary-arch | |
e96de165 | 144 | .PHONY: build clean binary-indep binary-arch binary install |