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