5 CFLAGS
=-O2
-Werror
-Wall
-Wextra
-Wpedantic
-Wtype-limits
-Wl
,-z
,relro
-std
=gnu11
6 JSON_CFLAGS
=$(shell pkg-config
--cflags json-c
)
7 JSON_LIBS
=$(shell pkg-config
--libs json-c
)
12 SBINDIR
=${PREFIX}/sbin
14 LIBDIR
=${PREFIX}/lib
/${PACKAGE}
15 SERVICEDIR
=/lib
/systemd
/system
16 VARLIBDIR
=/var
/lib
/${PACKAGE}
17 MANDIR
=${PREFIX}/share
/man
18 DOCDIR
=${PREFIX}/share
/doc
19 MAN1DIR
=${MANDIR}/man1
/
20 MAN5DIR
=${MANDIR}/man5
/
21 MAN8DIR
=${MANDIR}/man8
/
22 BASHCOMPLDIR
=${PREFIX}/share
/bash-completion
/completions
/
23 export PERLDIR
=${PREFIX}/share
/perl5
24 PERLINCDIR
=${PERLDIR}/asm-x86_64
26 ARCH
:=$(shell dpkg-architecture
-qDEB_BUILD_ARCH
)
27 GITVERSION
:=$(shell git rev-parse HEAD
)
29 DEB
=${PACKAGE}_
${VERSION}-${PKGREL}_
${ARCH}.deb
31 # this requires package pve-doc-generator
33 include /usr
/share
/pve-doc-generator
/pve-doc-generator.mk
35 export SOURCE_DATE_EPOCH ?
= $(shell dpkg-parsechangelog
-STimestamp
)
44 $(CC
) $(CFLAGS
) ${JSON_CFLAGS} -o
$@
$< ${JSON_LIBS}
47 PVE_GENERATING_DOCS
=1 perl
-I.
-T
-e
"use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp
50 qmrestore.bash-completion
:
51 PVE_GENERATING_DOCS
=1 perl
-I.
-T
-e
"use PVE::CLI::qmrestore; PVE::CLI::qmrestore->generate_bash_completions();" >$@.tmp
54 PKGSOURCES
=qm qm
.1 qmrestore qmrestore
.1 qmextract qm.conf
.5 qm.bash-completion qmrestore.bash-completion qmeventd qmeventd
.8
57 install: ${PKGSOURCES}
58 install -d
${DESTDIR}/${SBINDIR}
59 install -d
${DESTDIR}${LIBDIR}
60 install -d
${DESTDIR}${VARLIBDIR}
61 install -d
${DESTDIR}${SERVICEDIR}
62 install -d
${DESTDIR}/${MAN1DIR}
63 install -d
${DESTDIR}/${MAN5DIR}
64 install -d
${DESTDIR}/${MAN8DIR}
65 install -d
${DESTDIR}/usr
/share
/man
/man5
66 install -d
${DESTDIR}/usr
/share
/${PACKAGE}
67 install -m
0644 pve-usb.cfg
${DESTDIR}/usr
/share
/${PACKAGE}
68 install -m
0644 pve-q35.cfg
${DESTDIR}/usr
/share
/${PACKAGE}
69 install -m
0644 -D qm.bash-completion
${DESTDIR}/${BASHCOMPLDIR}/qm
70 install -m
0644 -D qmrestore.bash-completion
${DESTDIR}/${BASHCOMPLDIR}/qmrestore
71 install -m
0644 -D bootsplash.jpg
${DESTDIR}/usr
/share
/${PACKAGE}
73 install -m
0755 qm
${DESTDIR}${SBINDIR}
74 install -m
0755 qmrestore
${DESTDIR}${SBINDIR}
75 install -m
0755 qmeventd
${DESTDIR}${SBINDIR}
76 install -m
0644 qmeventd.service
${DESTDIR}${SERVICEDIR}
77 install -m
0755 pve-bridge
${DESTDIR}${VARLIBDIR}/pve-bridge
78 install -m
0755 pve-bridge-hotplug
${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug
79 install -m
0755 pve-bridgedown
${DESTDIR}${VARLIBDIR}/pve-bridgedown
80 install -D
-m
0644 modules-load.conf
${DESTDIR}/etc
/modules-load.d
/qemu-server.conf
81 install -m
0755 qmextract
${DESTDIR}${LIBDIR}
82 install -m
0644 qm
.1 ${DESTDIR}/${MAN1DIR}
83 gzip
-9 -n
-f
${DESTDIR}/${MAN1DIR}/qm
.1
84 install -m
0644 qmeventd
.8 ${DESTDIR}/${MAN8DIR}
85 gzip
-9 -n
-f
${DESTDIR}/${MAN8DIR}/qmeventd
.8
86 install -m
0644 qmrestore
.1 ${DESTDIR}/${MAN1DIR}
87 gzip
-9 -n
-f
${DESTDIR}/${MAN1DIR}/qmrestore
.1
88 install -m
0644 qm.conf
.5 ${DESTDIR}/${MAN5DIR}
89 gzip
-9 -n
-f
${DESTDIR}/${MAN5DIR}/qm.conf
.5
90 cd
${DESTDIR}/${MAN5DIR}; ln
-s
-f qm.conf
.5.gz vm.conf
.5.gz
97 echo
"git clone git://git.proxmox.com/git/qemu-server.git\\ngit checkout ${GITVERSION}" > build
/debian
/SOURCE
98 cd build
; dpkg-buildpackage
-b
-us
-uc
103 PVE_GENERATING_DOCS
=1 perl
-I. .
/qm verifyapi
108 tar cf
- ${DEB} | ssh repoman@repo.proxmox.com upload
--product pve
--dist stretch
113 rm -rf build
*.deb
*.buildinfo
*.changes qmeventd
114 find .
-name
'*~' -exec
rm {} ';'