1 include /usr
/share
/dpkg
/default.mk
4 PACKAGE
:= proxmox-backup
5 ARCH
:= $(DEB_BUILD_ARCH
)
7 SUBDIRS
:= etc www docs
9 # Binaries usable by users
11 proxmox-backup-client \
14 # Binaries usable by admins
16 proxmox-backup-manager
18 # Binaries for services:
21 proxmox-backup-banner \
24 ifeq ($(BUILD_MODE
), release
)
25 CARGO_BUILD_ARGS
+= --release
26 COMPILEDIR
:= target
/release
28 COMPILEDIR
:= target
/debug
31 ifeq ($(valgrind
), yes
)
32 CARGO_BUILD_ARGS
+= --features valgrind
38 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
))
40 SERVER_DEB
=${PACKAGE}-server_
${DEB_VERSION}_
${ARCH}.deb
41 CLIENT_DEB
=${PACKAGE}-client_
${DEB_VERSION}_
${ARCH}.deb
42 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
44 DEBS
=${SERVER_DEB} ${CLIENT_DEB}
46 DSC
= rust-
${PACKAGE}_
${DEB_VERSION}.dsc
50 all: cargo-build
$(SUBDIRS
)
57 #cargo test test_broadcast_future
58 #cargo test $(CARGO_BUILD_ARGS)
59 $(CARGO
) test $(tests
) $(CARGO_BUILD_ARGS
)
62 $(CARGO
) doc
--no-deps
$(CARGO_BUILD_ARGS
)
64 # always re-create this dir
68 debcargo package
--config debian
/debcargo.toml
--changelog-ready
--no-overlay-write-back
--directory build proxmox-backup
$(shell dpkg-parsechangelog
-l debian
/changelog
-SVersion | sed
-e
's/-.*//')
69 sed
-e
'1,/^$$/ ! d' build
/debian
/control
> build
/debian
/control.src
70 cat build
/debian
/control.src build
/debian
/control.in
> build
/debian
/control
71 rm build
/debian
/control.in build
/debian
/control.src
73 find build
/debian
-name
"*.hint" -delete
74 $(foreach i
,$(SUBDIRS
), \
75 $(MAKE
) -C build
/$(i
) clean ;)
78 .PHONY
: proxmox-backup-docs
79 proxmox-backup-docs
: $(DOC_DEB
)
81 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
84 # copy the local target/ dir as a build-cache
88 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
94 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
100 $(foreach i
,$(SUBDIRS
), \
101 $(MAKE
) -C
$(i
) clean ;)
103 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
104 find .
-name
'*~' -exec
rm {} ';'
110 # make sure we build binaries before docs
115 $(CARGO
) build
$(CARGO_BUILD_ARGS
)
117 $(COMPILED_BINS
): cargo-build
121 cargo clippy
-- -A clippy
::all -D clippy
::correctness
123 install: $(COMPILED_BINS
)
124 install -dm755
$(DESTDIR
)$(BINDIR
)
125 install -dm755
$(DESTDIR
)$(ZSH_COMPL_DEST
)
126 $(foreach i
,$(USR_BIN
), \
127 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ; \
128 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
129 install -dm755
$(DESTDIR
)$(SBINDIR
)
130 $(foreach i
,$(USR_SBIN
), \
131 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ; \
132 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
133 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
134 $(foreach i
,$(SERVICE_BIN
), \
135 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
136 $(MAKE
) -C www
install
137 $(MAKE
) -C docs
install
140 upload
: ${SERVER_DEB} ${CLIENT_DEB} ${DOC_DEB}
141 # check if working directory is clean
142 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
143 tar cf
- ${SERVER_DEB} ${DOC_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist buster
144 tar cf
- ${CLIENT_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pbs,pve" --dist buster