build: reformat debian/control
[pve-sheepdog.git] / Makefile
1 PACKAGE=pve-sheepdog
2 PKGREL=1
3 SDVER=1.0.2
4
5 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
6 GITVERSION:=$(shell cat .git/refs/heads/master)
7
8 DEB=${PACKAGE}_${SDVER}-${PKGREL}_${ARCH}.deb
9
10 SDDIR=sheepdog-${SDVER}
11 SDSRC=${SDDIR}.tar.gz
12
13 all: ${DEB}
14
15 ${DEB} deb: ${SDSRC}
16         rm -rf ${SDDIR}
17         tar xf ${SDSRC}
18         mv ${SDDIR}/debian ${SDDIR}/debian.org
19         cp -av debian ${SDDIR}/debian
20         echo "git clone git://git.proxmox.com/git/pve-sheepdog.git\\ngit checkout ${GITVERSION}" > ${SDDIR}/debian/SOURCE
21         cd ${SDDIR}; dpkg-buildpackage -rfakeroot -b -us -uc
22         lintian -X copyright-file ${DEB}
23
24 .PHONY: download
25 ${SDSRC} download:
26         rm -rf ${SDDIR} sheepdog.git
27         git clone git://github.com/sheepdog/sheepdog.git -b v1.0.2_rc0 sheepdog.git
28         cd sheepdog.git; git archive --format=tar.gz -o ../${SDSRC}.tmp v1.0 --prefix=${SDDIR}/
29         mv ${SDSRC}.tmp ${SDSRC}
30
31 .PHONY: upload
32 upload: ${DEB}
33         tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch
34
35 clean:
36 distclean: clean
37         rm -rf sheepdog.git
38
39 .PHONY: clean
40 clean:
41         rm -rf *~ debian/*~ *.deb *.changes *.buildinfo *.dsc ${SDDIR} ${SDSRC}.tmp
42
43 .PHONY: dinstall
44 dinstall: ${DEB}
45         dpkg -i ${DEB}
46