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