]> git.proxmox.com Git - lxc.git/blob - Makefile
buildsys: split deb target into deb and src
[lxc.git] / Makefile
1 PACKAGE=lxc-pve
2 LXCVER=3.0.2+pve1
3 DEBREL=3
4
5 SRCDIR=lxc
6 BUILDSRC := $(PACKAGE)-$(LXCVER)
7
8 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
9
10 DEB_BASE=$(PACKAGE)_$(LXCVER)-$(DEBREL)
11 DEB1=$(DEB_BASE)_$(ARCH).deb
12 DEB2=$(PACKAGE)-dev_$(LXCVER)-$(DEBREL)_$(ARCH).deb \
13 $(PACKAGE)-dbgsym_$(LXCVER)-$(DEBREL)_$(ARCH).deb
14 DEBS=$(DEB1) $(DEB2)
15 DSC=$(DEB_BASE).dsc
16 TARGZ=$(DEB_BASE).tar.gz
17
18 all: $(DEBS)
19 echo $(DEBS)
20
21 .PHONY: submodule
22 submodule:
23 test -f "$(SRCDIR)/debian/changelog" || git submodule update --init
24
25 $(BUILDSRC): lxc debian config | submodule
26 rm -rf $(BUILDSRC)
27 cp -a $(SRCDIR) $(BUILDSRC)
28 cp -a debian $(BUILDSRC)/debian
29 mkdir $(BUILDSRC)/debian/config
30 for i in config/*.conf.in; do \
31 sed -e 's|@LXCTEMPLATECONFIG@|/usr/share/lxc/config|g' $$i > $(BUILDSRC)/debian/$${i%.in} ; \
32 done
33 echo "git clone git://git.proxmox.com/git/lxc.git\\ngit checkout $(shell git rev-parse HEAD)" > $(BUILDSRC)/debian/SOURCE
34
35 .PHONY: deb
36 deb: $(DEBS)
37 $(DEB2): $(DEB1)
38 $(DEB1): $(BUILDSRC)
39 rm -f *.deb
40 cd $(BUILDSRC); dpkg-buildpackage -b -us -uc
41 lintian $(DEBS)
42
43 .PHONY: dsc
44 dsc $(TARGZ): $(DSC)
45 $(DSC): $(BUILDSRC)
46 rm -f *.dsc
47 cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
48 lintian $(DSC)
49
50 .PHONY: upload
51 upload: $(DEBS)
52 tar cf - $(DEBS) | ssh repoman@repo.proxmox.com upload --product pve --dist stretch
53
54 distclean: clean
55
56 .PHONY: clean
57 clean:
58 rm -rf $(BUILDSRC) *_$(ARCH).deb *_$(ARCH).dsc *.tar.gz *.changes *.dsc *.buildinfo
59
60 .PHONY: dinstall
61 dinstall: $(DEBS)
62 dpkg -i $(DEBS)