]> git.proxmox.com Git - pve-manager.git/blob - Makefile
cleanup: replace repoid.pl script by simple git commands
[pve-manager.git] / Makefile
1 include defines.mk
2
3 export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
4
5 DESTDIR=
6
7 SUBDIRS = aplinfo PVE bin www
8
9 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
10 GITVERSION:=$(shell git rev-parse HEAD)
11
12 DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
13
14 all: ${SUBDIRS}
15
16 check:
17 ${MAKE} -C bin/test check
18
19 .PHONY: dinstall
20 dinstall: ${DEB}
21 dpkg -i ${DEB}
22
23 country.dat: country.pl
24 ./country.pl > country.dat
25
26 .PHONY: deb
27 deb: $(DEB)
28 $(DEB):
29 rm -rf dest
30 mkdir dest
31 rsync -a * dest
32 echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" > dest/debian/SOURCE
33 cd dest; dpkg-buildpackage -b -us -uc
34 # supress lintian error: statically-linked-binary usr/bin/pvemailforward
35 lintian -X binaries ${DEB}
36
37 .PHONY: upload
38 upload: ${DEB} check
39 # check if working directory is clean
40 git diff --exit-code --stat && git diff --exit-code --stat --staged
41 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pve --dist stretch
42
43 .PHONY: install
44 install: country.dat vzdump.conf vzdump-hook-script.pl pve-apt.conf mtu bridgevlan bridgevlanport vlan vlan-down
45 install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
46 install -D -m 0644 debian/pve.logrotate ${DESTDIR}/etc/logrotate.d/pve
47 install -d ${DESTDIR}/usr/share/${PACKAGE}
48 install -d ${DESTDIR}/usr/share/man/man1
49 install -d ${DOCDIR}/examples
50 install -d ${DESTDIR}/var/lib/${PACKAGE}
51 install -d ${DESTDIR}/var/lib/vz/images
52 install -d ${DESTDIR}/var/lib/vz/template/cache
53 install -d ${DESTDIR}/var/lib/vz/template/iso
54 install -d ${DESTDIR}/var/lib/vz/template/qemu
55 install -D -m 0644 pve-apt.conf ${DESTDIR}/etc/apt/apt.conf.d/75pveconf
56 install -D -m 0644 pve-sources.list ${DESTDIR}/etc/apt/sources.list.d/pve-enterprise.list
57 install -D -m 0644 pve-blacklist.conf ${DESTDIR}/etc/modprobe.d/pve-blacklist.conf
58 install -D -m 0644 vzdump.conf ${DESTDIR}/etc/vzdump.conf
59 install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu
60 install -D -m 0755 bridgevlan ${DESTDIR}/etc/network/if-up.d/bridgevlan
61 install -D -m 0755 bridgevlanport ${DESTDIR}/etc/network/if-up.d/bridgevlanport
62 install -D -m 0755 vlan ${DESTDIR}/etc/network/if-pre-up.d/vlan
63 install -D -m 0755 vlan-down ${DESTDIR}/etc/network/if-post-down.d/vlan
64
65 install -D -m 0644 pve-initramfs.conf ${DESTDIR}/etc/initramfs-tools/conf.d/pve-initramfs.conf
66
67 install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
68 install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh
69 install -m 0644 country.dat ${DESTDIR}/usr/share/${PACKAGE}
70
71 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
72
73 .PHONY: distclean
74 distclean: clean
75
76 .PHONY: clean
77 clean:
78 set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
79 find . -name '*~' -exec rm {} ';'
80 rm -rf dest country.dat *.deb *.buildinfo *.changes ca-tmp