]>
Commit | Line | Data |
---|---|---|
cadc7457 FE |
1 | include /usr/share/dpkg/pkg-info.mk |
2 | include /usr/share/dpkg/architecture.mk | |
3 | ||
4 | PACKAGE=proxmox-mail-forward | |
5656d257 | 5 | BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION) |
cadc7457 | 6 | |
231e6a6e TL |
7 | DSC=rust-$(PACKAGE)_$(DEB_VERSION_UPSTREAM).dsc |
8 | DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
9 | DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb | |
10 | ||
11 | DEBS=$(DEB) $(DBG_DEB) | |
12 | ||
cadc7457 FE |
13 | ifeq ($(BUILD_MODE), release) |
14 | CARGO_BUILD_ARGS += --release | |
15 | COMPILEDIR := target/release | |
16 | else | |
17 | COMPILEDIR := target/debug | |
18 | endif | |
19 | ||
20 | CARGO ?= cargo | |
21 | ||
5656d257 TL |
22 | $(BUILDDIR): |
23 | rm -rf $@ $@.tmp && mkdir $@.tmp | |
24 | cp -a debian Cargo.toml src Makefile .cargo $@.tmp | |
25 | rm -f $@.tmp/Cargo.lock | |
26 | find $@.tmp/debian -name "*.hint" -delete | |
27 | mv $@.tmp $@ | |
cadc7457 | 28 | |
fdd03d33 | 29 | .PHONY: deb dsc |
cadc7457 | 30 | $(DEBS): deb |
5656d257 | 31 | deb: $(BUILDDIR) |
48d85aea | 32 | cd $(BUILDDIR); dpkg-buildpackage -b -us -uc |
cadc7457 FE |
33 | lintian $(DEBS) |
34 | ||
fdd03d33 TL |
35 | dsc: clean |
36 | $(MAKE) $(DSC) | |
37 | lintian $(DSC) | |
38 | ||
5656d257 | 39 | $(DSC): $(BUILDDIR) |
48d85aea | 40 | cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d |
fdd03d33 TL |
41 | |
42 | sbuild: $(DSC) | |
43 | sbuild $< | |
cadc7457 FE |
44 | |
45 | .PHONY: dinstall | |
46 | dinstall: $(DEBS) | |
47 | dpkg -i $(DEBS) | |
48 | ||
49 | .PHONY: cargo-build | |
50 | cargo-build: | |
51 | $(CARGO) build $(CARGO_BUILD_ARGS) \ | |
52 | --package proxmox-mail-forward \ | |
53 | --bin proxmox-mail-forward | |
54 | ||
55 | install: cargo-build | |
56 | install -dm755 $(DESTDIR)/usr/bin | |
57 | install -m4755 -o root -g root $(COMPILEDIR)/proxmox-mail-forward $(DESTDIR)/usr/bin/proxmox-mail-forward | |
58 | ||
59 | .PHONY: upload | |
60 | upload: $(DEBS) | |
401b9e98 | 61 | tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com -- upload --product "pve,pbs" --dist $(DEB_DISTRIBUTION) --arch $(DEB_HOST_ARCH) |
cadc7457 FE |
62 | |
63 | .PHONY: distclean | |
64 | distclean: clean | |
65 | ||
66 | .PHONY: clean | |
67 | clean: | |
68 | cargo clean | |
fdd03d33 | 69 | rm -rf *.deb *.dsc *.buildinfo *.changes *.build rust-$(PACKAGE)*.tar.* $(PACKAGE)-[0-9]*/ |
cadc7457 | 70 | find . -name '*~' -exec rm {} ';' |