From 6583f4d8409bf40ee0d2d36bdb2085c47d27b0bd Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 15 Nov 2022 13:16:51 +0100 Subject: [PATCH] buildsys: generate .pm files in packages Signed-off-by: Wolfgang Bumiller --- Makefile | 21 --------------------- common/pkg/Makefile | 11 +++++++++-- common/scripts | 1 + pmg-rs/Makefile | 10 +++++++++- pve-rs/Makefile | 11 +++++++++-- 5 files changed, 28 insertions(+), 26 deletions(-) create mode 120000 common/scripts diff --git a/Makefile b/Makefile index c19b2168..0a0befbd 100644 --- a/Makefile +++ b/Makefile @@ -33,24 +33,6 @@ endif pve pmg: $(CARGO) build $(CARGO_BUILD_ARGS) -p $@-rs -.PHONY: gen -gen: - perl ./scripts/genpackage.pl Common \ - Proxmox::RS::APT::Repositories \ - Proxmox::RS::CalendarEvent \ - Proxmox::RS::Subscription - perl ./scripts/genpackage.pl PVE \ - PVE::RS::APT::Repositories \ - PVE::RS::OpenId \ - PVE::RS::ResourceScheduling::Static \ - PVE::RS::TFA - perl ./scripts/genpackage.pl PMG \ - PMG::RS::APT::Repositories \ - PMG::RS::Acme \ - PMG::RS::CSR \ - PMG::RS::OpenId \ - PMG::RS::TFA - build: rm -rf build mkdir build @@ -61,9 +43,6 @@ build: cp -a ./pmg-rs ./build cp -a ./Proxmox ./build cp defines.mk ./build - $(MAKE) BUILD_MODE=release -C build -f ../Makefile gen - mv ./build/PVE ./build/pve-rs - mv ./build/PMG ./build/pmg-rs mv ./build/Proxmox ./build/common/pkg # The template.pm is required by the products to produce their Proxmox::Lib mkdir ./build/Proxmox diff --git a/common/pkg/Makefile b/common/pkg/Makefile index 8c71a0a6..bf22a7b4 100644 --- a/common/pkg/Makefile +++ b/common/pkg/Makefile @@ -12,11 +12,18 @@ DEB=${PACKAGE}_${DEB_VERSION}_${ARCH}.deb DESTDIR= -all: +# Point to any generated pm file (Proxmox/ dir is already present in this package) +Proxmox/RS/CalendarEvent.pm: ../scripts/genpackage.pl + perl ../scripts/genpackage.pl Common \ + Proxmox::RS::APT::Repositories \ + Proxmox::RS::CalendarEvent \ + Proxmox::RS::Subscription + +all: Proxmox/RS/CalendarEvent.pm true .PHONY: install -install: +install: Proxmox/RS/CalendarEvent.pm install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB) find PVE \! -type d -print -exec install -Dm644 '{}' $(DESTDIR)$(PERL_INSTALLVENDORLIB)'/{}' ';' find Proxmox \! -type d -print -exec install -Dm644 '{}' $(DESTDIR)$(PERL_INSTALLVENDORLIB)'/{}' ';' diff --git a/common/scripts b/common/scripts new file mode 120000 index 00000000..a339954d --- /dev/null +++ b/common/scripts @@ -0,0 +1 @@ +../scripts \ No newline at end of file diff --git a/pmg-rs/Makefile b/pmg-rs/Makefile index 0961172a..0143caa4 100644 --- a/pmg-rs/Makefile +++ b/pmg-rs/Makefile @@ -26,6 +26,14 @@ ifneq ($(BUILD_MODE), skip) cargo build $(CARGO_BUILD_ARGS) endif +PMG: ../scripts/genpackage.pl + perl ../scripts/genpackage.pl PMG \ + PMG::RS::APT::Repositories \ + PMG::RS::Acme \ + PMG::RS::CSR \ + PMG::RS::OpenId \ + PMG::RS::TFA + Proxmox/Lib/PMG.pm: ../Proxmox/Lib/template.pm mkdir -p Proxmox/Lib $(call package_template,PMG,pmg_rs,../) @@ -39,7 +47,7 @@ build: rsync -a debian Makefile Cargo.toml Cargo.lock src target PMG build/ .PHONY: install -install: target/release/libpmg_rs.so Proxmox/Lib/PMG.pm +install: target/release/libpmg_rs.so Proxmox/Lib/PMG.pm PMG install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto install -m644 target/release/libpmg_rs.so $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto/libpmg_rs.so install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB) diff --git a/pve-rs/Makefile b/pve-rs/Makefile index a63a42ba..68ff6dc8 100644 --- a/pve-rs/Makefile +++ b/pve-rs/Makefile @@ -22,11 +22,18 @@ ifeq ($(BUILD_MODE), release) CARGO_BUILD_ARGS += --release endif -all: Proxmox/Lib/PVE.pm +all: PVE Proxmox/Lib/PVE.pm ifneq ($(BUILD_MODE), skip) cargo build $(CARGO_BUILD_ARGS) endif +PVE: ../scripts/genpackage.pl + perl ../scripts/genpackage.pl PVE \ + PVE::RS::APT::Repositories \ + PVE::RS::OpenId \ + PVE::RS::ResourceScheduling::Static \ + PVE::RS::TFA + Proxmox/Lib/PVE.pm: ../Proxmox/Lib/template.pm mkdir -p Proxmox/Lib $(call package_template,PVE,pve_rs,../) @@ -40,7 +47,7 @@ build: rsync -a debian Makefile Cargo.toml Cargo.lock src target PVE build/ .PHONY: install -install: target/release/libpve_rs.so Proxmox/Lib/PVE.pm +install: target/release/libpve_rs.so Proxmox/Lib/PVE.pm PVE install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto install -m644 target/release/libpve_rs.so $(DESTDIR)$(PERL_INSTALLVENDORARCH)/auto/libpve_rs.so install -d -m755 $(DESTDIR)$(PERL_INSTALLVENDORLIB)