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