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
21 USR_BIN
:= proxmox-tui-installer
24 $(addprefix $(CARGO_COMPILEDIR
)/,$(USR_BIN
))
29 rm -rf
$@
$@.tmp
; mkdir
$@.tmp
39 fake-start-stop-daemon \
44 proxmox-low-level-installer \
45 proxmox-tui-installer
/ \
46 proxmox-installer-common
/ \
55 country.dat
: country.pl
56 .
/country.pl
> country.dat.tmp
57 mv country.dat.tmp country.dat
61 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
64 test-
$(DEB
): $(INSTALLER_SOURCES
)
65 rsync
--exclude
='test*.img' --exclude
='*.deb' --exclude
='build' -a
* build
66 cd build
; dpkg-buildpackage
-b
-us
-uc
-nc
75 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
83 $(CARGO
) test --workspace
$(CARGO_BUILD_ARGS
)
86 VARLIBDIR
=$(DESTDIR
)/var
/lib
/proxmox-installer
87 HTMLDIR
=$(VARLIBDIR
)/html
/common
90 install: $(INSTALLER_SOURCES
) $(CARGO_COMPILEDIR
)/proxmox-tui-installer
91 $(MAKE
) -C banner
install
92 $(MAKE
) -C Proxmox
install
93 install -D
-m
644 interfaces
$(DESTDIR
)/etc
/network
/interfaces
94 install -D
-m
755 fake-start-stop-daemon
$(VARLIBDIR
)/fake-start-stop-daemon
95 install -D
-m
755 policy-disable-rc.d
$(VARLIBDIR
)/policy-disable-rc.d
96 install -D
-m
644 country.dat
$(VARLIBDIR
)/country.dat
97 install -D
-m
755 unconfigured.sh
$(DESTDIR
)/sbin
/unconfigured.sh
98 install -D
-m
755 proxinstall
$(DESTDIR
)/usr
/bin
/proxinstall
99 install -D
-m
755 proxmox-low-level-installer
$(DESTDIR
)/$(BINDIR
)/proxmox-low-level-installer
100 $(foreach i
,$(USR_BIN
), install -m755
$(CARGO_COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/)
101 install -D
-m
755 checktime
$(DESTDIR
)/usr
/bin
/checktime
102 install -D
-m
644 xinitrc
$(DESTDIR
)/.xinitrc
103 install -D
-m
755 spice-vdagent.sh
$(DESTDIR
)/.spice-vdagent.sh
104 install -D
-m
644 Xdefaults
$(DESTDIR
)/.Xdefaults
106 $(COMPILED_BINS
): cargo-build
109 $(CARGO
) build
--package proxmox-tui-installer
--bin proxmox-tui-installer
$(CARGO_BUILD_ARGS
)
111 %-banner.png
: %-banner.svg
112 rsvg-convert
-o
$@
$<
115 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
117 tar cf
- $(DEB
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
,pmg
,pbs
--dist $(UPLOAD_DIST
)
125 .PHONY
: prepare-check-env
126 prepare-check-env
: test-
$(DEB
)
128 dpkg
-X test-
$(DEB
) testdir
129 mkdir
-p testdir
/run
/proxmox-installer
/
131 cd-info.
test: PRODUCT ?
= pve
133 printf
'%s\n' "PRODUCT='$(or $(PRODUCT), pve)'" >$@.tmp
134 printf
'%s\n' "PRODUCTLONG='$(or $(PRODUCTLONG), Proxmox VE)'" >>$@.tmp
135 printf
'%s\n' "RELEASE='$(or $(RELEASE), 42.1)'" >>$@.tmp
136 printf
'%s\n' "ISORELEASE='$(or $(ISORELEASE), 1)'" >>$@.tmp
137 printf
'%s\n' "ISONAME='$(or $(ISONAME), proxmox-ve)'" >>$@.tmp
140 check-pve
: prepare-check-env
test.img
141 rm -f cd-info.
test; $(MAKE
) cd-info.
test
142 .
/proxmox-low-level-installer dump-env
-t
test.img
143 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
145 check-pve-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
146 rm -f cd-info.
test; $(MAKE
) cd-info.
test
147 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
148 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
150 check-pve-tui
: prepare-check-env
test.img
151 rm -f cd-info.
test; $(MAKE
) cd-info.
test
152 .
/proxmox-low-level-installer dump-env
-t
test.img
153 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
155 check-pve-tui-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
156 rm -f cd-info.
test; $(MAKE
) cd-info.
test
157 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
158 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
160 prepare-check-pmg
: prepare-check-env
test.img
161 rm -f cd-info.
test; $(MAKE
) \
163 PRODUCTLONG
="Proxmox Mail Gateway" \
164 ISONAME
='proxmox-mail-gateway' \
166 .
/proxmox-low-level-installer dump-env
-t
test.img
168 check-pmg
: prepare-check-pmg
169 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
171 check-pmg-tui
: prepare-check-pmg
172 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
174 prepare-check-pbs
: prepare-check-env
test.img
175 rm -f cd-info.
test; $(MAKE
) \
177 PRODUCTLONG
='Proxmox Backup Server' \
178 ISONAME
='proxmox-backup-server' \
180 .
/proxmox-low-level-installer dump-env
-t
test.img
182 check-pbs
: prepare-check-pbs
183 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
185 check-pbs-tui
: prepare-check-pbs
186 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
190 rm -rf target build
$(PACKAGE
)-[0-9]* testdir
191 rm -f
$(PACKAGE
)*.
tar* *.deb packages packages.tmp
*.build
*.dsc
*.buildinfo
*.changes
192 rm -f
test*.img pve-final.pkglist country.dat final.pkglist cd-info.
test
193 find .
-name
'*~' -exec
rm {} ';'