2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-27 21:02:14 +00:00
Files
xcat-core/xCAT-test/xCAT-test.spec
T
Daniel Hilst 8cf1615b24 fix(xcat-core): rpmbuild rejects four specs with %else after %else
xCAT-buildkit, xCAT-client, xCAT-test and xCAT-vlan each hold two %else
in the pod converter BuildRequires block, so rpmbuild -bs stops with
"%else after %else" and the EL core build fails for every architecture
before it can index a repository.

The feat/ipv6 merge produced the structure. Both sides rewrite the same
%if block, master as "%if 0%{?suse_version}" and feat/ipv6 as the
inverted "%if !0%{?suse_version}", and they touch different lines, so
git merged both bodies without a conflict.

This change keeps master's form and removes the second branch. The two
branches ask for the same package on the same condition, so no
BuildRequires changes.

spec_conditional_nesting.t reports all four files before this change and
none after.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-07 11:40:25 -03:00

107 lines
3.6 KiB
RPMSpec

Summary: xCAT automated test tool
Name: xCAT-test
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System
Source: xCAT-test-%{version}.tar.gz
Packager: IBM Corp.
Vendor: IBM Corp.
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
# The pod converters are in perl-Pod-Html on EL and in the core perl package on
# SUSE, which has no perl-Pod-Html. A SUSE chroot holds perl-base only, and that
# ships neither Pod::Man nor pod2man.
%if 0%{?suse_version}
BuildRequires: perl
%else
BuildRequires: perl-Pod-Html
%endif
# AIX will build with an arch of "ppc"
%ifos linux
BuildArch: noarch
%endif
# blackboxtest's DHCP steps need scapy, which lives in EPEL on EL. A hard
# Requires: would make this package uninstallable on a management node without
# EPEL, so it is only recommended: blackboxtest exits 3 with a message naming
# the package when a DHCP step finds no scapy. rpm before EL 8 has no
# Recommends:.
%if 0%{?suse_version} || 0%{?rhel} >= 8
Recommends: python3-scapy
%endif
%description
Provides automated test tool and buckets to help test xCAT commands automatically.
%prep
%setup -q -n xCAT-test
%build
# Convert pods to man pages and html pages
mkdir -p share/man/man1
mkdir -p share/doc/man1
pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1
pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1
pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html
pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html
%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-test-2.0-snap200802270932-root
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/sbin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/Test
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
cp bin/* $RPM_BUILD_ROOT/%{prefix}/bin
cp xcattest $RPM_BUILD_ROOT/%{prefix}/bin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
cp lib/xCAT/Test/OS.pm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/Test
cp lib/xCAT/Test/Conf.pm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/Test
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/Test/OS.pm
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/Test/Conf.pm
cp restapitest $RPM_BUILD_ROOT/%{prefix}/sbin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/sbin/*
# 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/*
cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
cp -r autotest $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools
cp -r unit $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
cp -r integration $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
cp -r blackboxtest $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest/blackboxtest/src/blackboxtest
%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}
%changelog
* Tue Sep 14 2010 - Airong Zheng <zhengar@us.ibm.com>
- "Create xCAT autotest package"
%post
%preun