]> git.proxmox.com Git - lxcfs.git/blob - Makefile
update Makefile to get version info from changelog
[lxcfs.git] / Makefile
1 PACKAGE=lxcfs
2 PKGVER != dpkg-parsechangelog -Sversion | cut -d- -f1
3 PKGREL != dpkg-parsechangelog -Sversion | cut -d- -f2
4
5 SRCDIR=${PACKAGE}
6 BUILDSRC := $(SRCDIR).tmp
7
8 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
9 GITVERSION:=$(shell git rev-parse HEAD)
10
11 DEB1=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
12 DEB2=${PACKAGE}-dbgsym_${PKGVER}-${PKGREL}_${ARCH}.deb
13 DEBS=$(DEB1) $(DEB2)
14
15 all: ${DEB}
16
17 .PHONY: submodule
18 submodule:
19 test -f "${SRCDIR}/README" || git submodule update --init
20
21 .PHONY: deb
22 deb: $(DEBS)
23 $(DEB2): $(DEB1)
24 $(DEB1): | submodule
25 rm -f *.deb
26 rm -rf $(BUILDSRC)
27 cp -a $(SRCDIR) $(BUILDSRC)
28 cp -a debian $(BUILDSRC)/debian
29 echo "git clone git://git.proxmox.com/git/lxc.git\\ngit checkout $(GITVERSION)" > $(BUILDSRC)/debian/SOURCE
30 cd $(BUILDSRC); dpkg-buildpackage -rfakeroot -b -us -uc
31 #lintian $(DEBS)
32
33 .PHONY: upload
34 upload: $(DEBS)
35 tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist stretch
36
37 distclean: clean
38
39 .PHONY: clean
40 clean:
41 rm -rf $(BUILDSRC) *_${ARCH}.deb *.changes *.dsc *.buildinfo
42
43 .PHONY: dinstall
44 dinstall: $(DEBS)
45 dpkg -i $(DEBS)