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
80 .PHONY
: prepare-test-env
81 prepare-test-env
: cd-info.
test country.dat
test.img
83 mkdir
-p testdir
/var
/lib
/proxmox-installer
/
84 cp
-v country.dat testdir
/var
/lib
/proxmox-installer
/
85 .
/proxmox-low-level-installer
-t
test.img dump-env
88 test: prepare-test-env
90 $(CARGO
) test --workspace
$(CARGO_BUILD_ARGS
)
93 VARLIBDIR
=$(DESTDIR
)/var
/lib
/proxmox-installer
94 HTMLDIR
=$(VARLIBDIR
)/html
/common
97 install: $(INSTALLER_SOURCES
) $(CARGO_COMPILEDIR
)/proxmox-tui-installer
98 $(MAKE
) -C banner
install
99 $(MAKE
) -C Proxmox
install
100 install -D
-m
644 interfaces
$(DESTDIR
)/etc
/network
/interfaces
101 install -D
-m
755 fake-start-stop-daemon
$(VARLIBDIR
)/fake-start-stop-daemon
102 install -D
-m
755 policy-disable-rc.d
$(VARLIBDIR
)/policy-disable-rc.d
103 install -D
-m
644 country.dat
$(VARLIBDIR
)/country.dat
104 install -D
-m
755 unconfigured.sh
$(DESTDIR
)/sbin
/unconfigured.sh
105 install -D
-m
755 proxinstall
$(DESTDIR
)/usr
/bin
/proxinstall
106 install -D
-m
755 proxmox-low-level-installer
$(DESTDIR
)/$(BINDIR
)/proxmox-low-level-installer
107 $(foreach i
,$(USR_BIN
), install -m755
$(CARGO_COMPILEDIR
)/$(i
) $(DESTDIR
)$(BINDIR
)/ ;)
108 install -D
-m
755 checktime
$(DESTDIR
)/usr
/bin
/checktime
109 install -D
-m
644 xinitrc
$(DESTDIR
)/.xinitrc
110 install -D
-m
755 spice-vdagent.sh
$(DESTDIR
)/.spice-vdagent.sh
111 install -D
-m
644 Xdefaults
$(DESTDIR
)/.Xdefaults
113 $(COMPILED_BINS
): cargo-build
116 $(CARGO
) build
--package proxmox-tui-installer
--bin proxmox-tui-installer
$(CARGO_BUILD_ARGS
)
118 %-banner.png
: %-banner.svg
119 rsvg-convert
-o
$@
$<
122 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
124 tar cf
- $(DEB
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pve
,pmg
,pbs
--dist $(UPLOAD_DIST
)
132 .PHONY
: prepare-check-env
133 prepare-check-env
: test-
$(DEB
)
135 dpkg
-X test-
$(DEB
) testdir
136 mkdir
-p testdir
/run
/proxmox-installer
/
138 cd-info.
test: PRODUCT ?
= pve
140 printf
'%s\n' "PRODUCT='$(or $(PRODUCT), pve)'" >$@.tmp
141 printf
'%s\n' "PRODUCTLONG='$(or $(PRODUCTLONG), Proxmox VE)'" >>$@.tmp
142 printf
'%s\n' "RELEASE='$(or $(RELEASE), 42.1)'" >>$@.tmp
143 printf
'%s\n' "ISORELEASE='$(or $(ISORELEASE), 1)'" >>$@.tmp
144 printf
'%s\n' "ISONAME='$(or $(ISONAME), proxmox-ve)'" >>$@.tmp
147 check-pve
: prepare-check-env
test.img
148 rm -f cd-info.
test; $(MAKE
) cd-info.
test
149 .
/proxmox-low-level-installer dump-env
-t
test.img
150 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
152 check-pve-multidisks
: prepare-check-env
test.img test2.img test3.img test4.img test5.big.img
153 rm -f cd-info.
test; $(MAKE
) cd-info.
test
154 .
/proxmox-low-level-installer dump-env
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
155 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
157 check-pve-tui
: 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 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
162 check-pve-tui-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 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
,test2.img
,test3.img
,test4.img
,test5.big.img
167 prepare-check-pmg
: prepare-check-env
test.img
168 rm -f cd-info.
test; $(MAKE
) \
170 PRODUCTLONG
="Proxmox Mail Gateway" \
171 ISONAME
='proxmox-mail-gateway' \
173 .
/proxmox-low-level-installer dump-env
-t
test.img
175 check-pmg
: prepare-check-pmg
176 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
178 check-pmg-tui
: prepare-check-pmg
179 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
181 prepare-check-pbs
: prepare-check-env
test.img
182 rm -f cd-info.
test; $(MAKE
) \
184 PRODUCTLONG
='Proxmox Backup Server' \
185 ISONAME
='proxmox-backup-server' \
187 .
/proxmox-low-level-installer dump-env
-t
test.img
189 check-pbs
: prepare-check-pbs
190 G_SLICE
=always-malloc perl
-I testdir
/usr
/share
/perl5 testdir
/usr
/bin
/proxinstall
-t
test.img
192 check-pbs-tui
: prepare-check-pbs
193 testdir
/usr
/bin
/proxmox-tui-installer
-t
test.img
2>testdir
/run
/stderr
197 rm -rf target build
$(PACKAGE
)-[0-9]* testdir
198 rm -f
$(PACKAGE
)*.
tar* *.deb packages packages.tmp
*.build
*.dsc
*.buildinfo
*.changes
199 rm -f
test*.img pve-final.pkglist country.dat final.pkglist cd-info.
test
200 find .
-name
'*~' -exec
rm {} ';'