]>
Commit | Line | Data |
---|---|---|
dad62fce | 1 | include /usr/share/dpkg/pkg-info.mk |
6db9b06a | 2 | |
e70f1b2f CH |
3 | CARGO ?= cargo |
4 | ||
5 | TUI_INSTALLER_BIN := proxmox-tui-installer | |
6 | ||
7 | ifeq ($(BUILD_MODE), release) | |
8 | CARGO_BUILD_ARGS += --release | |
9 | CARGO_COMPILEDIR := target/release | |
10 | else | |
11 | CARGO_COMPILEDIR := target/debug | |
12 | endif | |
13 | ||
c2f72dd6 | 14 | DEB=proxmox-installer_${DEB_VERSION_UPSTREAM_REVISION}_all.deb |
89a12446 | 15 | |
f3521633 | 16 | INSTALLER_SOURCES=$(shell git ls-files) country.dat |
89a12446 | 17 | |
f3521633 | 18 | all: |
f0583fd4 DM |
19 | |
20 | country.dat: country.pl | |
fc2c6d3e TL |
21 | ./country.pl > country.dat.tmp |
22 | mv country.dat.tmp country.dat | |
780479c5 | 23 | |
c2f72dd6 | 24 | deb: ${DEB} |
f3521633 | 25 | ${DEB}: ${INSTALLER_SOURCES} |
bf1de878 | 26 | rsync --exclude='test*.img' -a * build |
c5582ca4 | 27 | cd build; dpkg-buildpackage -b -us -uc |
c2f72dd6 TL |
28 | lintian ${DEB} |
29 | ||
30 | DESTDIR= | |
31 | VARLIBDIR=$(DESTDIR)/var/lib/proxmox-installer | |
32 | HTMLDIR=$(VARLIBDIR)/html/common | |
89a12446 | 33 | |
c2f72dd6 | 34 | .PHONY: install |
f3521633 | 35 | install: ${INSTALLER_SOURCES} |
c2f72dd6 | 36 | $(MAKE) -C banner install |
ab97da2c | 37 | $(MAKE) -C Proxmox install |
89a12446 | 38 | install -D -m 644 interfaces ${DESTDIR}/etc/network/interfaces |
c2f72dd6 TL |
39 | install -D -m 755 fake-start-stop-daemon ${VARLIBDIR}/fake-start-stop-daemon |
40 | install -D -m 755 policy-disable-rc.d $(VARLIBDIR)/policy-disable-rc.d | |
41 | install -D -m 644 country.dat $(VARLIBDIR)/country.dat | |
89a12446 DM |
42 | install -D -m 755 unconfigured.sh ${DESTDIR}/sbin/unconfigured.sh |
43 | install -D -m 755 proxinstall ${DESTDIR}/usr/bin/proxinstall | |
44 | install -D -m 755 checktime ${DESTDIR}/usr/bin/checktime | |
45 | install -D -m 644 xinitrc ${DESTDIR}/.xinitrc | |
fb7bdbd4 | 46 | install -D -m 755 spice-vdagent.sh ${DESTDIR}/.spice-vdagent.sh |
89a12446 | 47 | install -D -m 644 Xdefaults ${DESTDIR}/.Xdefaults |
89a12446 | 48 | |
c2f72dd6 | 49 | %-banner.png: %-banner.svg |
9b9ddfce | 50 | rsvg-convert -o $@ $< |
782b4acd | 51 | |
c2f72dd6 | 52 | .PHONY: upload |
e23aeee4 TL |
53 | upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) |
54 | upload: $(DEB) | |
55 | tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST) | |
89a12446 | 56 | |
76960140 TL |
57 | %.img: |
58 | truncate -s 2G $@ | |
89a12446 | 59 | |
4a96f472 TL |
60 | %.big.img: |
61 | truncate -s 8G $@ | |
62 | ||
c2f72dd6 TL |
63 | .PHONY: prepare-check-env |
64 | prepare-check-env: $(DEB) | |
56510a19 | 65 | umount -Rd testdir || true |
92cbd446 | 66 | rm -rf testdir |
c2f72dd6 TL |
67 | dpkg -X $(DEB) testdir |
68 | ||
29f32406 TL |
69 | cd-info.test: PRODUCT ?= pve |
70 | cd-info.test: | |
413ca90b TL |
71 | printf '%s\n' "PRODUCT='$(or $(PRODUCT), pve)'" >$@.tmp |
72 | printf '%s\n' "PRODUCTLONG='$(or $(PRODUCTLONG), Proxmox VE)'" >>$@.tmp | |
73 | printf '%s\n' "RELEASE='$(or $(RELEASE), 42.1)'" >>$@.tmp | |
74 | printf '%s\n' "ISORELEASE='$(or $(ISORELEASE), 1)'" >>$@.tmp | |
75 | printf '%s\n' "ISONAME='$(or $(ISONAME), proxmox-ve)'" >>$@.tmp | |
29f32406 TL |
76 | mv $@.tmp $@ |
77 | ||
c2f72dd6 | 78 | check-pve: prepare-check-env test.img |
413ca90b | 79 | rm -f cd-info.test; $(MAKE) cd-info.test |
92cbd446 | 80 | G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img |
89a12446 | 81 | |
4a96f472 | 82 | check-pve-multidisks: prepare-check-env test.img test2.img test3.img test4.img test5.big.img |
413ca90b | 83 | rm -f cd-info.test; $(MAKE) cd-info.test |
4a96f472 | 84 | 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 |
76960140 | 85 | |
c2f72dd6 | 86 | check-pmg: prepare-check-env test.img |
413ca90b TL |
87 | rm -f cd-info.test; $(MAKE) \ |
88 | PRODUCT=pmg \ | |
89 | PRODUCTLONG="Proxmox Mail Gateway" \ | |
90 | ISONAME='proxmox-mail-gateway' \ | |
91 | cd-info.test | |
a8213c0e DM |
92 | G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img |
93 | ||
c2f72dd6 | 94 | check-pbs: prepare-check-env test.img |
413ca90b TL |
95 | rm -f cd-info.test; $(MAKE) \ |
96 | PRODUCT='pbs' \ | |
97 | PRODUCTLONG='Proxmox Backup Server' \ | |
98 | ISONAME='proxmox-backup-server' \ | |
99 | cd-info.test | |
53748662 OB |
100 | G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img |
101 | ||
102 | ||
89a12446 DM |
103 | .phony: clean |
104 | clean: | |
56510a19 | 105 | umount -Rd testdir || true |
c9b46f90 TL |
106 | rm -rf *~ *.deb target build packages packages.tmp testdir test*.img pve-final.pkglist \ |
107 | *.buildinfo *.changes country.dat final.pkglist cd-info.test | |
b1e23923 | 108 | find . -name '*~' -exec rm {} ';' |