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 DSC
=$(PACKAGE
)_
$(DEB_VERSION
).dsc
10 ifeq ($(BUILD_MODE
), release
)
11 CARGO_BUILD_ARGS
+= --release
12 CARGO_COMPILEDIR
:= target
/release
14 CARGO_COMPILEDIR
:= target
/debug
17 INSTALLER_SOURCES
=$(shell git ls-files
) country.dat
20 BINDIR
= $(PREFIX
)/bin
22 proxmox-tui-installer\
24 proxmox-auto-installer
27 $(addprefix $(CARGO_COMPILEDIR
)/,$(USR_BIN
))
30 fake-start-stop-daemon \
39 rm -rf
$@
$@.tmp
; mkdir
$@.tmp
52 proxmox-low-level-installer \
53 proxmox-auto-installer
/ \
54 proxmox-tui-installer
/ \
55 proxmox-installer-common
/ \
62 country.dat
: country.pl
63 .
/country.pl
> country.dat.tmp
64 mv country.dat.tmp country.dat
68 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
71 test-
$(DEB
): $(INSTALLER_SOURCES
)
72 rsync
--exclude
='test*.img' --exclude
='*.deb' --exclude
='build' -a
* build
73 cd build
; dpkg-buildpackage
-b
-us
-uc
-nc
82 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
87 .PHONY
: prepare-test-env
88 prepare-test-env
: cd-info.
test country.dat
test.img
90 mkdir
-p testdir
/var
/lib
/proxmox-installer
/
91 cp
-v country.dat testdir
/var
/lib
/proxmox-installer
/
92 .
/proxmox-low-level-installer
-t
test.img dump-env
95 test: prepare-test-env
96 shellcheck
$(SHELL_SCRIPTS
)
98 $(CARGO
) test --workspace
$(CARGO_BUILD_ARGS
)
101 VARLIBDIR
=$(DESTDIR
)/var
/lib
/proxmox-installer
102 HTMLDIR
=$(VARLIBDIR
)/html
/common
105 install: $(INSTALLER_SOURCES
) $(COMPILED_BINS
)
106 $(MAKE
) -C banner
install
107 $(MAKE
) -C Proxmox
install
108 install -D
-m
644 interfaces
$(DESTDIR
)/etc
/network
/interfaces
109 install -D
-m
755 fake-start-stop-daemon
$(VARLIBDIR
)/fake-start-stop-daemon
110 install -D
-m
755 policy-disable-rc.d
$(VARLIBDIR
)/policy-disable-rc.d
111 install -D
-m
644 country.dat
$(VARLIBDIR
)/country.dat
112 install -D
-m
755 unconfigured.sh
$(DESTDIR
)/sbin
/unconfigured.sh
113 install -D
-m
755 proxinstall
$(DESTDIR
)/usr
/bin
/proxinstall
114 install -D
-m
755 proxmox-low-level-installer
$(DESTDIR
)/$(BINDIR
)/proxmox-low-level-installer
115 $(foreach i
,$(USR_BIN
), install -m755
$(CARGO_COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
116 install -D
-m
755 checktime
$(DESTDIR
)/usr
/bin
/checktime
117 install -D
-m
644 xinitrc
$(DESTDIR
)/.xinitrc
118 install -D
-m
755 spice-vdagent.sh
$(DESTDIR
)/.spice-vdagent.sh
119 install -D
-m
644 Xdefaults
$(DESTDIR
)/.Xdefaults
121 $(COMPILED_BINS
): cargo-build
124 $(CARGO
) build
--package proxmox-tui-installer
--bin proxmox-tui-installer \
125 --package proxmox-auto-installer
--bin proxmox-auto-installer \
126 --bin proxmox-fetch-answer
$(CARGO_BUILD_ARGS
)
128 %-banner.png
: %-banner.svg
129 rsvg-convert
-o
$@
$<
132 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
134 tar cf
- $(DEB
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
,pmg
,pbs
--dist $(UPLOAD_DIST
)
142 .PHONY
: prepare-check-env
143 prepare-check-env
: test-
$(DEB
)
145 dpkg
-X test-
$(DEB
) testdir
146 mkdir
-p testdir
/run
/proxmox-installer
/
148 cd-info.
test: PRODUCT ?
= pve
150 printf
'%s\n' "PRODUCT='$(or $(PRODUCT), pve)'" >$@.tmp
151 printf
'%s\n' "PRODUCTLONG='$(or $(PRODUCTLONG), Proxmox VE)'" >>$@.tmp
152 printf
'%s\n' "RELEASE='$(or $(RELEASE), 42.1)'" >>$@.tmp
153 printf
'%s\n' "ISORELEASE='$(or $(ISORELEASE), 1)'" >>$@.tmp
154 printf
'%s\n' "ISONAME='$(or $(ISONAME), proxmox-ve)'" >>$@.tmp
157 check-pve
: prepare-check-env
test.img
158 rm -f cd-info.
test; $(MAKE
) cd-info.
test
159 .
/proxmox-low-level-installer dump-env
-t
test.img
160 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
162 check-pve-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
163 rm -f cd-info.
test; $(MAKE
) cd-info.
test
164 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
165 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
167 check-pve-tui
: prepare-check-env
test.img
168 rm -f cd-info.
test; $(MAKE
) cd-info.
test
169 .
/proxmox-low-level-installer dump-env
-t
test.img
170 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
172 check-pve-tui-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
173 rm -f cd-info.
test; $(MAKE
) cd-info.
test
174 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
175 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
177 prepare-check-pmg
: prepare-check-env
test.img
178 rm -f cd-info.
test; $(MAKE
) \
180 PRODUCTLONG
="Proxmox Mail Gateway" \
181 ISONAME
='proxmox-mail-gateway' \
183 .
/proxmox-low-level-installer dump-env
-t
test.img
185 check-pmg
: prepare-check-pmg
186 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
188 check-pmg-tui
: prepare-check-pmg
189 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
191 prepare-check-pbs
: prepare-check-env
test.img
192 rm -f cd-info.
test; $(MAKE
) \
194 PRODUCTLONG
='Proxmox Backup Server' \
195 ISONAME
='proxmox-backup-server' \
197 .
/proxmox-low-level-installer dump-env
-t
test.img
199 check-pbs
: prepare-check-pbs
200 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
202 check-pbs-tui
: prepare-check-pbs
203 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
207 rm -rf target build
$(PACKAGE
)-[0-9]* testdir
208 rm -f
$(PACKAGE
)*.
tar* *.deb packages packages.tmp
*.build
*.dsc
*.buildinfo
*.changes
209 rm -f
test*.img pve-final.pkglist country.dat final.pkglist cd-info.
test
210 find .
-name
'*~' -exec
rm {} ';'