]> git.proxmox.com Git - pve-eslint.git/blob - Makefile
d264323876439500658c5eca79e1d9fe6df33fc3
[pve-eslint.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=pve-eslint
4
5 GITVERSION:=$(shell git rev-parse HEAD)
6 BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
7
8 DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
9
10 SRCDIR=src
11 UPSTREAM=eslint
12 UPSTREAMTAG=v7.0.0-alpha.3
13 BUILDSRC=${UPSTREAM}-${UPSTREAMTAG}
14
15 all: ${DEB}
16 @echo ${DEB}
17
18 .PHONY: deb
19 deb: ${DEB}
20 ${DEB}: ${SRCDIR}
21 rm -rf ${BUILDDIR}
22 mkdir ${BUILDDIR}
23 cp -a debian ${BUILDDIR}/
24 cp -a ${SRCDIR}/* ${BUILDDIR}/
25 echo "git clone git://git.proxmox.com/git/pve-eslint.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
26 cd ${BUILDDIR}; dpkg-buildpackage -rfakeroot -b -uc -us
27 lintian ${DEB}
28 @echo ${DEB}
29
30 .PHONY: download
31 download:
32 rm -rf ${UPSTREAM}.tmp ${UPSTREAM}
33 git clone -b ${UPSTREAMTAG} --depth 1 https://github.com/eslint/eslint ${UPSTREAM}.tmp
34 rm -rf ${UPSTREAM}.tmp/.git
35 find ${UPSTREAM}.tmp/ -type f -name '.gitignore' -delete
36 mv ${UPSTREAM}.tmp ${UPSTREAM}
37
38 # NOTE: needs npm installed, downloads packages from npm
39 .PHONY: buildupstream
40 buildupstream: ${BUILDSRC}
41 cp ${BUILDSRC}/build/eslint.js ${SRCDIR}/eslint.js
42
43 ${BUILDSRC}: ${UPSTREAM} patches
44 rm -rf $@
45 mkdir $@.tmp
46 rsync -ra ${UPSTREAM}/ $@.tmp
47 cd $@.tmp; ln -s ../patches patches
48 cd $@.tmp; quilt push -a
49 cd $@.tmp; rm -rf .pc ./patches
50 mv $@.tmp $@
51 cd $@; npm install
52 cd $@; npm run webpack
53
54 .PHONY: upload
55 upload: ${DEB}
56 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist buster
57
58 .PHONY: distclean
59 distclean: clean
60
61 .PHONY: clean
62 clean:
63 rm -rf *~ debian/*~ *.deb ${BUILDSRC} ${BUILDSRC}.tmp ${UPSTREAM}.tmp ${BUILDDIR} *.changes *.dsc *.buildinfo
64
65 .PHONY: dinstall
66 dinstall: deb
67 dpkg -i ${DEB}