proxmox-perl-rs/common/pkg/Proxmox/Lib/Common.pm
Wolfgang Bumiller 932d602d33 major build system upgrade
- Add a 'common' symlink inside pve-rs/pmg-rs
- Have the `build/` target replace it with a dir and copy
  `common/src` into it.
- Depend on perlmod-bin to generate the perl package files.

now pve-rs and pmg-rs can be built directly from within via
dpkg-buildpackage

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-10 11:44:44 +02:00

44 lines
920 B
Perl

package Proxmox::Lib::Common;
=head1 NAME
Proxmox::Lib::Common - base module for rust bindings common between PVE and PMG
=head1 SYNOPSIS
package Proxmox::RS::CalendarEvent;
use base 'Proxmox::Lib::Common';
BEGIN { __PACKAGE__->bootstrap(); }
1;
=head1 DESCRIPTION
This is the base modules for bindings which are provided by both PVE and PMG. This will ensure that
either Proxmox::Lib::PVE or Proxmox::Lib::PMG have been loaded (in that order) and then use
whichever was loaded.
=cut
use vars qw(@ISA);
sub library {
return '-current';
}
BEGIN {
my $data = ($::{'proxmox-rs-library'} //= {});
my $base = $data->{-package};
if ($base) {
push @ISA, $base;
} else {
eval { require Proxmox::Lib::PVE and push @ISA, 'Proxmox::Lib::PVE'; };
eval { require Proxmox::Lib::PMG and push @ISA, 'Proxmox::Lib::PMG'; } if $@;
die $@ if $@;
}
}
1;