]>
Commit | Line | Data |
---|---|---|
6b0ddb3c | 1 | RELEASE=4.0 |
1e3baf05 | 2 | |
6b0ddb3c | 3 | VERSION=4.0 |
1e3baf05 | 4 | PACKAGE=qemu-server |
acc5d34a | 5 | PKGREL=6 |
1e3baf05 | 6 | |
4841125d DM |
7 | CFLAGS= -O2 -Werror -Wall -Wtype-limits -Wl,-z,relro |
8 | ||
1e3baf05 DM |
9 | DESTDIR= |
10 | PREFIX=/usr | |
11 | BINDIR=${PREFIX}/bin | |
12 | SBINDIR=${PREFIX}/sbin | |
13 | BINDIR=${PREFIX}/bin | |
14 | LIBDIR=${PREFIX}/lib/${PACKAGE} | |
15 | VARLIBDIR=/var/lib/${PACKAGE} | |
16 | MANDIR=${PREFIX}/share/man | |
17 | DOCDIR=${PREFIX}/share/doc | |
18 | PODDIR=${PREFIX}/share/doc/${PACKAGE}/pod | |
19 | MAN1DIR=${MANDIR}/man1/ | |
20 | export PERLDIR=${PREFIX}/share/perl5 | |
21 | PERLINCDIR=${PERLDIR}/asm-x86_64 | |
22 | ||
23 | ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) | |
2354a8bb DM |
24 | GITVERSION:=$(shell cat .git/refs/heads/master) |
25 | ||
1e3baf05 DM |
26 | DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb |
27 | ||
1e3baf05 DM |
28 | all: ${DEB} |
29 | ||
30 | .PHONY: dinstall | |
31 | dinstall: deb | |
32 | dpkg -i ${DEB} | |
33 | ||
34 | control: control.in | |
35 | sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/<$< >$@ | |
36 | ||
1e3baf05 DM |
37 | vzsyscalls.ph: vzsyscalls.h |
38 | h2ph -d . vzsyscalls.h | |
39 | ||
40 | vmtar: vmtar.c utils.c | |
4841125d | 41 | gcc ${CFLAGS} -o vmtar vmtar.c |
1e3baf05 DM |
42 | |
43 | sparsecp: sparsecp.c utils.c | |
4841125d | 44 | gcc ${CFLAGS} -o sparsecp sparsecp.c |
1e3baf05 DM |
45 | |
46 | %.1.gz: %.1.pod | |
47 | rm -f $@ | |
48 | cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@ | |
49 | ||
50 | %.5.gz: %.5.pod | |
51 | rm -f $@ | |
52 | cat $<|pod2man -n $* -s 5 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@ | |
53 | ||
54 | %.1.pod: % | |
55 | podselect $*>$@ | |
56 | ||
57 | qm.1.pod: qm PVE/QemuServer.pm | |
58 | perl -I. ./qm printmanpod >$@ | |
59 | ||
3e16d5fc DM |
60 | qmrestore.1.pod: qmrestore |
61 | perl -I. ./qmrestore printmanpod >$@ | |
62 | ||
1e3baf05 DM |
63 | vm.conf.5.pod: gen-vmconf-pod.pl PVE/QemuServer.pm |
64 | perl -I. ./gen-vmconf-pod.pl >$@ | |
65 | ||
4841125d | 66 | PKGSOURCES=qm qm.1.gz qm.1.pod qmrestore qmrestore.1.pod qmrestore.1.gz qmextract sparsecp vmtar control vm.conf.5.pod vm.conf.5.gz |
1e3baf05 DM |
67 | |
68 | .PHONY: install | |
69 | install: ${PKGSOURCES} | |
70 | install -d ${DESTDIR}/${SBINDIR} | |
71 | install -d ${DESTDIR}/etc/${PACKAGE} | |
72 | install -d ${DESTDIR}${LIBDIR} | |
73 | install -d ${DESTDIR}${VARLIBDIR} | |
74 | install -d ${DESTDIR}${PODDIR} | |
75 | install -d ${DESTDIR}/usr/share/man/man1 | |
76 | install -d ${DESTDIR}/usr/share/man/man5 | |
77 | install -d ${DESTDIR}/usr/share/${PACKAGE} | |
78 | install -m 0644 pve-usb.cfg ${DESTDIR}/usr/share/${PACKAGE} | |
f8e83f05 | 79 | install -m 0644 pve-q35.cfg ${DESTDIR}/usr/share/${PACKAGE} |
1e3baf05 DM |
80 | make -C PVE install |
81 | install -m 0755 qm ${DESTDIR}${SBINDIR} | |
1e3baf05 | 82 | install -m 0755 qmrestore ${DESTDIR}${SBINDIR} |
1e3baf05 | 83 | install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge |
011c5817 | 84 | install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown |
1e3baf05 DM |
85 | install -s -m 0755 vmtar ${DESTDIR}${LIBDIR} |
86 | install -s -m 0755 sparsecp ${DESTDIR}${LIBDIR} | |
4841125d | 87 | install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf |
3e16d5fc | 88 | install -m 0755 qmextract ${DESTDIR}${LIBDIR} |
1e3baf05 DM |
89 | install -m 0644 qm.1.gz ${DESTDIR}/usr/share/man/man1/ |
90 | install -m 0644 qm.1.pod ${DESTDIR}/${PODDIR} | |
1e3baf05 | 91 | install -m 0644 qmrestore.1.gz ${DESTDIR}/usr/share/man/man1/ |
3e16d5fc | 92 | install -m 0644 qmrestore.1.pod ${DESTDIR}/${PODDIR} |
1e3baf05 DM |
93 | install -m 0644 vm.conf.5.pod ${DESTDIR}/${PODDIR} |
94 | install -m 0644 vm.conf.5.gz ${DESTDIR}/usr/share/man/man5/ | |
95 | ||
96 | .PHONY: deb ${DEB} | |
97 | deb ${DEB}: ${PKGSOURCES} | |
81425ee8 DM |
98 | rm -rf build |
99 | mkdir build | |
100 | make DESTDIR=${CURDIR}/build install | |
1e3baf05 | 101 | perl -I. ./qm verifyapi |
81425ee8 DM |
102 | install -d -m 0755 build/DEBIAN |
103 | install -m 0644 control build/DEBIAN | |
4841125d | 104 | echo "/etc/modules-load.d/qemu-server.conf" >>build/DEBIAN/conffiles |
81425ee8 DM |
105 | install -D -m 0644 copyright build/${DOCDIR}/${PACKAGE}/copyright |
106 | install -m 0644 changelog.Debian build/${DOCDIR}/${PACKAGE}/ | |
107 | gzip -9 build/${DOCDIR}/${PACKAGE}/changelog.Debian | |
2354a8bb | 108 | echo "git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/${PACKAGE}/SOURCE |
81425ee8 DM |
109 | dpkg-deb --build build |
110 | mv build.deb ${DEB} | |
485e8e1d | 111 | lintian ${DEB} |
1e3baf05 DM |
112 | |
113 | .PHONY: upload | |
114 | upload: | |
115 | umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw | |
116 | mkdir -p /pve/${RELEASE}/extra | |
117 | rm -rf /pve/${RELEASE}/extra/${PACKAGE}_*.deb | |
118 | rm -rf /pve/${RELEASE}/extra/Packages* | |
119 | cp ${DEB} /pve/${RELEASE}/extra | |
120 | cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz | |
121 | umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro | |
122 | ||
123 | .PHONY: clean | |
124 | clean: | |
3e16d5fc | 125 | rm -rf build *.deb control vzsyscalls.ph _h2ph_pre.ph ${PACKAGE}-*.tar.gz dist *.1.gz *.pod vmtar sparsecp |
1e3baf05 DM |
126 | find . -name '*~' -exec rm {} ';' |
127 | ||
128 | ||
129 | .PHONY: distclean | |
130 | distclean: clean |