]> git.proxmox.com Git - pve-cluster.git/blob - Makefile
d/control: avoid versioned build-dependcies with a -1 Debian revisions
[pve-cluster.git] / Makefile
1 include /usr/share/dpkg/default.mk
2
3 PACKAGE=pve-cluster
4 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
5 DSC=$(PACKAGE)_$(DEB_VERSION).dsc
6
7 GITVERSION:=$(shell git rev-parse HEAD)
8
9 DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb
10 LIB_DEB = libpve-cluster-perl_$(DEB_VERSION)_all.deb
11 LIB_DEB += libpve-cluster-api-perl_$(DEB_VERSION)_all.deb
12 DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_BUILD_ARCH).deb
13
14 DEBS = $(DEB) $(DBG_DEB) $(LIB_DEB)
15
16 PERL_APIVER := `perl -MConfig -e 'print $$Config(debian_abi)//$$Config(version);'`
17
18 all: $(DEB) $(DBG_DEB)
19
20 cpgtest: cpgtest.c
21 gcc -Wall cpgtest.c $(shell pkg-config --cflags --libs libcpg libqb) -o cpgtest
22
23 $(BUILDDIR):
24 rm -rf $@ $@.tmp
25 cp -a data $@.tmp
26 cp -a debian $@.tmp/
27 echo "git clone git://git.proxmox.com/git/pve-cluster.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
28 mv $@.tmp $@
29
30 dsc: $(DSC)
31 $(DSC): $(BUILDDIR)
32 cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
33 lintian $(DSC)
34
35 .PHONY: deb
36 deb $(DBG_DEB) $(LIB_DEB): $(DEB)
37 $(DEB): $(BUILDDIR)
38 cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
39 lintian $(DEB)
40
41 .PHONY: dinstall
42 dinstall: $(DEB) $(LIB_DEB)
43 dpkg -i $^
44
45 .PHONY: upload
46 upload: $(DEBS)
47 tar cf - $(DEBS) | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye --arch $(DEB_BUILD_ARCH)
48
49 .PHONY: clean
50 clean:
51 rm -rf $(PACKAGE)-[0-9]*/ *.deb *.dsc *.changes *.buildinfo *.build *.tar.*