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 \
14 # Binaries usable by admins
16 proxmox-backup-manager
18 # Binaries for services:
21 proxmox-backup-banner \
24 ifeq ($(BUILD_MODE
), release
)
25 CARGO_BUILD_ARGS
+= --release
26 COMPILEDIR
:= target
/release
28 COMPILEDIR
:= target
/debug
31 ifeq ($(valgrind
), yes
)
32 CARGO_BUILD_ARGS
+= --features valgrind
38 $(addprefix $(COMPILEDIR
)/,$(USR_BIN
) $(USR_SBIN
) $(SERVICE_BIN
))
40 export DEB_VERSION DEB_VERSION_UPSTREAM
42 SERVER_DEB
=${PACKAGE}-server_
${DEB_VERSION}_
${ARCH}.deb
43 SERVER_DBG_DEB
=${PACKAGE}-server-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
44 CLIENT_DEB
=${PACKAGE}-client_
${DEB_VERSION}_
${ARCH}.deb
45 CLIENT_DBG_DEB
=${PACKAGE}-client-dbgsym_
${DEB_VERSION}_
${ARCH}.deb
46 DOC_DEB
=${PACKAGE}-docs_
${DEB_VERSION}_all.deb
48 DEBS
=${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB}
50 DSC
= rust-
${PACKAGE}_
${DEB_VERSION}.dsc
54 all: cargo-build
$(SUBDIRS
)
61 #cargo test test_broadcast_future
62 #cargo test $(CARGO_BUILD_ARGS)
63 #$(CARGO) test $(tests) $(CARGO_BUILD_ARGS)
66 $(CARGO
) doc
--no-deps
$(CARGO_BUILD_ARGS
)
68 # always re-create this dir
72 debcargo package
--config debian
/debcargo.toml
--changelog-ready
--no-overlay-write-back
--directory build proxmox-backup
$(shell dpkg-parsechangelog
-l debian
/changelog
-SVersion | sed
-e
's/-.*//')
73 sed
-e
'1,/^$$/ ! d' build
/debian
/control
> build
/debian
/control.src
74 cat build
/debian
/control.src build
/debian
/control.in
> build
/debian
/control
75 rm build
/debian
/control.in build
/debian
/control.src
77 find build
/debian
-name
"*.hint" -delete
78 $(foreach i
,$(SUBDIRS
), \
79 $(MAKE
) -C build
/$(i
) clean ;)
82 .PHONY
: proxmox-backup-docs
83 proxmox-backup-docs
: $(DOC_DEB
)
85 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
88 # copy the local target/ dir as a build-cache
92 cd build
; dpkg-buildpackage
-b
-us
-uc
--no-pre-clean
--build-profiles
=nodoc
98 cd build
; dpkg-buildpackage
-S
-us
-uc
-d
-nc
104 $(foreach i
,$(SUBDIRS
), \
105 $(MAKE
) -C
$(i
) clean ;)
107 rm -rf
*.deb
*.dsc
*.
tar.gz
*.buildinfo
*.changes build
108 find .
-name
'*~' -exec
rm {} ';'
114 # make sure we build binaries before docs
119 $(CARGO
) build
$(CARGO_BUILD_ARGS
)
121 $(COMPILED_BINS
): cargo-build
125 cargo clippy
-- -A clippy
::all -D clippy
::correctness
127 install: $(COMPILED_BINS
)
128 install -dm755
$(DESTDIR
)$(BINDIR
)
129 install -dm755
$(DESTDIR
)$(ZSH_COMPL_DEST
)
130 $(foreach i
,$(USR_BIN
), \
131 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ; \
132 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
133 install -dm755
$(DESTDIR
)$(SBINDIR
)
134 $(foreach i
,$(USR_SBIN
), \
135 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(SBINDIR
)/ ; \
136 install -m644 zsh-completions
/_
$(i
) $(DESTDIR
)$(ZSH_COMPL_DEST
)/ ;)
137 install -dm755
$(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
138 $(foreach i
,$(SERVICE_BIN
), \
139 install -m755
$(COMPILEDIR
)/$(i
) $(DESTDIR
)$(LIBEXECDIR
)/proxmox-backup
/ ;)
140 $(MAKE
) -C www
install
141 $(MAKE
) -C docs
install
144 upload
: ${SERVER_DEB} ${CLIENT_DEB} ${DOC_DEB}
145 # check if working directory is clean
146 git diff
--exit-code
--stat
&& git diff
--exit-code
--stat
--staged
147 tar cf
- ${SERVER_DEB} ${SERVER_DBG_DEB} ${DOC_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product pbs
--dist buster
148 tar cf
- ${CLIENT_DEB} ${CLIENT_DBG_DEB} | ssh
-X repoman@repo.proxmox.com upload
--product
"pbs,pve" --dist buster