From ab97da2c0db86ede9ebc13c5ac11a603d5d98978 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sun, 2 Apr 2023 11:20:43 +0200 Subject: [PATCH] move ProxmoxInstallerSetup to Proxmox::Install::Setup in preparation of splitting out more code Signed-off-by: Thomas Lamprecht --- Makefile | 1 + .../Install/Setup.pm | 2 +- Proxmox/Makefile | 18 ++++++++++++++++++ debian/rules | 7 ------- proxinstall | 4 ++-- 5 files changed, 22 insertions(+), 10 deletions(-) rename ProxmoxInstallerSetup.pm => Proxmox/Install/Setup.pm (97%) create mode 100644 Proxmox/Makefile diff --git a/Makefile b/Makefile index 72f9202..5ded58b 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ HTMLDIR=$(VARLIBDIR)/html/common .PHONY: install install: ${INSTALLER_SOURCES} ${HTML_COMMON_SOURCES} ${HTML_SOURCES} $(MAKE) -C banner install + $(MAKE) -C Proxmox install install -D -m 644 interfaces ${DESTDIR}/etc/network/interfaces install -D -m 755 fake-start-stop-daemon ${VARLIBDIR}/fake-start-stop-daemon install -D -m 755 policy-disable-rc.d $(VARLIBDIR)/policy-disable-rc.d diff --git a/ProxmoxInstallerSetup.pm b/Proxmox/Install/Setup.pm similarity index 97% rename from ProxmoxInstallerSetup.pm rename to Proxmox/Install/Setup.pm index d13838b..18fd690 100644 --- a/ProxmoxInstallerSetup.pm +++ b/Proxmox/Install/Setup.pm @@ -1,4 +1,4 @@ -package ProxmoxInstallerSetup; +package Proxmox::Install::Setup; use strict; use warnings; diff --git a/Proxmox/Makefile b/Proxmox/Makefile new file mode 100644 index 0000000..028010d --- /dev/null +++ b/Proxmox/Makefile @@ -0,0 +1,18 @@ +all: + +DESTDIR= +VARLIBDIR=$(DESTDIR)/var/lib/proxmox-installer +PERL5DIR=$(DESTDIR)/usr/share/perl5/Proxmox + +#PERL_MODULES=$(shell git ls-files . | grep '.pm$') +PERL_MODULES=\ + Install/Setup.pm \ + +.PHONY: install +install: $(PERL_MODULES) + for f in $(PERL_MODULES); \ + do install -D -m 644 "$$f" "$(PERL5DIR)/$$f"; \ + done + +.PHONY: clean +clean: diff --git a/debian/rules b/debian/rules index be74737..462e4b2 100755 --- a/debian/rules +++ b/debian/rules @@ -4,16 +4,9 @@ #DH_VERBOSE = 1 -SETUPFN = "/usr/share/perl5/ProxmoxInstallerSetup.pm" - %: dh $@ -# FIXME: could all be in d/install or in makefile?! -override_dh_auto_install: - install -D -m 0644 ProxmoxInstallerSetup.pm $(CURDIR)/debian/proxmox-installer/${SETUPFN} - dh_auto_install --destdir debian/proxmox-installer - override_dh_missing: dh_missing --fail-missing diff --git a/proxinstall b/proxinstall index 86f2a8c..c5c62b3 100755 --- a/proxinstall +++ b/proxinstall @@ -23,7 +23,7 @@ use File::Path; use Time::HiRes; use POSIX ":sys_wait_h"; -use ProxmoxInstallerSetup; +use Proxmox::Install::Setup; if (!$ENV{G_SLICE} || $ENV{G_SLICE} ne "always-malloc") { die "do not use slice allocator (run with 'G_SLICE=always-malloc ./proxinstall ...')\n"; @@ -37,7 +37,7 @@ if (!GetOptions('testmode=s' => \$opt_testmode)) { $ENV{'LVM_SUPPRESS_FD_WARNINGS'} = '1'; -my ($setup, $cd_info) = ProxmoxInstallerSetup::setup(); +my ($setup, $cd_info) = Proxmox::Install::Setup::setup(); my $zfstestpool = "test_rpool"; my $zfspoolname = $opt_testmode ? $zfstestpool : 'rpool'; -- 2.39.5