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
22 # Binaries for services:
25 proxmox-backup-banner \
26 proxmox-backup-proxy \
29 # Single file restore daemon
31 proxmox-restore-daemon
41 ifeq ($(BUILD_MODE
), release
)
42 CARGO_BUILD_ARGS
+= --release
43 COMPILEDIR
:= target
/release
45 COMPILEDIR
:= target
/debug
48 ifeq ($(valgrind
), yes
)
49 CARGO_BUILD_ARGS
+= --features valgrind
55 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
) $(RESTORE_BIN
))
57 export DEB_VERSION DEB_VERSION_UPSTREAM
59 SERVER_DEB
=${PACKAGE}-server_
${DEB_VERSION}_
${ARCH}.deb
60 SERVER_DBG_DEB
=${PACKAGE}-server-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
61 CLIENT_DEB
=${PACKAGE}-client_
${DEB_VERSION}_
${ARCH}.deb
62 CLIENT_DBG_DEB
=${PACKAGE}-client-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
63 RESTORE_DEB
=proxmox-backup-file-restore_
${DEB_VERSION}_
${ARCH}.deb
64 RESTORE_DBG_DEB
=proxmox-backup-file-restore-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
65 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
67 DEBS
=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} \
68 ${RESTORE_DEB} ${RESTORE_DBG_DEB}
70 DSC
= rust-
${PACKAGE}_
${DEB_VERSION}.dsc
76 all: cargo-build
$(SUBDIRS
)
83 #cargo test test_broadcast_future
84 #cargo test $(CARGO_BUILD_ARGS)
85 $(CARGO
) test $(tests
) $(CARGO_BUILD_ARGS
)
88 $(CARGO
) doc
--workspace
--no-deps
$(CARGO_BUILD_ARGS
)
90 # always re-create this dir
96 Cargo.toml build.rs src \
98 docs etc examples tests www zsh-completions \
101 rm -f build
/Cargo.lock
102 find build
/debian
-name
"*.hint" -delete
103 $(foreach i
,$(SUBDIRS
), \
104 $(MAKE
) -C build
/$(i
) clean ;)
107 .PHONY
: proxmox-backup-docs
108 $(DOC_DEB
) $(DEBS
): proxmox-backup-docs
109 proxmox-backup-docs
: build
110 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
113 # copy the local target/ dir as a build-cache
117 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
122 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
123 lintian
$(DEBS
) $(DOC_DEB
)
128 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
131 .PHONY
: clean distclean deb
clean
134 $(foreach i
,$(SUBDIRS
), \
135 $(MAKE
) -C
$(i
) clean ;)
137 find .
-name
'*~' -exec
rm {} ';'
139 # allows one to avoid running cargo clean when one just wants to tidy up after a packgae build
141 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
/
144 dinstall
: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB}
147 # make sure we build binaries before docs
152 RUSTFLAGS
="--cfg openid" $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
153 --bin proxmox-backup-api
--bin proxmox-backup-proxy \
154 --bin proxmox-backup-manager
--bin docgen
155 $(CARGO
) build
$(CARGO_BUILD_ARGS
) \
156 --bin dump-catalog-shell-cli \
157 --bin pmt
--bin pmtx \
158 --bin proxmox-backup-banner \
159 --bin proxmox-backup-client \
160 --bin proxmox-daily-update \
161 --bin proxmox-file-restore \
162 --bin proxmox-restore-daemon \
167 $(COMPILED_BINS
): cargo-build
171 cargo clippy
-- -A clippy
::all -D clippy
::correctness
173 install: $(COMPILED_BINS
)
174 install -dm755
$(DESTDIR
)$(BINDIR
)
175 install -dm755
$(DESTDIR
)$(ZSH_COMPL_DEST
)
176 $(foreach i
,$(USR_BIN
), \
177 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ; \
178 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
179 install -dm755
$(DESTDIR
)$(SBINDIR
)
180 $(foreach i
,$(USR_SBIN
), \
181 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ; \
182 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
183 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
184 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
185 $(foreach i
,$(RESTORE_BIN
), \
186 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/file-restore
/ ;)
187 # install sg-tape-cmd as setuid binary
188 install -m4755
-o root
-g root
$(COMPILEDIR
)/sg-tape-cmd
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/sg-tape-cmd
189 $(foreach i
,$(SERVICE_BIN
), \
190 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
191 $(MAKE
) -C www
install
192 $(MAKE
) -C docs
install
195 upload
: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB}
196 # check if working directory is clean
197 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
198 tar cf
- ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} | \
199 ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist bullseye
200 tar cf
- ${CLIENT_DEB} ${CLIENT_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve,pmg,pbs-client" --dist bullseye
201 tar cf
- ${RESTORE_DEB} ${RESTORE_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pve" --dist bullseye