2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-12-03 07:37:05 +00:00
Files
xcat-core/xCAT-vlan/xCAT-vlan.spec
T
Daniel Hilst e54d43dc80 fix(packaging): four packages cannot build on openSUSE
xCAT-buildkit, xCAT-client, xCAT-test and xCAT-vlan failed in %build with
"pod2man: command not found", and buildrpms.pl then refused to index a partial
repository, so there is no openSUSE core repo to install from at all.

An openSUSE build root installs only perl-base, which does not ship pod2man, and
xpod2man runs it. The four specs guarded "BuildRequires: perl-Pod-Html" with
"%if !0%{?suse_version}" and declared nothing in its place, so openSUSE had no
requirement that brings the tool in. They now require the full perl package there.

This is not an IPv6 defect. xCAT-vlan and xCAT-buildkit carry no change on this
branch and fail the same way, so the gap predates it; it is fixed here because it
stands between the branch and any openSUSE test.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-28 07:09:27 -03:00

107 lines
3.4 KiB
RPMSpec

Summary: Executables and data of the xCAT vlan management project
Name: xCAT-vlan
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: IBM
Group: Applications/System
Source: xCAT-vlan-%{version}.tar.gz
Packager: IBM Corp.
Vendor: IBM Corp.
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
# Pod::Html ships inside the core perl package on SUSE; there is no perl-Pod-Html
%if !0%{?suse_version}
BuildRequires: perl-Pod-Html
%else
# openSUSE installs only perl-base in a build root, and perl-base does not ship pod2man,
# which xpod2man runs to build the man pages. The full perl package carries it.
BuildRequires: perl
%endif
%ifos linux
BuildArch: noarch
%endif
Requires: xCAT-client = 4:%{version}-%{release}
%description
xCAT-vlan provides the xCAT vlan configuration.
%prep
%setup -q -n xCAT-vlan
%build
# Convert pods to man pages and html pages
./xpod2man
%install
# The install phase puts all of the files in the paths they should be in when the rpm is
# installed on a system. The RPM_BUILD_ROOT is a simulated root file system and usually
# has a value like: /var/tmp/xCAT-vlan-2.0-snap200802270932-root
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin
mkdir -p $RPM_BUILD_ROOT/install/postscripts
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
set +x
cp xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT
cp -R xCAT_plugin/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin
cp install/postscripts/* $RPM_BUILD_ROOT/install/postscripts
# These were built dynamically in the build phase
cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
# These were built dynamically during the build phase
cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
# These links get made in the RPM_BUILD_ROOT/prefix area
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/mkvlan
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chvlan
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmvlan
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lsvlan
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chvlanports
%clean
# This step does not happen until *after* the %files packaging below
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
#%doc LICENSE.html
# Just package everything that has been copied into RPM_BUILD_ROOT
%{prefix}
/install/postscripts
%changelog
%post
%ifos linux
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd -r
fi
fi
%else
#restart the xcatd on if xCAT or xCATsn is installed already
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
if [ -n "$INUCLIENTS" ] && [ $INUCLIENTS -eq 1 ]; then
#Do nothing in not running system
echo "Do not restartxcatd in not running system"
else
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd -r
fi
fi
%endif
exit 0
%preun