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
44 proxmox-backup-banner \
45 proxmox-backup-client \
46 proxmox-backup-debug \
47 proxmox-file-restore \
50 ifeq ($(BUILD_MODE
), release
)
51 CARGO_BUILD_ARGS
+= --release
52 COMPILEDIR
:= target
/release
54 COMPILEDIR
:= target
/debug
57 ifeq ($(valgrind
), yes
)
58 CARGO_BUILD_ARGS
+= --features valgrind
64 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
) $(RESTORE_BIN
))
66 export DEB_VERSION DEB_VERSION_UPSTREAM
68 SERVER_DEB
=${PACKAGE}-server_
${DEB_VERSION}_
${ARCH}.deb
69 SERVER_DBG_DEB
=${PACKAGE}-server-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
70 CLIENT_DEB
=${PACKAGE}-client_
${DEB_VERSION}_
${ARCH}.deb
71 CLIENT_DBG_DEB
=${PACKAGE}-client-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
72 RESTORE_DEB
=proxmox-backup-file-restore_
${DEB_VERSION}_
${ARCH}.deb
73 RESTORE_DBG_DEB
=proxmox-backup-file-restore-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
74 DEBUG_DEB
=${PACKAGE}-debug_
${DEB_VERSION}_
${ARCH}.deb
75 DEBUG_DBG_DEB
=${PACKAGE}-debug-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
76 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
78 DEBS
=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
79 ${RESTORE_DEB} ${RESTORE_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB}
81 DSC
= rust-
${PACKAGE}_
${DEB_VERSION}.dsc
94 #cargo test test_broadcast_future
95 #cargo test $(CARGO_BUILD_ARGS)
96 $(CARGO
) test $(tests
) $(CARGO_BUILD_ARGS
)
99 $(CARGO
) doc
--workspace
--no-deps
$(CARGO_BUILD_ARGS
)
101 # always re-create this dir
109 docs etc examples tests www zsh-completions \
110 defines.mk Makefile \
112 rm -f build
/Cargo.lock
113 find build
/debian
-name
"*.hint" -delete
114 $(foreach i
,$(SUBDIRS
), \
115 $(MAKE
) -C build
/$(i
) clean ;)
118 .PHONY
: proxmox-backup-docs
119 $(DOC_DEB
) $(DEBS
): proxmox-backup-docs
120 proxmox-backup-docs
: build
121 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
124 # copy the local target/ dir as a build-cache
128 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
133 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
134 lintian
$(DEBS
) $(DOC_DEB
)
139 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
142 .PHONY
: clean distclean deb
clean
145 $(foreach i
,$(SUBDIRS
), \
146 $(MAKE
) -C
$(i
) clean ;)
148 rm -f .do-cargo-build
149 find .
-name
'*~' -exec
rm {} ';'
151 # allows one to avoid running cargo clean when one just wants to tidy up after a packgae build
153 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
/
156 dinstall
: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
157 ${DEBUG_DEB} ${DEBUG_DBG_DEB}
160 # make sure we build binaries before docs
161 docs
: $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
165 rm -f .do-cargo-build
166 $(MAKE
) $(COMPILED_BINS
)
168 $(COMPILED_BINS
) $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
: .do-cargo-build
170 RUSTFLAGS
="--cfg openid" $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
171 --bin proxmox-backup-api \
172 --bin proxmox-backup-proxy \
173 --bin proxmox-backup-manager \
175 $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
176 --package proxmox-backup-banner \
177 --bin proxmox-backup-banner \
178 --package proxmox-backup-client \
179 --bin proxmox-backup-client \
180 --package proxmox-backup-debug \
181 --bin proxmox-backup-debug \
182 --package proxmox-file-restore \
183 --bin proxmox-file-restore \
186 --package proxmox-backup \
187 --bin dump-catalog-shell-cli \
188 --bin pmt
--bin pmtx \
189 --bin proxmox-daily-update \
190 --bin proxmox-file-restore \
191 --bin proxmox-restore-daemon \
200 cargo clippy
-- -A clippy
::all -D clippy
::correctness
202 install: $(COMPILED_BINS
)
203 install -dm755
$(DESTDIR
)$(BINDIR
)
204 install -dm755
$(DESTDIR
)$(ZSH_COMPL_DEST
)
205 $(foreach i
,$(USR_BIN
), \
206 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ; \
207 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
208 install -dm755
$(DESTDIR
)$(SBINDIR
)
209 $(foreach i
,$(USR_SBIN
), \
210 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ; \
211 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
212 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
213 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
214 $(foreach i
,$(RESTORE_BIN
), \
215 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
/ ;)
216 # install sg-tape-cmd as setuid binary
217 install -m4755
-o root
-g root
$(COMPILEDIR
)/sg-tape-cmd
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/sg-tape-cmd
218 $(foreach i
,$(SERVICE_BIN
), \
219 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
220 $(MAKE
) -C www
install
221 $(MAKE
) -C docs
install
222 ifeq (,$(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
223 $(MAKE
) test # HACK, only test now to avoid clobbering build files with wrong config
227 upload
: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB} ${DEBUG_DEB}
228 # check if working directory is clean
229 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
230 tar cf
- ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} ${CLIENT_DEB} \
231 ${CLIENT_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB} \
232 | ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist bullseye
233 tar cf
- ${CLIENT_DEB} ${CLIENT_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve,pmg,pbs-client" --dist bullseye
234 tar cf
- ${RESTORE_DEB} ${RESTORE_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve" --dist bullseye