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
))
27 fake-start-stop-daemon \
36 rm -rf
$@
$@.tmp
; mkdir
$@.tmp
49 proxmox-low-level-installer \
50 proxmox-tui-installer
/ \
51 proxmox-installer-common
/ \
58 country.dat
: country.pl
59 .
/country.pl
> country.dat.tmp
60 mv country.dat.tmp country.dat
64 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
67 test-
$(DEB
): $(INSTALLER_SOURCES
)
68 rsync
--exclude
='test*.img' --exclude
='*.deb' --exclude
='build' -a
* build
69 cd build
; dpkg-buildpackage
-b
-us
-uc
-nc
78 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
83 .PHONY
: prepare-test-env
84 prepare-test-env
: cd-info.
test country.dat
test.img
86 mkdir
-p testdir
/var
/lib
/proxmox-installer
/
87 cp
-v country.dat testdir
/var
/lib
/proxmox-installer
/
88 .
/proxmox-low-level-installer
-t
test.img dump-env
91 test: prepare-test-env
92 shellcheck
$(SHELL_SCRIPTS
)
94 $(CARGO
) test --workspace
$(CARGO_BUILD_ARGS
)
97 VARLIBDIR
=$(DESTDIR
)/var
/lib
/proxmox-installer
98 HTMLDIR
=$(VARLIBDIR
)/html
/common
101 install: $(INSTALLER_SOURCES
) $(CARGO_COMPILEDIR
)/proxmox-tui-installer
102 $(MAKE
) -C banner
install
103 $(MAKE
) -C Proxmox
install
104 install -D
-m
644 interfaces
$(DESTDIR
)/etc
/network
/interfaces
105 install -D
-m
755 fake-start-stop-daemon
$(VARLIBDIR
)/fake-start-stop-daemon
106 install -D
-m
755 policy-disable-rc.d
$(VARLIBDIR
)/policy-disable-rc.d
107 install -D
-m
644 country.dat
$(VARLIBDIR
)/country.dat
108 install -D
-m
755 unconfigured.sh
$(DESTDIR
)/sbin
/unconfigured.sh
109 install -D
-m
755 proxinstall
$(DESTDIR
)/usr
/bin
/proxinstall
110 install -D
-m
755 proxmox-low-level-installer
$(DESTDIR
)/$(BINDIR
)/proxmox-low-level-installer
111 $(foreach i
,$(USR_BIN
), install -m755
$(CARGO_COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
112 install -D
-m
755 checktime
$(DESTDIR
)/usr
/bin
/checktime
113 install -D
-m
644 xinitrc
$(DESTDIR
)/.xinitrc
114 install -D
-m
755 spice-vdagent.sh
$(DESTDIR
)/.spice-vdagent.sh
115 install -D
-m
644 Xdefaults
$(DESTDIR
)/.Xdefaults
117 $(COMPILED_BINS
): cargo-build
120 $(CARGO
) build
--package proxmox-tui-installer
--bin proxmox-tui-installer
$(CARGO_BUILD_ARGS
)
122 %-banner.png
: %-banner.svg
123 rsvg-convert
-o
$@
$<
126 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
128 tar cf
- $(DEB
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
,pmg
,pbs
--dist $(UPLOAD_DIST
)
136 .PHONY
: prepare-check-env
137 prepare-check-env
: test-
$(DEB
)
139 dpkg
-X test-
$(DEB
) testdir
140 mkdir
-p testdir
/run
/proxmox-installer
/
142 cd-info.
test: PRODUCT ?
= pve
144 printf
'%s\n' "PRODUCT='$(or $(PRODUCT), pve)'" >$@.tmp
145 printf
'%s\n' "PRODUCTLONG='$(or $(PRODUCTLONG), Proxmox VE)'" >>$@.tmp
146 printf
'%s\n' "RELEASE='$(or $(RELEASE), 42.1)'" >>$@.tmp
147 printf
'%s\n' "ISORELEASE='$(or $(ISORELEASE), 1)'" >>$@.tmp
148 printf
'%s\n' "ISONAME='$(or $(ISONAME), proxmox-ve)'" >>$@.tmp
151 check-pve
: prepare-check-env
test.img
152 rm -f cd-info.
test; $(MAKE
) cd-info.
test
153 .
/proxmox-low-level-installer dump-env
-t
test.img
154 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
156 check-pve-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
157 rm -f cd-info.
test; $(MAKE
) cd-info.
test
158 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
159 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
161 check-pve-tui
: prepare-check-env
test.img
162 rm -f cd-info.
test; $(MAKE
) cd-info.
test
163 .
/proxmox-low-level-installer dump-env
-t
test.img
164 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
166 check-pve-tui-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
167 rm -f cd-info.
test; $(MAKE
) cd-info.
test
168 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
169 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
171 prepare-check-pmg
: prepare-check-env
test.img
172 rm -f cd-info.
test; $(MAKE
) \
174 PRODUCTLONG
="Proxmox Mail Gateway" \
175 ISONAME
='proxmox-mail-gateway' \
177 .
/proxmox-low-level-installer dump-env
-t
test.img
179 check-pmg
: prepare-check-pmg
180 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
182 check-pmg-tui
: prepare-check-pmg
183 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
185 prepare-check-pbs
: prepare-check-env
test.img
186 rm -f cd-info.
test; $(MAKE
) \
188 PRODUCTLONG
='Proxmox Backup Server' \
189 ISONAME
='proxmox-backup-server' \
191 .
/proxmox-low-level-installer dump-env
-t
test.img
193 check-pbs
: prepare-check-pbs
194 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
196 check-pbs-tui
: prepare-check-pbs
197 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
201 rm -rf target build
$(PACKAGE
)-[0-9]* testdir
202 rm -f
$(PACKAGE
)*.
tar* *.deb packages packages.tmp
*.build
*.dsc
*.buildinfo
*.changes
203 rm -f
test*.img pve-final.pkglist country.dat final.pkglist cd-info.
test
204 find .
-name
'*~' -exec
rm {} ';'