]> git.proxmox.com Git - pve-installer.git/blob - Makefile
buildsys: derive upload dist automatically
[pve-installer.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 DEB=proxmox-installer_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
4
5 INSTALLER_SOURCES=$(shell git ls-files) country.dat
6
7 all:
8
9 country.dat: country.pl
10 ./country.pl > country.dat.tmp
11 mv country.dat.tmp country.dat
12
13 deb: ${DEB}
14 ${DEB}: ${INSTALLER_SOURCES}
15 rsync --exclude='test*.img' -a * build
16 cd build; dpkg-buildpackage -b -us -uc
17 lintian ${DEB}
18
19 DESTDIR=
20 VARLIBDIR=$(DESTDIR)/var/lib/proxmox-installer
21 HTMLDIR=$(VARLIBDIR)/html/common
22
23 .PHONY: install
24 install: ${INSTALLER_SOURCES}
25 $(MAKE) -C banner install
26 $(MAKE) -C Proxmox install
27 install -D -m 644 interfaces ${DESTDIR}/etc/network/interfaces
28 install -D -m 755 fake-start-stop-daemon ${VARLIBDIR}/fake-start-stop-daemon
29 install -D -m 755 policy-disable-rc.d $(VARLIBDIR)/policy-disable-rc.d
30 install -D -m 644 country.dat $(VARLIBDIR)/country.dat
31 install -D -m 755 unconfigured.sh ${DESTDIR}/sbin/unconfigured.sh
32 install -D -m 755 proxinstall ${DESTDIR}/usr/bin/proxinstall
33 install -D -m 755 checktime ${DESTDIR}/usr/bin/checktime
34 install -D -m 644 xinitrc ${DESTDIR}/.xinitrc
35 install -D -m 755 spice-vdagent.sh ${DESTDIR}/.spice-vdagent.sh
36 install -D -m 644 Xdefaults ${DESTDIR}/.Xdefaults
37
38 %-banner.png: %-banner.svg
39 rsvg-convert -o $@ $<
40
41 .PHONY: upload
42 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
43 upload: $(DEB)
44 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST)
45
46 %.img:
47 truncate -s 2G $@
48
49 %.big.img:
50 truncate -s 8G $@
51
52 .PHONY: prepare-check-env
53 prepare-check-env: $(DEB)
54 umount -Rd testdir || true
55 rm -rf testdir
56 dpkg -X $(DEB) testdir
57
58 check-pve: prepare-check-env test.img
59 printf '%s\n' "PRODUCT='pve'" >cd-info.test
60 G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
61
62 check-pve-multidisks: prepare-check-env test.img test2.img test3.img test4.img test5.big.img
63 printf '%s\n' "PRODUCT='pve'" >cd-info.test
64 G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img,test2.img,test3.img,test4.img,test5.big.img
65
66 check-pmg: prepare-check-env test.img
67 printf '%s\n' "PRODUCT='pmg'" >cd-info.test
68 G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
69
70 check-pbs: prepare-check-env test.img
71 printf '%s\n' "PRODUCT='pbs'" >cd-info.test
72 G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
73
74
75 .phony: clean
76 clean:
77 umount -Rd testdir || true
78 rm -rf *~ *.deb target build packages packages.tmp testdir test*.img pve-final.pkglist \
79 *.buildinfo *.changes country.dat final.pkglist cd-info.test
80 find . -name '*~' -exec rm {} ';'