]>
Commit | Line | Data |
---|---|---|
e5f30e2e TL |
1 | include /usr/share/dpkg/pkg-info.mk |
2 | include /usr/share/dpkg/architecture.mk | |
61b8223f | 3 | |
e5f30e2e | 4 | PACKAGE=pmg-log-tracker |
61b8223f | 5 | |
e5f30e2e | 6 | GITVERSION:=$(shell git rev-parse HEAD) |
61b8223f | 7 | |
1bd70412 SI |
8 | DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb |
9 | DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb | |
10 | DSC=rust-$(PACKAGE)_$(DEB_VERSION).dsc | |
839951d6 | 11 | |
e029c60d WB |
12 | ifeq ($(BUILD_MODE), release) |
13 | CARGO_BUILD_ARGS += --release | |
14 | COMPILEDIR := target/release | |
15 | else | |
16 | COMPILEDIR := target/debug | |
17 | endif | |
839951d6 | 18 | |
e029c60d WB |
19 | all: cargo-build $(SUBDIRS) |
20 | ||
21 | .PHONY: cargo-build | |
22 | cargo-build: | |
23 | cargo build $(CARGO_BUILD_ARGS) | |
24 | ||
25 | .PHONY: build | |
26 | build: | |
27 | rm -rf build | |
ea087800 | 28 | rm -rf debian/control |
e029c60d WB |
29 | debcargo package \ |
30 | --config debian/debcargo.toml \ | |
31 | --changelog-ready \ | |
32 | --no-overlay-write-back \ | |
33 | --directory build \ | |
34 | $(PACKAGE) \ | |
35 | $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//') | |
36 | rm build/Cargo.lock | |
37 | find build/debian -name "*.hint" -delete | |
ea087800 | 38 | cp build/debian/control debian/control |
f6ca4f64 | 39 | echo "git clone git://git.proxmox.com/git/pmg-log-tracker.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE |
839951d6 | 40 | |
61b8223f | 41 | .PHONY: deb |
e029c60d | 42 | deb: $(DEB) |
cc80c54d | 43 | $(DEB) $(DBG_DEB): build |
e029c60d WB |
44 | cd build; dpkg-buildpackage -b -us -uc --no-pre-clean --build-profiles=nodoc |
45 | lintian $(DEB) | |
61b8223f | 46 | |
e5f30e2e | 47 | .PHONY: dsc |
e029c60d | 48 | dsc: $(DSC) |
5ed9f5ca SI |
49 | $(MAKE) $(DSC) |
50 | lintian $(DSC) | |
51 | ||
e029c60d WB |
52 | $(DSC): build |
53 | cd build; dpkg-buildpackage -S -us -uc -d -nc | |
5ed9f5ca SI |
54 | |
55 | .PHONY: sbuild | |
56 | sbuild: $(DSC) | |
57 | sbuild $(DSC) | |
e5f30e2e | 58 | |
61b8223f | 59 | .PHONY: dinstall |
71e42fc1 TL |
60 | dinstall: $(DEB) |
61 | dpkg -i $(DEB) | |
61b8223f DM |
62 | |
63 | .PHONY: upload | |
71e42fc1 TL |
64 | upload: $(DEB) $(DBG_DEB) |
65 | tar cf - $(DEB) $(DBG_DEB)| ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist bullseye --arch $(DEB_BUILD_ARCH) | |
839951d6 | 66 | |
c41a37e8 DM |
67 | .PHONY: distclean |
68 | distclean: clean | |
839951d6 | 69 | |
c41a37e8 DM |
70 | .PHONY: clean |
71 | clean: | |
5ed9f5ca | 72 | rm -rf *.deb $(PACKAGE)-* *.buildinfo *.changes *.dsc rust-$(PACKAGE)_*.tar.?z build/ *build |
c41a37e8 | 73 | find . -name '*~' -exec rm {} ';' |