]>
Commit | Line | Data |
---|---|---|
1 | include /usr/share/dpkg/pkg-info.mk | |
2 | ||
3 | PACKAGE=libpve-http-server-perl | |
4 | ||
5 | GITVERSION:=$(shell git rev-parse HEAD) | |
6 | BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM} | |
7 | ||
8 | DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb | |
9 | ||
10 | DESTDIR= | |
11 | ||
12 | PERL5DIR=${DESTDIR}/usr/share/perl5 | |
13 | DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE} | |
14 | ||
15 | WWWBASEDIR=${DESTDIR}/usr/share/${PACKAGE} | |
16 | WWWCSSDIR=${WWWBASEDIR}/css | |
17 | WWWFONTSDIR=${WWWBASEDIR}/fonts | |
18 | WWWJSDIR=${WWWBASEDIR}/js | |
19 | ||
20 | # bootstrap library | |
21 | BTVER=3.4.1 | |
22 | BTDIR=bootstrap-${BTVER}-dist | |
23 | BTSRC=${BTDIR}.zip | |
24 | ||
25 | BTDATA = \ | |
26 | ${BTDIR}/css/bootstrap.min.css \ | |
27 | ${BTDIR}/css/bootstrap-theme.min.css \ | |
28 | ${BTDIR}/js/bootstrap.min.js \ | |
29 | ${BTDIR}/fonts/glyphicons-halflings-regular.ttf | |
30 | ||
31 | JQVER=3.4.1 | |
32 | JQSRC=jquery-${JQVER}.min.js | |
33 | ||
34 | all: | |
35 | ||
36 | .PHONY: deb | |
37 | deb: ${DEB} | |
38 | ${DEB}: | |
39 | rm -rf ${BUILDDIR} | |
40 | rsync -a * ${BUILDDIR} | |
41 | echo "git clone git://git.proxmox.com/git/pve-http-server\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE | |
42 | cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc | |
43 | lintian ${DEB} | |
44 | ||
45 | download_bootstrap: | |
46 | rm -f ${BTSRC}$ ${BTSRC}.tmp | |
47 | wget https://github.com/twbs/bootstrap/releases/download/v${BTVER}/${BTSRC} -O ${BTSRC}.tmp | |
48 | mv ${BTSRC}.tmp ${BTSRC} | |
49 | ||
50 | download_jquery: | |
51 | rm -f ${JQSRC} ${JQSRC}.tmp | |
52 | wget https://code.jquery.com/jquery-${JQVER}.min.js -O ${JQSRC}.tmp | |
53 | mv ${JQSRC}.tmp ${JQSRC} | |
54 | ||
55 | ${BTDATA}: ${BTDIR} | |
56 | ${BTDIR}: ${BTSRC} | |
57 | rm -rf ${BTDIR} | |
58 | unzip -x ${BTSRC} | |
59 | ||
60 | install: ${BTDATA} | |
61 | install -d -m 755 ${PERL5DIR}/PVE/APIServer | |
62 | install -m 0644 PVE/APIServer/AnyEvent.pm ${PERL5DIR}/PVE/APIServer | |
63 | install -m 0644 PVE/APIServer/Formatter.pm ${PERL5DIR}/PVE/APIServer | |
64 | install -m 0644 PVE/APIServer/Utils.pm ${PERL5DIR}/PVE/APIServer | |
65 | install -d -m 755 ${PERL5DIR}/PVE/APIServer/Formatter | |
66 | install -m 0644 PVE/APIServer/Formatter/Standard.pm ${PERL5DIR}/PVE/APIServer/Formatter | |
67 | install -m 0644 PVE/APIServer/Formatter/Bootstrap.pm ${PERL5DIR}/PVE/APIServer/Formatter | |
68 | install -m 0644 PVE/APIServer/Formatter/HTML.pm ${PERL5DIR}/PVE/APIServer/Formatter | |
69 | # install bootstrap and jquery | |
70 | install -d -m 755 ${WWWBASEDIR} | |
71 | install -d -m 755 ${WWWCSSDIR} | |
72 | install -m 0644 -o www-data -g www-data ${BTDIR}/css/bootstrap.min.css ${WWWCSSDIR} | |
73 | install -m 0644 -o www-data -g www-data ${BTDIR}/css/bootstrap-theme.min.css ${WWWCSSDIR} | |
74 | install -d -m 755 ${WWWJSDIR} | |
75 | install -m 0644 -o www-data -g www-data ${BTDIR}/js/bootstrap.min.js ${WWWJSDIR} | |
76 | install -m 0644 -o www-data -g www-data ${JQSRC} ${WWWJSDIR} | |
77 | install -d -m 755 ${WWWFONTSDIR} | |
78 | install -m 0644 ${BTDIR}/fonts/glyphicons-halflings-regular.ttf ${WWWFONTSDIR} | |
79 | ||
80 | ||
81 | .PHONY: upload | |
82 | upload: ${DEB} | |
83 | tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg --dist buster | |
84 | ||
85 | .PHONY: clean distclean | |
86 | distclean: clean | |
87 | rm -f examples/simple-demo.pem | |
88 | ||
89 | clean: | |
90 | rm -rf ${PACKAGE}-*/ *.deb *.changes *.buildinfo ${BTDIR} examples/simple-demo.lck | |
91 | find . -name '*~' -exec rm {} ';' | |
92 | ||
93 | .PHONY: dinstall | |
94 | dinstall: ${DEB} | |
95 | dpkg -i ${DEB} |