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