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 \
12 proxmox-file-restore \
18 # Binaries usable by admins
20 proxmox-backup-manager \
21 proxmox-backup-debug \
23 # Binaries for services:
26 proxmox-backup-banner \
27 proxmox-backup-proxy \
30 # Single file restore daemon
32 proxmox-restore-daemon
34 SUBCRATES
!= cargo metadata
--format-version
=1 | jq
-r .workspace_members
'[]' | awk
'{ print $$1 }' | grep
-v
'^proxmox-backup$$' | tr
'\n' ' '
36 ifeq ($(BUILD_MODE
), release
)
37 CARGO_BUILD_ARGS
+= --release
38 COMPILEDIR
:= target
/release
40 COMPILEDIR
:= target
/debug
43 ifeq ($(valgrind
), yes
)
44 CARGO_BUILD_ARGS
+= --features valgrind
50 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
) $(RESTORE_BIN
))
52 export DEB_VERSION DEB_VERSION_UPSTREAM
54 SERVER_DEB
=${PACKAGE}-server_
${DEB_VERSION}_
${ARCH}.deb
55 SERVER_DBG_DEB
=${PACKAGE}-server-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
56 CLIENT_DEB
=${PACKAGE}-client_
${DEB_VERSION}_
${ARCH}.deb
57 CLIENT_DBG_DEB
=${PACKAGE}-client-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
58 RESTORE_DEB
=proxmox-backup-file-restore_
${DEB_VERSION}_
${ARCH}.deb
59 RESTORE_DBG_DEB
=proxmox-backup-file-restore-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
60 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
62 DEBS
=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
63 ${RESTORE_DEB} ${RESTORE_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB}
65 DSC
= rust-
${PACKAGE}_
${DEB_VERSION}.dsc
78 #cargo test test_broadcast_future
79 #cargo test $(CARGO_BUILD_ARGS)
80 $(CARGO
) test $(tests
) $(CARGO_BUILD_ARGS
)
83 $(CARGO
) doc
--workspace
--no-deps
$(CARGO_BUILD_ARGS
)
85 # always re-create this dir
93 docs etc examples tests www zsh-completions \
96 rm -f build
/Cargo.lock
97 find build
/debian
-name
"*.hint" -delete
98 $(foreach i
,$(SUBDIRS
), \
99 $(MAKE
) -C build
/$(i
) clean ;)
102 .PHONY
: proxmox-backup-docs
103 $(DOC_DEB
) $(DEBS
): proxmox-backup-docs
104 proxmox-backup-docs
: build
105 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
108 # copy the local target/ dir as a build-cache
112 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
117 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
118 lintian
$(DEBS
) $(DOC_DEB
)
123 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
126 .PHONY
: clean distclean deb
clean
129 $(foreach i
,$(SUBDIRS
), \
130 $(MAKE
) -C
$(i
) clean ;)
132 rm -f .do-cargo-build
133 find .
-name
'*~' -exec
rm {} ';'
135 # allows one to avoid running cargo clean when one just wants to tidy up after a packgae build
137 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
/
140 dinstall
: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
141 ${DEBUG_DEB} ${DEBUG_DBG_DEB}
144 # make sure we build binaries before docs
145 docs
: $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
149 rm -f .do-cargo-build
150 $(MAKE
) $(COMPILED_BINS
)
152 $(COMPILED_BINS
) $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
: .do-cargo-build
154 $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
155 --package proxmox-backup-banner \
156 --bin proxmox-backup-banner \
157 --package proxmox-backup-client \
158 --bin proxmox-backup-client \
159 --bin dump-catalog-shell-cli \
160 --bin proxmox-backup-debug \
161 --package proxmox-file-restore \
162 --bin proxmox-file-restore \
168 --package proxmox-restore-daemon \
169 --bin proxmox-restore-daemon \
170 --package proxmox-backup \
172 --bin proxmox-backup-api \
173 --bin proxmox-backup-manager \
174 --bin proxmox-backup-proxy \
175 --bin proxmox-daily-update \
176 --bin proxmox-file-restore \
184 cargo clippy
-- -A clippy
::all -D clippy
::correctness
186 install: $(COMPILED_BINS
)
187 install -dm755
$(DESTDIR
)$(BINDIR
)
188 install -dm755
$(DESTDIR
)$(ZSH_COMPL_DEST
)
189 $(foreach i
,$(USR_BIN
), \
190 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ; \
191 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
192 install -dm755
$(DESTDIR
)$(SBINDIR
)
193 $(foreach i
,$(USR_SBIN
), \
194 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ; \
195 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
196 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
197 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
198 $(foreach i
,$(RESTORE_BIN
), \
199 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
/ ;)
200 # install sg-tape-cmd as setuid binary
201 install -m4755
-o root
-g root
$(COMPILEDIR
)/sg-tape-cmd
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/sg-tape-cmd
202 $(foreach i
,$(SERVICE_BIN
), \
203 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
204 $(MAKE
) -C www
install
205 $(MAKE
) -C docs
install
208 upload
: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB} ${DEBUG_DEB}
209 # check if working directory is clean
210 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
211 tar cf
- ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} ${CLIENT_DEB} \
212 ${CLIENT_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB} \
213 | ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist bullseye
214 tar cf
- ${CLIENT_DEB} ${CLIENT_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve,pmg,pbs-client" --dist bullseye
215 tar cf
- ${RESTORE_DEB} ${RESTORE_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve" --dist bullseye