]> git.proxmox.com Git - pve-installer.git/blob - Makefile
Merge remote-tracking branch 'cheiss/tui-installer' into tui
[pve-installer.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
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
14 DEB=proxmox-installer_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
15
16 INSTALLER_SOURCES=$(shell git ls-files) country.dat
17
18 all:
19
20 country.dat: country.pl
21 ./country.pl > country.dat.tmp
22 mv country.dat.tmp country.dat
23
24 deb: ${DEB}
25 ${DEB}: ${INSTALLER_SOURCES}
26 rsync --exclude='test*.img' -a * build
27 cd build; dpkg-buildpackage -b -us -uc
28 lintian ${DEB}
29
30 DESTDIR=
31 VARLIBDIR=$(DESTDIR)/var/lib/proxmox-installer
32 HTMLDIR=$(VARLIBDIR)/html/common
33
34 .PHONY: install
35 install: ${INSTALLER_SOURCES}
36 $(MAKE) -C banner install
37 $(MAKE) -C Proxmox install
38 install -D -m 644 interfaces ${DESTDIR}/etc/network/interfaces
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
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
46 install -D -m 755 spice-vdagent.sh ${DESTDIR}/.spice-vdagent.sh
47 install -D -m 644 Xdefaults ${DESTDIR}/.Xdefaults
48
49 %-banner.png: %-banner.svg
50 rsvg-convert -o $@ $<
51
52 .PHONY: upload
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)
56
57 %.img:
58 truncate -s 2G $@
59
60 %.big.img:
61 truncate -s 8G $@
62
63 .PHONY: prepare-check-env
64 prepare-check-env: $(DEB)
65 umount -Rd testdir || true
66 rm -rf testdir
67 dpkg -X $(DEB) testdir
68
69 cd-info.test: PRODUCT ?= pve
70 cd-info.test:
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
76 mv $@.tmp $@
77
78 check-pve: prepare-check-env test.img
79 rm -f cd-info.test; $(MAKE) cd-info.test
80 G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
81
82 check-pve-multidisks: prepare-check-env test.img test2.img test3.img test4.img test5.big.img
83 rm -f cd-info.test; $(MAKE) cd-info.test
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
85
86 check-pmg: prepare-check-env test.img
87 rm -f cd-info.test; $(MAKE) \
88 PRODUCT=pmg \
89 PRODUCTLONG="Proxmox Mail Gateway" \
90 ISONAME='proxmox-mail-gateway' \
91 cd-info.test
92 G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
93
94 check-pbs: prepare-check-env test.img
95 rm -f cd-info.test; $(MAKE) \
96 PRODUCT='pbs' \
97 PRODUCTLONG='Proxmox Backup Server' \
98 ISONAME='proxmox-backup-server' \
99 cd-info.test
100 G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
101
102
103 .phony: clean
104 clean:
105 umount -Rd testdir || true
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
108 find . -name '*~' -exec rm {} ';'