]>
Commit | Line | Data |
---|---|---|
dcefe98b | 1 | include /usr/share/dpkg/pkg-info.mk |
3e4311fe | 2 | include /usr/share/dpkg/architecture.mk |
dcefe98b TL |
3 | |
4 | PACKAGE=pve-xtermjs | |
3e4311fe | 5 | CRATENAME=termproxy |
dcefe98b TL |
6 | |
7 | export VERSION=${DEB_VERSION_UPSTREAM_REVISION} | |
dcf3d43b | 8 | |
4dc4b7df | 9 | XTERMJSVER=4.16.0 |
5e8b8730 | 10 | XTERMJSTGZ=xterm-${XTERMJSVER}.tgz |
5e8b8730 | 11 | |
d0f166b1 | 12 | FITADDONVER=0.5.0 |
e264b129 DC |
13 | FITADDONTGZ=xterm-addon-fit-${FITADDONVER}.tgz |
14 | ||
dcf3d43b | 15 | SRCDIR=src |
73706daf | 16 | GITVERSION:=$(shell git rev-parse HEAD) |
dcf3d43b | 17 | |
3e4311fe | 18 | DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb |
7a03b1a9 | 19 | DBG_DEB=${PACKAGE}-dbgsym_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb |
3e4311fe | 20 | DSC=rust-${CRATENAME}_${DEB_VERSION_UPSTREAM_REVISION}.dsc |
dcf3d43b | 21 | |
3e4311fe DC |
22 | ifeq ($(BUILD_MODE), release) |
23 | CARGO_BUILD_ARGS += --release | |
24 | COMPILEDIR := target/release | |
25 | else | |
26 | COMPILEDIR := target/debug | |
27 | endif | |
28 | ||
29 | all: cargo-build $(SRCIDR) | |
30 | ||
31 | .PHONY: $(SUBDIRS) | |
32 | $(SUBDIRS): | |
33 | make -C $@ | |
34 | ||
35 | .PHONY: cargo-build | |
36 | cargo-build: | |
37 | cargo build $(CARGO_BUILD_ARGS) | |
dcf3d43b | 38 | |
3e4311fe DC |
39 | .PHONY: build |
40 | build: | |
41 | rm -rf build | |
d82a7626 | 42 | rm -f debian/control |
3e4311fe | 43 | debcargo package \ |
10de4e73 TL |
44 | --config debian/debcargo.toml \ |
45 | --changelog-ready \ | |
46 | --no-overlay-write-back \ | |
47 | --directory build \ | |
48 | $(CRATENAME) \ | |
49 | $(shell dpkg-parsechangelog -l debian/changelog -SVersion | sed -e 's/-.*//') | |
3e4311fe DC |
50 | rm build/Cargo.lock |
51 | find build/debian -name "*.hint" -delete | |
d82a7626 | 52 | cp build/debian/control debian/control |
3e4311fe | 53 | echo "git clone git://git.proxmox.com/git/pve-xtermjs.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE |
094d1014 | 54 | |
dcf3d43b DC |
55 | .PHONY: deb |
56 | deb: ${DEB} | |
7a03b1a9 | 57 | ${DEB} ${DBG_DEB}: build |
3e4311fe | 58 | cd build; dpkg-buildpackage -b -uc -us --no-pre-clean |
dcf3d43b DC |
59 | lintian ${DEB} |
60 | @echo ${DEB} | |
61 | ||
094d1014 TL |
62 | .PHONY: dsc |
63 | dsc: ${DSC} | |
3e4311fe DC |
64 | $(DSC): build |
65 | cd build; dpkg-buildpackage -S -us -uc -d -nc | |
094d1014 | 66 | lintian ${DSC} |
dcf3d43b | 67 | |
3d800c15 TL |
68 | X_EXCLUSIONS=--exclude=addons/attach --exclude=addons/fullscreen --exclude=addons/search \ |
69 | --exclude=addons/terminado --exclude=addons/webLinks --exclude=addons/zmodem | |
dcf3d43b | 70 | .PHONY: download |
3d800c15 | 71 | download: |
5e8b8730 | 72 | wget https://registry.npmjs.org/xterm/-/${XTERMJSTGZ} -O ${XTERMJSTGZ}.tmp |
e264b129 | 73 | wget https://registry.npmjs.org/xterm-addon-fit/-/${FITADDONTGZ} -O ${FITADDONTGZ}.tmp |
5e8b8730 | 74 | mv ${XTERMJSTGZ}.tmp ${XTERMJSTGZ} |
e264b129 DC |
75 | mv ${FITADDONTGZ}.tmp ${FITADDONTGZ} |
76 | tar -C $(SRCDIR)/www -xf ${XTERMJSTGZ} package/lib package/css --strip-components=2 ${X_EXCLUSIONS} | |
77 | tar -C $(SRCDIR)/www -xf ${FITADDONTGZ} package/lib --strip-components=2 ${X_EXCLUSIONS} | |
78 | rm ${XTERMJSTGZ} ${FITADDONTGZ} | |
dcf3d43b DC |
79 | |
80 | .PHONY: upload | |
7a03b1a9 TL |
81 | upload: ${DEB} ${DBG_DEB} |
82 | tar cf - ${DEB} ${DBG_DEB} |ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve,pbs --dist bullseye | |
dcf3d43b DC |
83 | |
84 | .PHONY: distclean | |
85 | distclean: clean | |
86 | ||
87 | .PHONY: clean | |
88 | clean: | |
3e4311fe | 89 | rm -rf *~ debian/*~ ${PACKAGE}-*/ build/ *.deb *.changes *.dsc *.tar.?z *.buildinfo |
dcf3d43b DC |
90 | |
91 | .PHONY: dinstall | |
92 | dinstall: deb | |
93 | dpkg -i ${DEB} |