1 include /usr
/share
/dpkg
/default.mk
3 PACKAGE
= proxmox-installer
4 BUILDDIR ?
= $(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)
6 DEB
=$(PACKAGE
)_
$(DEB_VERSION
)_
$(DEB_HOST_ARCH
).deb
7 ASSISTANT_DEB
=proxmox-auto-install-assistant_
$(DEB_VERSION
)_
$(DEB_HOST_ARCH
).deb
8 DSC
=$(PACKAGE
)_
$(DEB_VERSION
).dsc
11 ifeq ($(BUILD_MODE
), release
)
12 CARGO_BUILD_ARGS
+= --release
13 CARGO_COMPILEDIR
:= target
/release
15 CARGO_COMPILEDIR
:= target
/debug
18 INSTALLER_SOURCES
=$(shell git ls-files
) country.dat
21 BINDIR
= $(PREFIX
)/bin
24 proxmox-tui-installer\
26 proxmox-auto-install-assistant \
27 proxmox-auto-installer
30 $(addprefix $(CARGO_COMPILEDIR
)/,$(USR_BIN
))
33 fake-start-stop-daemon \
42 rm -rf
$@
$@.tmp
; mkdir
$@.tmp
55 proxmox-low-level-installer \
56 proxmox-auto-installer
/ \
57 proxmox-auto-install-assistant
/ \
58 proxmox-fetch-answer
/ \
60 proxmox-tui-installer
/ \
61 proxmox-installer-common
/ \
68 country.dat
: country.pl
69 .
/country.pl
> country.dat.tmp
70 mv country.dat.tmp country.dat
73 $(ASSISTANT_DEB
): $(DEB
)
75 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
78 test-
$(DEB
): $(INSTALLER_SOURCES
)
79 rsync
--exclude
='test*.img' --exclude
='*.deb' --exclude
='build' -a
* build
80 cd build
; dpkg-buildpackage
-b
-us
-uc
-nc
89 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
94 .PHONY
: prepare-test-env
95 prepare-test-env
: cd-info.
test country.dat
test.img
97 mkdir
-p testdir
/var
/lib
/proxmox-installer
/
98 cp
-v country.dat testdir
/var
/lib
/proxmox-installer
/
99 .
/proxmox-low-level-installer
-t
test.img dump-env
102 test: prepare-test-env
103 shellcheck
$(SHELL_SCRIPTS
)
104 $(MAKE
) -C
test check
105 $(CARGO
) test --workspace
$(CARGO_BUILD_ARGS
)
108 VARLIBDIR
=$(DESTDIR
)/var
/lib
/proxmox-installer
109 HTMLDIR
=$(VARLIBDIR
)/html
/common
112 install: $(INSTALLER_SOURCES
) $(COMPILED_BINS
)
113 $(MAKE
) -C banner
install
114 $(MAKE
) -C Proxmox
install
115 install -D
-m
644 interfaces
$(DESTDIR
)/etc
/network
/interfaces
116 install -D
-m
755 fake-start-stop-daemon
$(VARLIBDIR
)/fake-start-stop-daemon
117 install -D
-m
755 policy-disable-rc.d
$(VARLIBDIR
)/policy-disable-rc.d
118 install -D
-m
644 country.dat
$(VARLIBDIR
)/country.dat
119 install -D
-m
755 unconfigured.sh
$(DESTDIR
)/sbin
/unconfigured.sh
120 install -D
-m
755 proxinstall
$(DESTDIR
)/usr
/bin
/proxinstall
121 install -D
-m
755 proxmox-low-level-installer
$(DESTDIR
)/$(BINDIR
)/proxmox-low-level-installer
122 $(foreach i
,$(USR_BIN
), install -m755
$(CARGO_COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
123 install -D
-m
755 checktime
$(DESTDIR
)/usr
/bin
/checktime
124 install -D
-m
644 xinitrc
$(DESTDIR
)/.xinitrc
125 install -D
-m
755 spice-vdagent.sh
$(DESTDIR
)/.spice-vdagent.sh
126 install -D
-m
644 Xdefaults
$(DESTDIR
)/.Xdefaults
128 $(COMPILED_BINS
): cargo-build
131 $(CARGO
) build
--package proxmox-tui-installer
--bin proxmox-tui-installer \
132 --package proxmox-auto-installer
--bin proxmox-auto-installer \
133 --package proxmox-fetch-answer
--bin proxmox-fetch-answer \
134 --package proxmox-auto-install-assistant
--bin proxmox-auto-install-assistant \
135 --package proxmox-chroot
--bin proxmox-chroot
$(CARGO_BUILD_ARGS
)
137 %-banner.png
: %-banner.svg
138 rsvg-convert
-o
$@
$<
141 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
142 upload
: $(DEB
) $(ASSISTANT_DEB
)
143 tar cf
- $(DEB
) $(ASSISTANT_DEB
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
,pmg
,pbs
--dist $(UPLOAD_DIST
)
151 .PHONY
: prepare-check-env
152 prepare-check-env
: test-
$(DEB
)
154 dpkg
-X test-
$(DEB
) testdir
155 mkdir
-p testdir
/run
/proxmox-installer
/
157 cd-info.
test: PRODUCT ?
= pve
159 printf
'%s\n' "PRODUCT='$(or $(PRODUCT), pve)'" >$@.tmp
160 printf
'%s\n' "PRODUCTLONG='$(or $(PRODUCTLONG), Proxmox VE)'" >>$@.tmp
161 printf
'%s\n' "RELEASE='$(or $(RELEASE), 42.1)'" >>$@.tmp
162 printf
'%s\n' "ISORELEASE='$(or $(ISORELEASE), 1)'" >>$@.tmp
163 printf
'%s\n' "ISONAME='$(or $(ISONAME), proxmox-ve)'" >>$@.tmp
166 check-pve
: prepare-check-env
test.img
167 rm -f cd-info.
test; $(MAKE
) cd-info.
test
168 .
/proxmox-low-level-installer dump-env
-t
test.img
169 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
171 check-pve-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
172 rm -f cd-info.
test; $(MAKE
) cd-info.
test
173 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
174 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
176 check-pve-tui
: prepare-check-env
test.img
177 rm -f cd-info.
test; $(MAKE
) cd-info.
test
178 .
/proxmox-low-level-installer dump-env
-t
test.img
179 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
181 check-pve-tui-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
182 rm -f cd-info.
test; $(MAKE
) cd-info.
test
183 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
184 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
186 prepare-check-pmg
: prepare-check-env
test.img
187 rm -f cd-info.
test; $(MAKE
) \
189 PRODUCTLONG
="Proxmox Mail Gateway" \
190 ISONAME
='proxmox-mail-gateway' \
192 .
/proxmox-low-level-installer dump-env
-t
test.img
194 check-pmg
: prepare-check-pmg
195 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
197 check-pmg-tui
: prepare-check-pmg
198 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
200 prepare-check-pbs
: prepare-check-env
test.img
201 rm -f cd-info.
test; $(MAKE
) \
203 PRODUCTLONG
='Proxmox Backup Server' \
204 ISONAME
='proxmox-backup-server' \
206 .
/proxmox-low-level-installer dump-env
-t
test.img
208 check-pbs
: prepare-check-pbs
209 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
211 check-pbs-tui
: prepare-check-pbs
212 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
216 rm -rf target build
$(PACKAGE
)-[0-9]* testdir
217 rm -f
$(PACKAGE
)*.
tar* *.deb packages packages.tmp
*.build
*.dsc
*.buildinfo
*.changes
218 rm -f
test*.img pve-final.pkglist country.dat final.pkglist cd-info.
test
219 find .
-name
'*~' -exec
rm {} ';'