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\
23 proxmox-auto-installer
26 $(addprefix $(CARGO_COMPILEDIR
)/,$(USR_BIN
))
29 fake-start-stop-daemon \
38 rm -rf
$@
$@.tmp
; mkdir
$@.tmp
51 proxmox-low-level-installer \
52 proxmox-auto-installer
/ \
53 proxmox-tui-installer
/ \
54 proxmox-installer-common
/ \
61 country.dat
: country.pl
62 .
/country.pl
> country.dat.tmp
63 mv country.dat.tmp country.dat
67 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
70 test-
$(DEB
): $(INSTALLER_SOURCES
)
71 rsync
--exclude
='test*.img' --exclude
='*.deb' --exclude
='build' -a
* build
72 cd build
; dpkg-buildpackage
-b
-us
-uc
-nc
81 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
86 .PHONY
: prepare-test-env
87 prepare-test-env
: cd-info.
test country.dat
test.img
89 mkdir
-p testdir
/var
/lib
/proxmox-installer
/
90 cp
-v country.dat testdir
/var
/lib
/proxmox-installer
/
91 .
/proxmox-low-level-installer
-t
test.img dump-env
94 test: prepare-test-env
95 shellcheck
$(SHELL_SCRIPTS
)
97 $(CARGO
) test --workspace
$(CARGO_BUILD_ARGS
)
100 VARLIBDIR
=$(DESTDIR
)/var
/lib
/proxmox-installer
101 HTMLDIR
=$(VARLIBDIR
)/html
/common
104 install: $(INSTALLER_SOURCES
) $(COMPILED_BINS
)
105 $(MAKE
) -C banner
install
106 $(MAKE
) -C Proxmox
install
107 install -D
-m
644 interfaces
$(DESTDIR
)/etc
/network
/interfaces
108 install -D
-m
755 fake-start-stop-daemon
$(VARLIBDIR
)/fake-start-stop-daemon
109 install -D
-m
755 policy-disable-rc.d
$(VARLIBDIR
)/policy-disable-rc.d
110 install -D
-m
644 country.dat
$(VARLIBDIR
)/country.dat
111 install -D
-m
755 unconfigured.sh
$(DESTDIR
)/sbin
/unconfigured.sh
112 install -D
-m
755 proxinstall
$(DESTDIR
)/usr
/bin
/proxinstall
113 install -D
-m
755 proxmox-low-level-installer
$(DESTDIR
)/$(BINDIR
)/proxmox-low-level-installer
114 $(foreach i
,$(USR_BIN
), install -m755
$(CARGO_COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
115 install -D
-m
755 checktime
$(DESTDIR
)/usr
/bin
/checktime
116 install -D
-m
644 xinitrc
$(DESTDIR
)/.xinitrc
117 install -D
-m
755 spice-vdagent.sh
$(DESTDIR
)/.spice-vdagent.sh
118 install -D
-m
644 Xdefaults
$(DESTDIR
)/.Xdefaults
120 $(COMPILED_BINS
): cargo-build
123 $(CARGO
) build
--package proxmox-tui-installer
--bin proxmox-tui-installer \
124 --package proxmox-auto-installer
--bin proxmox-auto-installer
$(CARGO_BUILD_ARGS
)
126 %-banner.png
: %-banner.svg
127 rsvg-convert
-o
$@
$<
130 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
132 tar cf
- $(DEB
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
,pmg
,pbs
--dist $(UPLOAD_DIST
)
140 .PHONY
: prepare-check-env
141 prepare-check-env
: test-
$(DEB
)
143 dpkg
-X test-
$(DEB
) testdir
144 mkdir
-p testdir
/run
/proxmox-installer
/
146 cd-info.
test: PRODUCT ?
= pve
148 printf
'%s\n' "PRODUCT='$(or $(PRODUCT), pve)'" >$@.tmp
149 printf
'%s\n' "PRODUCTLONG='$(or $(PRODUCTLONG), Proxmox VE)'" >>$@.tmp
150 printf
'%s\n' "RELEASE='$(or $(RELEASE), 42.1)'" >>$@.tmp
151 printf
'%s\n' "ISORELEASE='$(or $(ISORELEASE), 1)'" >>$@.tmp
152 printf
'%s\n' "ISONAME='$(or $(ISONAME), proxmox-ve)'" >>$@.tmp
155 check-pve
: prepare-check-env
test.img
156 rm -f cd-info.
test; $(MAKE
) cd-info.
test
157 .
/proxmox-low-level-installer dump-env
-t
test.img
158 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
160 check-pve-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
161 rm -f cd-info.
test; $(MAKE
) cd-info.
test
162 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
163 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
165 check-pve-tui
: prepare-check-env
test.img
166 rm -f cd-info.
test; $(MAKE
) cd-info.
test
167 .
/proxmox-low-level-installer dump-env
-t
test.img
168 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
170 check-pve-tui-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
171 rm -f cd-info.
test; $(MAKE
) cd-info.
test
172 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
173 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
175 prepare-check-pmg
: prepare-check-env
test.img
176 rm -f cd-info.
test; $(MAKE
) \
178 PRODUCTLONG
="Proxmox Mail Gateway" \
179 ISONAME
='proxmox-mail-gateway' \
181 .
/proxmox-low-level-installer dump-env
-t
test.img
183 check-pmg
: prepare-check-pmg
184 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
186 check-pmg-tui
: prepare-check-pmg
187 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
189 prepare-check-pbs
: prepare-check-env
test.img
190 rm -f cd-info.
test; $(MAKE
) \
192 PRODUCTLONG
='Proxmox Backup Server' \
193 ISONAME
='proxmox-backup-server' \
195 .
/proxmox-low-level-installer dump-env
-t
test.img
197 check-pbs
: prepare-check-pbs
198 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
200 check-pbs-tui
: prepare-check-pbs
201 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
205 rm -rf target build
$(PACKAGE
)-[0-9]* testdir
206 rm -f
$(PACKAGE
)*.
tar* *.deb packages packages.tmp
*.build
*.dsc
*.buildinfo
*.changes
207 rm -f
test*.img pve-final.pkglist country.dat final.pkglist cd-info.
test
208 find .
-name
'*~' -exec
rm {} ';'