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
43 proxmox-backup-banner \
44 proxmox-backup-client \
47 ifeq ($(BUILD_MODE
), release
)
48 CARGO_BUILD_ARGS
+= --release
49 COMPILEDIR
:= target
/release
51 COMPILEDIR
:= target
/debug
54 ifeq ($(valgrind
), yes
)
55 CARGO_BUILD_ARGS
+= --features valgrind
61 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
) $(RESTORE_BIN
))
63 export DEB_VERSION DEB_VERSION_UPSTREAM
65 SERVER_DEB
=${PACKAGE}-server_
${DEB_VERSION}_
${ARCH}.deb
66 SERVER_DBG_DEB
=${PACKAGE}-server-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
67 CLIENT_DEB
=${PACKAGE}-client_
${DEB_VERSION}_
${ARCH}.deb
68 CLIENT_DBG_DEB
=${PACKAGE}-client-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
69 RESTORE_DEB
=proxmox-backup-file-restore_
${DEB_VERSION}_
${ARCH}.deb
70 RESTORE_DBG_DEB
=proxmox-backup-file-restore-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
71 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
73 DEBS
=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
74 ${RESTORE_DEB} ${RESTORE_DBG_DEB}
76 DSC
= rust-
${PACKAGE}_
${DEB_VERSION}.dsc
89 #cargo test test_broadcast_future
90 #cargo test $(CARGO_BUILD_ARGS)
91 $(CARGO
) test $(tests
) $(CARGO_BUILD_ARGS
)
94 $(CARGO
) doc
--workspace
--no-deps
$(CARGO_BUILD_ARGS
)
96 # always re-create this dir
104 docs etc examples tests www zsh-completions \
105 defines.mk Makefile \
107 rm -f build
/Cargo.lock
108 find build
/debian
-name
"*.hint" -delete
109 $(foreach i
,$(SUBDIRS
), \
110 $(MAKE
) -C build
/$(i
) clean ;)
113 .PHONY
: proxmox-backup-docs
114 $(DOC_DEB
) $(DEBS
): proxmox-backup-docs
115 proxmox-backup-docs
: build
116 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
119 # copy the local target/ dir as a build-cache
123 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
128 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
129 lintian
$(DEBS
) $(DOC_DEB
)
134 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
137 .PHONY
: clean distclean deb
clean
140 $(foreach i
,$(SUBDIRS
), \
141 $(MAKE
) -C
$(i
) clean ;)
143 rm -f .do-cargo-build
144 find .
-name
'*~' -exec
rm {} ';'
146 # allows one to avoid running cargo clean when one just wants to tidy up after a packgae build
148 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
/
151 dinstall
: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB}
154 # make sure we build binaries before docs
155 docs
: $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
159 rm -f .do-cargo-build
160 $(MAKE
) $(COMPILED_BINS
)
162 $(COMPILED_BINS
) $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
: .do-cargo-build
164 RUSTFLAGS
="--cfg openid" $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
165 --bin proxmox-backup-api \
166 --bin proxmox-backup-proxy \
167 --bin proxmox-backup-manager \
169 $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
170 --package proxmox-backup-banner \
171 --bin proxmox-backup-banner \
172 --package proxmox-backup-client \
173 --bin proxmox-backup-client \
176 --package proxmox-backup \
177 --bin dump-catalog-shell-cli \
178 --bin pmt
--bin pmtx \
179 --bin proxmox-daily-update \
180 --bin proxmox-file-restore \
181 --bin proxmox-restore-daemon \
190 cargo clippy
-- -A clippy
::all -D clippy
::correctness
192 install: $(COMPILED_BINS
)
193 install -dm755
$(DESTDIR
)$(BINDIR
)
194 install -dm755
$(DESTDIR
)$(ZSH_COMPL_DEST
)
195 $(foreach i
,$(USR_BIN
), \
196 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ; \
197 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
198 install -dm755
$(DESTDIR
)$(SBINDIR
)
199 $(foreach i
,$(USR_SBIN
), \
200 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ; \
201 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
202 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
203 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
204 $(foreach i
,$(RESTORE_BIN
), \
205 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
/ ;)
206 # install sg-tape-cmd as setuid binary
207 install -m4755
-o root
-g root
$(COMPILEDIR
)/sg-tape-cmd
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/sg-tape-cmd
208 $(foreach i
,$(SERVICE_BIN
), \
209 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
210 $(MAKE
) -C www
install
211 $(MAKE
) -C docs
install
212 ifeq (,$(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
213 $(MAKE
) test # HACK, only test now to avoid clobbering build files with wrong config
217 upload
: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB}
218 # check if working directory is clean
219 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
220 tar cf
- ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} | \
221 ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist bullseye
222 tar cf
- ${CLIENT_DEB} ${CLIENT_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve,pmg,pbs-client" --dist bullseye
223 tar cf
- ${RESTORE_DEB} ${RESTORE_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve" --dist bullseye