]> git.proxmox.com Git - lxcfs.git/blob - Makefile
buildsys: more make job safety fixes
[lxcfs.git] / Makefile
1 RELEASE=4.4
2
3 PACKAGE=lxcfs
4 PKGVER=2.0.6
5 DEBREL=pve1
6
7 SRCDIR=${PACKAGE}
8 SRCTAR=${SRCDIR}.tgz
9
10 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
11 GITVERSION:=$(shell cat .git/refs/heads/master)
12
13 DEB1=${PACKAGE}_${PKGVER}-${DEBREL}_${ARCH}.deb
14 DEB2=${PACKAGE}-dbg_${PKGVER}-${DEBREL}_${ARCH}.deb
15 DEBS=$(DEB1) $(DEB2)
16
17 all: ${DEB}
18
19 .PHONY: deb
20 deb: $(DEBS)
21 $(DEB2): $(DEB1)
22 $(DEB1): $(SRCTAR)
23 rm -rf ${SRCDIR}
24 tar xf ${SRCTAR}
25 cp -a debian ${SRCDIR}/debian
26 echo "git clone git://git.proxmox.com/git/lxcfs.git\\ngit checkout ${GITVERSION}" > ${SRCDIR}/debian/SOURCE
27 echo "debian/SOURCE" >> ${SRCDIR}/debian/docs
28 cd ${SRCDIR}; dpkg-buildpackage -rfakeroot -b -us -uc
29 #lintian $(DEB)
30
31
32 .PHONY: download
33 download ${SRCTAR}:
34 rm -rf ${SRCDIR} ${SRCTAR}
35 git clone --depth=1 -b lxcfs-${PKGVER} git://github.com/lxc/lxcfs
36 tar czf ${SRCTAR}.tmp ${SRCDIR}
37 mv ${SRCTAR}.tmp ${SRCTAR}
38
39 .PHONY: upload
40 upload: $(DEBS)
41 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
42 mkdir -p /pve/${RELEASE}/extra
43 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
44 rm -f /pve/${RELEASE}/extra/${PACKAGE}-dbg_*.deb
45 rm -f /pve/${RELEASE}/extra/Packages*
46 cp $(DEBS) /pve/${RELEASE}/extra
47 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
48 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
49
50 distclean: clean
51
52 .PHONY: clean
53 clean:
54 rm -rf ${SRCDIR} ${SRCDIR}.tmp *_${ARCH}.deb *.changes *.dsc
55 find . -name '*~' -exec rm {} ';'
56
57 .PHONY: dinstall
58 dinstall: $(DEBS)
59 dpkg -i $(DEBS)