]> git.proxmox.com Git - pve-installer.git/blobdiff - Makefile
common: add ZFS `arc_max` installer setup option
[pve-installer.git] / Makefile
index ab0c8607132cc5e9834f525990ffab0fb948a12c..5e94c2998ca32682bfbf57b0aac6e9cd2a10a335 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@ all:
 $(BUILDDIR):
        rm -rf $@ $@.tmp; mkdir $@.tmp
        cp -a \
+         .cargo \
          Cargo.toml \
          Makefile \
          Proxmox/ \
@@ -42,7 +43,9 @@ $(BUILDDIR):
          proxinstall \
          proxmox-low-level-installer \
          proxmox-tui-installer/ \
+         proxmox-installer-common/ \
          spice-vdagent.sh \
+         test/ \
          unconfigured.sh \
          xinitrc \
          $@.tmp
@@ -59,7 +62,7 @@ $(DEB): $(BUILDDIR)
        lintian $(DEB)
 
 test-$(DEB): $(INSTALLER_SOURCES)
-       rsync --exclude='test*.img' -a * build
+       rsync --exclude='test*.img' --exclude='*.deb' --exclude='build' -a * build
        cd build; dpkg-buildpackage -b -us -uc -nc
        mv $(DEB) test-$(DEB)
 
@@ -74,6 +77,11 @@ $(DSC): $(BUILDDIR)
 sbuild: $(DSC)
        sbuild $(DSC)
 
+.PHONY: test
+test:
+       $(MAKE) -C test check
+       $(CARGO) test --workspace $(CARGO_BUILD_ARGS)
+
 DESTDIR=
 VARLIBDIR=$(DESTDIR)/var/lib/proxmox-installer
 HTMLDIR=$(VARLIBDIR)/html/common
@@ -95,7 +103,9 @@ install: $(INSTALLER_SOURCES) $(CARGO_COMPILEDIR)/proxmox-tui-installer
        install -D -m 755 spice-vdagent.sh $(DESTDIR)/.spice-vdagent.sh
        install -D -m 644 Xdefaults $(DESTDIR)/.Xdefaults
 
-$(COMPILED_BINS):
+$(COMPILED_BINS): cargo-build
+.PHONY: cargo-build
+cargo-build:
        $(CARGO) build --package proxmox-tui-installer --bin proxmox-tui-installer $(CARGO_BUILD_ARGS)
 
 %-banner.png: %-banner.svg
@@ -116,6 +126,7 @@ upload: $(DEB)
 prepare-check-env: test-$(DEB)
        rm -rf testdir
        dpkg -X test-$(DEB) testdir
+       mkdir -p testdir/run/proxmox-installer/
 
 cd-info.test: PRODUCT ?= pve
 cd-info.test:
@@ -128,37 +139,50 @@ cd-info.test:
 
 check-pve: prepare-check-env test.img
        rm -f cd-info.test; $(MAKE) cd-info.test
+       ./proxmox-low-level-installer dump-env -t
        G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
 
 check-pve-multidisks: prepare-check-env test.img test2.img test3.img test4.img test5.big.img
        rm -f cd-info.test; $(MAKE) cd-info.test
+       ./proxmox-low-level-installer dump-env -t
        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
 
 check-pve-tui: prepare-check-env test.img
        rm -f cd-info.test; $(MAKE) cd-info.test
        ./proxmox-low-level-installer dump-env -t
-       testdir/usr/bin/proxmox-tui-installer -t test.img
+       testdir/usr/bin/proxmox-tui-installer -t test.img 2>testdir/run/stderr
 
-check-pmg: prepare-check-env test.img
+prepare-check-pmg: prepare-check-env test.img
        rm -f cd-info.test; $(MAKE) \
            PRODUCT=pmg \
            PRODUCTLONG="Proxmox Mail Gateway" \
            ISONAME='proxmox-mail-gateway' \
            cd-info.test
+       ./proxmox-low-level-installer dump-env -t
+
+check-pmg: prepare-check-pmg
        G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
 
-check-pbs: prepare-check-env test.img
+check-pmg-tui: prepare-check-pmg
+       testdir/usr/bin/proxmox-tui-installer -t test.img 2>testdir/run/stderr
+
+prepare-check-pbs: prepare-check-env test.img
        rm -f cd-info.test; $(MAKE) \
            PRODUCT='pbs' \
            PRODUCTLONG='Proxmox Backup Server' \
            ISONAME='proxmox-backup-server' \
            cd-info.test
+       ./proxmox-low-level-installer dump-env -t
+
+check-pbs: prepare-check-pbs
        G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
 
+check-pbs-tui: prepare-check-pbs
+       testdir/usr/bin/proxmox-tui-installer -t test.img 2>testdir/run/stderr
 
 .phony: clean
 clean:
-       rm -rf target build $(PACKAGE)-[0-9]*
+       rm -rf target build $(PACKAGE)-[0-9]* testdir
        rm -f $(PACKAGE)*.tar* *.deb packages packages.tmp *.build *.dsc *.buildinfo *.changes
-       rm -f testdir test*.img pve-final.pkglist country.dat final.pkglist cd-info.test
+       rm -f test*.img pve-final.pkglist country.dat final.pkglist cd-info.test
        find . -name '*~' -exec rm {} ';'