]> git.proxmox.com Git - pve-common.git/blob - Makefile
buildsys: derive upload dist automatically
[pve-common.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=libpve-common-perl
4
5 ARCH=all
6
7 BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
8
9 DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${ARCH}.deb
10 DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
11
12 all:
13 ${MAKE} -C src
14
15 .PHONY: dinstall
16 dinstall: deb
17 dpkg -i ${DEB}
18
19 ${BUILDDIR}: src debian test
20 rm -rf ${BUILDDIR} ${BUILDDIR}.tmp; mkdir ${BUILDDIR}.tmp
21 cp -a -t ${BUILDDIR}.tmp $^ Makefile
22 echo "git clone git://git.proxmox.com/git/pve-common.git\\ngit checkout $(shell git rev-parse HEAD)" > ${BUILDDIR}.tmp/debian/SOURCE
23 mv ${BUILDDIR}.tmp ${BUILDDIR}
24
25 .PHONY: deb
26 deb: ${DEB}
27 ${DEB}: ${BUILDDIR}
28 cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
29 lintian ${DEB}
30
31 .PHONY: dsc
32 dsc: ${DSC}
33 ${DSC}: ${BUILDDIR}
34 cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d
35 lintian ${DSC}
36
37 sbuild: $(DSC)
38 sbuild $(DSC)
39
40 .PHONY: clean distclean
41 distclean: clean
42 clean:
43 rm -rf *~ *.deb *.changes ${PACKAGE}-[0-9]*/ *.buildinfo *.build *.dsc *.tar.?z
44
45 .PHONY: check
46 check:
47 $(MAKE) -C test check
48
49 .PHONY: install
50 install:
51 ${MAKE} -C src install
52
53 .PHONY: upload
54 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
55 upload: ${DEB}
56 tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg --dist $(UPLOAD_DIST)