]> git.proxmox.com Git - pve-installer.git/blame - Makefile
Merge remote-tracking branch 'cheiss/tui-installer' into tui
[pve-installer.git] / Makefile
CommitLineData
dad62fce 1include /usr/share/dpkg/pkg-info.mk
6db9b06a 2
e70f1b2f
CH
3CARGO ?= cargo
4
5TUI_INSTALLER_BIN := proxmox-tui-installer
6
7ifeq ($(BUILD_MODE), release)
8CARGO_BUILD_ARGS += --release
9CARGO_COMPILEDIR := target/release
10else
11CARGO_COMPILEDIR := target/debug
12endif
13
c2f72dd6 14DEB=proxmox-installer_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
89a12446 15
f3521633 16INSTALLER_SOURCES=$(shell git ls-files) country.dat
89a12446 17
f3521633 18all:
f0583fd4
DM
19
20country.dat: country.pl
fc2c6d3e
TL
21 ./country.pl > country.dat.tmp
22 mv country.dat.tmp country.dat
780479c5 23
c2f72dd6 24deb: ${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
30DESTDIR=
31VARLIBDIR=$(DESTDIR)/var/lib/proxmox-installer
32HTMLDIR=$(VARLIBDIR)/html/common
89a12446 33
c2f72dd6 34.PHONY: install
f3521633 35install: ${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
53upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
54upload: $(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
64prepare-check-env: $(DEB)
56510a19 65 umount -Rd testdir || true
92cbd446 66 rm -rf testdir
c2f72dd6
TL
67 dpkg -X $(DEB) testdir
68
29f32406
TL
69cd-info.test: PRODUCT ?= pve
70cd-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 78check-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 82check-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 86check-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 94check-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
104clean:
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 {} ';'