]>
Commit | Line | Data |
---|---|---|
5bf8ddec FE |
1 | include /usr/share/dpkg/pkg-info.mk |
2 | include /usr/share/dpkg/architecture.mk | |
3 | ||
4 | PACKAGE=proxmox-apt | |
5 | BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) | |
6 | BUILDDIR_TMP ?= $(BUILDDIR).tmp | |
7 | ||
8 | DEB=librust-$(PACKAGE)-dev_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb | |
9 | DSC=rust-$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc | |
10 | ||
11 | ifeq ($(BUILD_MODE), release) | |
12 | CARGO_BUILD_ARGS += --release | |
13 | COMPILEDIR := target/release | |
14 | else | |
15 | COMPILEDIR := target/debug | |
16 | endif | |
17 | ||
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 $(BUILDDIR) $(BUILDDIR_TMP); mkdir $(BUILDDIR_TMP) | |
27 | rm -f debian/control | |
28 | debcargo package \ | |
29 | --config debian/debcargo.toml \ | |
30 | --changelog-ready \ | |
31 | --no-overlay-write-back \ | |
32 | --directory $(BUILDDIR_TMP) \ | |
33 | $(PACKAGE) \ | |
34 | $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//') | |
35 | cp $(BUILDDIR_TMP)/debian/control debian/control | |
36 | rm -f $(BUILDDIR_TMP)/Cargo.lock | |
37 | find $(BUILDDIR_TMP)/debian -name "*.hint" -delete | |
38 | mv $(BUILDDIR_TMP) $(BUILDDIR) | |
39 | ||
40 | .PHONY: deb | |
41 | deb: $(DEB) | |
42 | $(DEB): build | |
43 | cd $(BUILDDIR); dpkg-buildpackage -b -us -uc --no-pre-clean | |
44 | lintian $(DEB) | |
45 | ||
46 | .PHONY: dsc | |
47 | dsc: $(DSC) | |
48 | $(DSC): build | |
49 | cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d -nc | |
50 | lintian $(DSC) | |
51 | ||
52 | .PHONY: dinstall | |
53 | dinstall: $(DEB) | |
54 | dpkg -i $(DEB) | |
55 | ||
56 | .PHONY: upload | |
57 | upload: $(DEB) $(DBG_DEB) | |
58 | tar cf - $(DEB) $(DBG_DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pbs,pmg,pve --dist buster --arch $(DEB_BUILD_ARCH) | |
59 | ||
60 | .PHONY: distclean | |
61 | distclean: clean | |
62 | ||
63 | .PHONY: clean | |
64 | clean: | |
65 | cargo clean | |
66 | rm -rf *.deb *.buildinfo *.changes *.dsc rust-$(PACKAGE)_*.tar.?z $(BUILDDIR) $(BUILDDIR_TMP) | |
67 | find . -name '*~' -exec rm {} ';' |