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