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-file-restore \
47 proxmox-restore-daemon \
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 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
76 DEBS
=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
77 ${RESTORE_DEB} ${RESTORE_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB}
79 DSC
= rust-
${PACKAGE}_
${DEB_VERSION}.dsc
92 #cargo test test_broadcast_future
93 #cargo test $(CARGO_BUILD_ARGS)
94 $(CARGO
) test $(tests
) $(CARGO_BUILD_ARGS
)
97 $(CARGO
) doc
--workspace
--no-deps
$(CARGO_BUILD_ARGS
)
99 # always re-create this dir
102 @echo
"Setting pkg-buildcfg version to: $(DEB_VERSION_UPSTREAM)"
103 sed
-i
-e
's/^version =.*$$/version = "$(DEB_VERSION_UPSTREAM)"/' \
104 pbs-buildcfg
/Cargo.toml
110 docs etc examples tests www zsh-completions \
111 defines.mk Makefile \
113 rm -f build
/Cargo.lock
114 find build
/debian
-name
"*.hint" -delete
115 $(foreach i
,$(SUBDIRS
), \
116 $(MAKE
) -C build
/$(i
) clean ;)
119 .PHONY
: proxmox-backup-docs
120 $(DOC_DEB
) $(DEBS
): proxmox-backup-docs
121 proxmox-backup-docs
: build
122 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
125 # copy the local target/ dir as a build-cache
129 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
134 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
135 lintian
$(DEBS
) $(DOC_DEB
)
140 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
143 .PHONY
: clean distclean deb
clean
146 $(foreach i
,$(SUBDIRS
), \
147 $(MAKE
) -C
$(i
) clean ;)
149 rm -f .do-cargo-build
150 find .
-name
'*~' -exec
rm {} ';'
152 # allows one to avoid running cargo clean when one just wants to tidy up after a packgae build
154 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
/
157 dinstall
: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
158 ${DEBUG_DEB} ${DEBUG_DBG_DEB}
161 # make sure we build binaries before docs
162 docs
: $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
166 rm -f .do-cargo-build
167 $(MAKE
) $(COMPILED_BINS
)
169 $(COMPILED_BINS
) $(COMPILEDIR
)/dump-catalog-shell-cli
$(COMPILEDIR
)/docgen
: .do-cargo-build
171 $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
172 --package proxmox-backup-banner \
173 --bin proxmox-backup-banner \
174 --package proxmox-backup-client \
175 --bin proxmox-backup-client \
176 --bin dump-catalog-shell-cli \
177 --bin proxmox-backup-debug \
178 --package proxmox-file-restore \
179 --bin proxmox-file-restore \
185 --package proxmox-restore-daemon \
186 --bin proxmox-restore-daemon \
187 --package proxmox-backup \
189 --bin proxmox-backup-api \
190 --bin proxmox-backup-manager \
191 --bin proxmox-backup-proxy \
192 --bin proxmox-daily-update \
193 --bin proxmox-file-restore \
201 cargo clippy
-- -A clippy
::all -D clippy
::correctness
203 install: $(COMPILED_BINS
)
204 install -dm755
$(DESTDIR
)$(BINDIR
)
205 install -dm755
$(DESTDIR
)$(ZSH_COMPL_DEST
)
206 $(foreach i
,$(USR_BIN
), \
207 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ; \
208 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
209 install -dm755
$(DESTDIR
)$(SBINDIR
)
210 $(foreach i
,$(USR_SBIN
), \
211 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ; \
212 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
213 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
214 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
215 $(foreach i
,$(RESTORE_BIN
), \
216 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
/ ;)
217 # install sg-tape-cmd as setuid binary
218 install -m4755
-o root
-g root
$(COMPILEDIR
)/sg-tape-cmd
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/sg-tape-cmd
219 $(foreach i
,$(SERVICE_BIN
), \
220 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
221 $(MAKE
) -C www
install
222 $(MAKE
) -C docs
install
225 upload
: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB} ${DEBUG_DEB}
226 # check if working directory is clean
227 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
228 tar cf
- ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} ${CLIENT_DEB} \
229 ${CLIENT_DBG_DEB} ${DEBUG_DEB} ${DEBUG_DBG_DEB} \
230 | ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist bullseye
231 tar cf
- ${CLIENT_DEB} ${CLIENT_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve,pmg,pbs-client" --dist bullseye
232 tar cf
- ${RESTORE_DEB} ${RESTORE_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve" --dist bullseye