2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2026-09-26 01:34:07 +00:00

fix: Update Sys-Virt package to libvirt 11 for el10

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-06-06 12:09:44 -03:00
parent a2378ba780
commit 2eb3574f35
5 changed files with 109 additions and 45 deletions
Binary file not shown.
-18
View File
@@ -1,18 +0,0 @@
--- Virt.xs 2009-03-27 15:45:33.000000000 -0400
+++ /root/Virt.xs 2009-04-10 09:08:00.000000000 -0400
@@ -1337,12 +1337,12 @@
virDomainPtr dom;
virConnectPtr destcon;
unsigned long flags;
- const char *dname;
- const char *uri;
+ const char *dname = SvPOK($arg) ? (char *)SvPV_nolen($arg) : NULL;
+ const char *uri = SvPOK($arg) ? (char *)SvPV_nolen($arg) : NULL;
unsigned long bandwidth;
CODE:
if ((RETVAL = virDomainMigrate(dom, destcon, flags, dname, uri, bandwidth)) == NULL) {
- _croak_error(virConnGetLastError(virDomainGetConnect(dom)));
+ _croak_error(virGetLastError());
}
OUTPUT:
RETVAL
Binary file not shown.
+18 -27
View File
@@ -1,11 +1,3 @@
#
# - Sys::Virt -
# This spec file was automatically generated by cpan2rpm [ver: 2.027]
# The following arguments were used:
# --version 0.2.0 --author 'Daniel P. Berrange <berrange@redhat.com>' Sys-Virt-0.2.0.tar.gz
# For more information on cpan2rpm please visit: http://perl.arix.com/
#
%define pkgname Sys-Virt
%define filelist %{pkgname}-%{version}-filelist
%define NVR %{pkgname}-%{version}-%{release}
@@ -13,8 +5,8 @@
name: perl-Sys-Virt
summary: Sys-Virt - Represent and manage a libvirt hypervisor connection
version: 0.2.0
release: 3%{?dist}
version: 11.10.0
release: 1%{?dist}
vendor: Daniel P. Berrange <berrange@redhat.com>
packager: Arix International <cpan2rpm@arix.com>
license: Artistic
@@ -22,16 +14,22 @@ group: Applications/CPAN
url: http://www.cpan.org
buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
prefix: %(echo %{_prefix})
source: Sys-Virt-0.2.0.tar.gz
patch0: Sys-Virt-fixes.patch
source: Sys-Virt-v%{version}.tar.gz
BuildRequires: gcc
BuildRequires: make
BuildRequires: perl-interpreter
BuildRequires: perl-devel
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(ExtUtils::CBuilder)
BuildRequires: perl(Module::Build)
BuildRequires: perl(XML::XPath)
BuildRequires: perl(XML::XPath::XMLParser)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(Sys::Hostname)
BuildRequires: perl-generators
BuildRequires: libvirt-devel
BuildRequires: pkgconfig(libvirt)
%description
The Sys::Virt module provides a Perl XS binding to the libvirt
@@ -39,25 +37,14 @@ virtual machine management APIs. This allows machines running
within arbitrary virtualization containers to be managed with
a consistent API.
#
# This package was generated automatically with the cpan2rpm
# utility. To get this software or for more information
# please visit: http://perl.arix.com/
#
%prep
%setup -q -n %{pkgname}-%{version}
%patch 0 -p0
chmod -R u+w %{_builddir}/%{pkgname}-%{version}
%setup -q -n %{pkgname}-v%{version}
chmod -R u+w %{_builddir}/%{pkgname}-v%{version}
%build
export PERL_USE_UNSAFE_INC=1
grep -rsl '^#!.*perl' . |
grep -v '.bak$' |xargs --no-run-if-empty \
%__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
CFLAGS="$RPM_OPT_FLAGS"
%{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '`
%{__make}
%{__make}
%if %maketest
%{__make} test
%endif
@@ -93,7 +80,7 @@ find %{buildroot}%{_prefix} \
%{__perl} -MFile::Find -le '
find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
print "%doc CHANGES INSTALL README LICENSE examples";
print "%doc Changes INSTALL README LICENSE examples";
for my $x (sort @dirs, @files) {
push @ret, $x unless indirs($x);
}
@@ -133,5 +120,9 @@ find %{buildroot}%{_prefix} \
%defattr(-,root,root)
%changelog
* Sat Jun 06 2026 Daniel Hilst <392820+dhilst@users.noreply.github.com> - 11.10.0-1
- Update to v11.10.0 from CPAN
- Drop Sys-Virt-fixes.patch (not applicable to modern codebase)
* Sun Jul 27 2008 root@mgt.cluster
- Initial build.
+91
View File
@@ -0,0 +1,91 @@
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
SPEC="$SCRIPT_DIR/Sys-Virt.spec"
MOCK_CFG="${MOCK_CFG:-almalinux-10-x86_64}"
WORK_DIR="${WORK_DIR:-/tmp/perl-Sys-Virt-mockbuild}"
RESULT_DIR="${RESULT_DIR:-$REPO_ROOT/build-output/perl-Sys-Virt}"
LOG_DIR="${LOG_DIR:-$REPO_ROOT/build-logs/perl-Sys-Virt}"
# --- Deterministic build timestamp ---
if [[ -z "${SOURCE_DATE_EPOCH:-}" ]]; then
if [[ -f "$REPO_ROOT/Gitepoch" ]]; then
SOURCE_DATE_EPOCH="$(cat "$REPO_ROOT/Gitepoch")"
else
SOURCE_DATE_EPOCH="$(git -C "$REPO_ROOT" log -1 --format=%ct HEAD 2>/dev/null || date +%s)"
fi
fi
export SOURCE_DATE_EPOCH
echo "== Configuration =="
echo "spec: $SPEC"
echo "mock_cfg: $MOCK_CFG"
echo "work_dir: $WORK_DIR"
echo "result_dir: $RESULT_DIR"
echo "log_dir: $LOG_DIR"
echo "SOURCE_DATE_EPOCH: $SOURCE_DATE_EPOCH"
rm -rf "$WORK_DIR"
mkdir -p "$WORK_DIR" "$RESULT_DIR" "$LOG_DIR"
# --- Deterministic mock config overlay ---
DET_MOCK_CFG="$WORK_DIR/mock-deterministic.cfg"
cat > "$DET_MOCK_CFG" <<EOF
include('/etc/mock/${MOCK_CFG}.cfg')
config_opts['environment']['SOURCE_DATE_EPOCH'] = '${SOURCE_DATE_EPOCH}'
EOF
MOCK_UNIQUEEXT="${MOCK_UNIQUEEXT:-perl-sys-virt-$$}"
# --- Build SRPM via mock ---
echo ""
echo "== Build SRPM =="
SRPM_OUT="$WORK_DIR/srpm"
mkdir -p "$SRPM_OUT"
mock -r "$DET_MOCK_CFG" \
--uniqueext "$MOCK_UNIQUEEXT" \
--buildsrpm \
--spec "$SPEC" \
--sources "$SCRIPT_DIR" \
--define "use_source_date_epoch_as_buildtime 1" \
--define "clamp_mtime_to_source_date_epoch 1" \
--define "_buildhost xcat-build" \
--resultdir "$SRPM_OUT" \
2>&1 | tee "$LOG_DIR/mock-buildsrpm.log"
SRPM="$(ls -t "$SRPM_OUT"/*.src.rpm 2>/dev/null | head -1)"
if [[ -z "$SRPM" ]]; then
echo "ERROR: No SRPM produced"
exit 1
fi
echo "SRPM: $SRPM"
# --- Rebuild RPM via mock ---
echo ""
echo "== Rebuild RPM =="
RPM_OUT="$WORK_DIR/rpm"
mkdir -p "$RPM_OUT"
mock -r "$DET_MOCK_CFG" \
--uniqueext "$MOCK_UNIQUEEXT" \
--rebuild "$SRPM" \
--define "use_source_date_epoch_as_buildtime 1" \
--define "clamp_mtime_to_source_date_epoch 1" \
--define "_buildhost xcat-build" \
--resultdir "$RPM_OUT" \
2>&1 | tee "$LOG_DIR/mock-rebuild.log"
# --- Collect artifacts ---
echo ""
echo "== Collect artifacts =="
cp -v "$RPM_OUT"/*.rpm "$RESULT_DIR/"
for log in build.log root.log state.log hw_info.log installed_pkgs.log; do
[[ -f "$RPM_OUT/$log" ]] && cp "$RPM_OUT/$log" "$LOG_DIR/"
done
echo ""
echo "== Completed =="
ls -lh "$RESULT_DIR"/*.rpm
echo "Artifacts: $RESULT_DIR"
echo "Logs: $LOG_DIR"