]> git.proxmox.com Git - pve-eslint.git/blob - Makefile
a9e7f669cf8e189648678077e9abc99c0c2de29f
[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 DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
10
11 UPSTREAM=eslint
12 UPSTREAMTAG=v8.41.0
13 UPSTREAMSRC=$(UPSTREAM)-$(UPSTREAMTAG)
14
15 all: $(DEB)
16 @echo $(DEB)
17
18 .PHONY: dsc deb
19
20 $(BUILDDIR): .any-eslint-js
21 rm -rf $@.tmp $@
22 mkdir $@.tmp
23 cp -a debian $@.tmp/
24 cp -a src/* $@.tmp/
25 echo "git clone git://git.proxmox.com/git/pve-eslint.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
26 mv $@.tmp $@
27
28 dsc: $(DSC)
29 $(DSC): $(BUILDDIR)
30 cd $(BUILDDIR); dpkg-buildpackage -S -uc -us
31 lintian $(DSC)
32
33 deb: $(DEB)
34 $(DEB): $(BUILDDIR)
35 cd $(BUILDDIR); dpkg-buildpackage -b -uc -us
36 lintian $(DEB)
37 @echo $(DEB)
38
39 .PHONY: download
40 download:
41 rm -rf $(UPSTREAM)
42 $(MAKE) $(UPSTREAM)
43
44 $(UPSTREAM):
45 rm -rf $(UPSTREAM).tmp $(UPSTREAM)
46 git clone -b $(UPSTREAMTAG) --depth 1 https://github.com/eslint/eslint $(UPSTREAM).tmp
47 rm -rf $(UPSTREAM).tmp/.git
48 find $(UPSTREAM).tmp/ -type f -name '.gitignore' -delete
49 mv $(UPSTREAM).tmp $(UPSTREAM)
50
51 .PHONY: vendor-upstream
52 vendor-upstream:
53 rm -rf $(UPSTREAMSRC) src/lib/eslint.js
54 $(MAKE) src/lib/eslint.js
55
56 .any-eslint-js:
57 [ -e src/lib/eslint.js ] || $(MAKE) src/lib/eslint.js
58 touch $@
59
60 src/lib/eslint.js: $(UPSTREAMSRC)/build/eslint.js
61 cp $(UPSTREAMSRC)/build/eslint.js src/lib/eslint.js
62
63 $(UPSTREAMSRC)/build/eslint.js: $(UPSTREAMSRC)
64 # NOTE: needs npm installed, downloads packages from npm
65 cd $(UPSTREAMSRC); npm install
66 cd $(UPSTREAMSRC); npm run build:webpack
67
68 $(UPSTREAMSRC): $(UPSTREAM) patches
69 rm -rf $@ $@.tmp
70 mkdir $@.tmp
71 rsync -ra $(UPSTREAM)/ $@.tmp
72 cd $@.tmp; ln -s ../patches patches
73 cd $@.tmp; quilt push -a
74 cd $@.tmp; rm -rf .pc ./patches
75 mv $@.tmp $@
76
77 .PHONY: upload
78 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
79 upload: $(DEB)
80 tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product devel --dist $(UPLOAD_DIST)
81
82 .PHONY: distclean
83 distclean: clean
84
85 .PHONY: clean
86 clean:
87 rm -rf *~ debian/*~ *.deb $(BUILDSRC) *.tmp/ $(BUILDDIR) *.changes *.tar.gz *.dsc *.buildinfo
88
89 .PHONY: dinstall
90 dinstall: deb
91 dpkg -i $(DEB)