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