]> git.proxmox.com Git - pmg-log-tracker.git/blame - Makefile
buildsys: re-add reference to GITVERSION
[pmg-log-tracker.git] / Makefile
CommitLineData
e5f30e2e
TL
1include /usr/share/dpkg/pkg-info.mk
2include /usr/share/dpkg/architecture.mk
61b8223f 3
e5f30e2e 4PACKAGE=pmg-log-tracker
61b8223f 5
e5f30e2e 6GITVERSION:=$(shell git rev-parse HEAD)
61b8223f 7
1bd70412
SI
8DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb
9DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb
10DSC=rust-$(PACKAGE)_$(DEB_VERSION).dsc
839951d6 11
e029c60d
WB
12ifeq ($(BUILD_MODE), release)
13CARGO_BUILD_ARGS += --release
14COMPILEDIR := target/release
15else
16COMPILEDIR := target/debug
17endif
839951d6 18
e029c60d
WB
19all: cargo-build $(SUBDIRS)
20
21.PHONY: cargo-build
22cargo-build:
23 cargo build $(CARGO_BUILD_ARGS)
24
25.PHONY: build
26build:
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 42deb: $(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 48dsc: $(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
56sbuild: $(DSC)
57 sbuild $(DSC)
e5f30e2e 58
61b8223f 59.PHONY: dinstall
71e42fc1
TL
60dinstall: $(DEB)
61 dpkg -i $(DEB)
61b8223f
DM
62
63.PHONY: upload
71e42fc1
TL
64upload: $(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
68distclean: clean
839951d6 69
c41a37e8
DM
70.PHONY: clean
71clean:
5ed9f5ca 72 rm -rf *.deb $(PACKAGE)-* *.buildinfo *.changes *.dsc rust-$(PACKAGE)_*.tar.?z build/ *build
c41a37e8 73 find . -name '*~' -exec rm {} ';'