]>
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 | |
71e42fc1 TL |
8 | DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb |
9 | DSC=rust-$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc | |
839951d6 | 10 | |
e029c60d WB |
11 | ifeq ($(BUILD_MODE), release) |
12 | CARGO_BUILD_ARGS += --release | |
13 | COMPILEDIR := target/release | |
14 | else | |
15 | COMPILEDIR := target/debug | |
16 | endif | |
839951d6 | 17 | |
e029c60d WB |
18 | all: cargo-build $(SUBDIRS) |
19 | ||
20 | .PHONY: cargo-build | |
21 | cargo-build: | |
22 | cargo build $(CARGO_BUILD_ARGS) | |
23 | ||
24 | .PHONY: build | |
25 | build: | |
26 | rm -rf build | |
ea087800 | 27 | rm -rf debian/control |
e029c60d WB |
28 | debcargo package \ |
29 | --config debian/debcargo.toml \ | |
30 | --changelog-ready \ | |
31 | --no-overlay-write-back \ | |
32 | --directory build \ | |
33 | $(PACKAGE) \ | |
34 | $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//') | |
35 | rm build/Cargo.lock | |
36 | find build/debian -name "*.hint" -delete | |
ea087800 | 37 | cp build/debian/control debian/control |
839951d6 | 38 | |
61b8223f | 39 | .PHONY: deb |
e029c60d WB |
40 | deb: $(DEB) |
41 | $(DEB): build | |
42 | cd build; dpkg-buildpackage -b -us -uc --no-pre-clean --build-profiles=nodoc | |
43 | lintian $(DEB) | |
61b8223f | 44 | |
e5f30e2e | 45 | .PHONY: dsc |
e029c60d WB |
46 | dsc: $(DSC) |
47 | $(DSC): build | |
48 | cd build; dpkg-buildpackage -S -us -uc -d -nc | |
49 | lintian $(DSC) | |
e5f30e2e | 50 | |
61b8223f | 51 | .PHONY: dinstall |
71e42fc1 TL |
52 | dinstall: $(DEB) |
53 | dpkg -i $(DEB) | |
61b8223f DM |
54 | |
55 | .PHONY: upload | |
71e42fc1 TL |
56 | upload: $(DEB) $(DBG_DEB) |
57 | tar cf - $(DEB) $(DBG_DEB)| ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist bullseye --arch $(DEB_BUILD_ARCH) | |
839951d6 | 58 | |
c41a37e8 DM |
59 | .PHONY: distclean |
60 | distclean: clean | |
839951d6 | 61 | |
c41a37e8 DM |
62 | .PHONY: clean |
63 | clean: | |
71e42fc1 | 64 | rm -rf *.deb $(PACKAGE)-* *.buildinfo *.changes *.dsc rust-$(PACKAGE)_*.tar.?z build/ |
c41a37e8 | 65 | find . -name '*~' -exec rm {} ';' |