]>
Commit | Line | Data |
---|---|---|
1 | PACKAGE=pve-container | |
2 | ||
3 | PREFIX=${DESTDIR}/usr | |
4 | BINDIR=${PREFIX}/bin | |
5 | LIBDIR=${PREFIX}/lib | |
6 | SBINDIR=${PREFIX}/sbin | |
7 | MANDIR=${PREFIX}/share/man | |
8 | DOCDIR=${PREFIX}/share/doc/${PACKAGE} | |
9 | LXC_SCRIPT_DIR=${PREFIX}/share/lxc | |
10 | LXC_TMPL_DIR=${LXC_SCRIPT_DIR}/templates | |
11 | LXC_HOOK_DIR=${LXC_SCRIPT_DIR}/hooks | |
12 | LXC_COMMON_CONFIG_DIR=${LXC_SCRIPT_DIR}/config/common.conf.d | |
13 | SERVICEDIR=$(LIBDIR)/systemd/system | |
14 | PODDIR=${DOCDIR}/pod | |
15 | MAN1DIR=${MANDIR}/man1/ | |
16 | MAN5DIR=${MANDIR}/man5/ | |
17 | BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/ | |
18 | export PERLDIR=${PREFIX}/share/perl5 | |
19 | ||
20 | # this require package pve-doc-generator | |
21 | export NOVIEW=1 | |
22 | include /usr/share/pve-doc-generator/pve-doc-generator.mk | |
23 | ||
24 | all: | |
25 | ||
26 | pct.bash-completion: | |
27 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::pct; PVE::CLI::pct->generate_bash_completions();" >$@.tmp | |
28 | mv $@.tmp $@ | |
29 | ||
30 | .PHONY: check | |
31 | check: test | |
32 | make -C test | |
33 | ||
34 | .PHONY: install | |
35 | install: pct lxc-pve.conf lxc-pve-prestart-hook lxc-pve-autodev-hook lxc-pve-poststop-hook lxcnetaddbr pct.1 pct.conf.5 pve-update-lxc-config pct.bash-completion | |
36 | PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::pct; PVE::CLI::pct->verify_api();" | |
37 | install -d ${SBINDIR} | |
38 | install -m 0755 pct ${SBINDIR} | |
39 | install -m 0755 pve-update-lxc-config ${SBINDIR} | |
40 | install -d ${LXC_SCRIPT_DIR} | |
41 | install -m 0755 lxcnetaddbr ${LXC_SCRIPT_DIR} | |
42 | install -m 0755 lxc-pve-reboot-trigger ${LXC_SCRIPT_DIR} | |
43 | install -d -m0755 ${SERVICEDIR}/lxc@.service.d | |
44 | install -m0644 pve-reboot.conf ${SERVICEDIR}/lxc@.service.d/ | |
45 | install -d ${LXC_HOOK_DIR} | |
46 | install -m 0755 lxc-pve-prestart-hook ${LXC_HOOK_DIR} | |
47 | install -m 0755 lxc-pve-autodev-hook ${LXC_HOOK_DIR} | |
48 | install -m 0755 lxc-pve-poststop-hook ${LXC_HOOK_DIR} | |
49 | install -d ${LXC_COMMON_CONFIG_DIR} | |
50 | install -m 0644 lxc-pve.conf ${LXC_COMMON_CONFIG_DIR}/01-pve.conf | |
51 | install -m 0644 -D pct.bash-completion ${BASHCOMPLDIR}/pct | |
52 | make -C PVE install | |
53 | install -d ${MAN1DIR} | |
54 | install -d ${MAN5DIR} | |
55 | install -m 0644 pct.1 ${MAN1DIR} | |
56 | gzip -9 ${MAN1DIR}/pct.1 | |
57 | install -m 0644 pct.conf.5 ${MAN5DIR} | |
58 | gzip -9 ${MAN5DIR}/pct.conf.5 | |
59 | cd ${MAN5DIR}; ln -s pct.conf.5.gz ct.conf.5.gz | |
60 | ||
61 | .PHONY: test | |
62 | test: | |
63 | make -C test test | |
64 | ||
65 | .PHONY: clean | |
66 | clean: | |
67 | make -C test clean | |
68 | make cleanup-docgen | |
69 | rm -rf *.1 *.5 *.tmp *.bash-completion | |
70 | find . -name '*~' -exec rm {} ';' | |
71 | ||
72 | .PHONY: distclean | |
73 | distclean: clean | |
74 |