Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

packaging: add 0.36-2 fedora updates #1619

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/Dockerfile.almalinux_8ch
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN dnf install -y --setopt=install_weak_deps=false \
dnf-plugin-ovl \
autoconf \
automake \
bats \
gcc \
git \
libarchive \
Expand All @@ -43,8 +44,6 @@ RUN dnf install -y --setopt=install_weak_deps=false \
rpm-build \
rpmlint \
rsync \
squashfs-tools \
squashfuse \
wget \
which \
&& dnf clean all
Expand Down
18 changes: 10 additions & 8 deletions packaging/fedora/build
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ rpmbuild root: %(rpmbuild)s
'--', 'rpmbuild', '--eval', '%{?dist}')
rpms_dist = rpms_dist.split('.')[-1]

# FIXME: el8 doesn’t have bats; skip for now.
if (rpms_dist == 'el8'):
PACKAGES.remove('charliecloud-test')

# Get a clean Git checkout of the desired version. We do this by making a
# temporary clone so as not to mess up the WD.
git_tmp = rpm_sources + '/charliecloud'
Expand Down Expand Up @@ -175,18 +171,24 @@ rpmbuild root: %(rpmbuild)s
rpms_arch = "%s/%s" % (rpms_src, ARCH)
rpms_noarch = "%s/noarch" % rpms_src
rpms = {'charliecloud': [rpms_arch, '%s.%s.rpm' % (rpms_dist, ARCH)],
'charliecloud-builder': [rpms_noarch, '%s.noarch.rpm' % rpms_dist],
'charliecloud-builder': [rpms_arch, '%s.%s.rpm' % (rpms_dist, ARCH)],
'charliecloud-debuginfo': [rpms_arch, '%s.%s.rpm' % (rpms_dist, ARCH)],
'charliecloud-doc': [rpms_noarch, '%s.noarch.rpm' % rpms_dist],
'charliecloud-test': [rpms_arch, '%s.%s.rpm' % (rpms_dist, ARCH)]}
rpm_specs = "/usr/local/src/SPECS"
rpm_sources = "/usr/local/src/SOURCES"
# Set rhel macro to avoid rpmbuild issues.
rpmbuild_args += ["--define", "rhel 0"]
rpmbuild_args += ["--define", "_topdir /usr/local/src"]
rpmlint_args += ["--file", "%s/charliecloud.rpmlintrc" % rpm_specs]
container += [CH_BASE + "/bin/ch-run", "-w",
"-b", "%s:/usr/local/src" % args.rpmbuild,
args.image, "--"]

# 0.36+ no longer support bats 0.4.0; remove the test package from epel7
if (rpms_dist == 'el7'):
PACKAGES.remove("charliecloud-test")

# Build RPMs.
cmd(container, "rpmbuild", rpmbuild_args, "--version")
cmd(container, "rpmbuild", rpmbuild_args, "-ba", "%s/%s" % (rpm_specs, spec))
Expand All @@ -196,13 +198,13 @@ rpmbuild root: %(rpmbuild)s
# Install RPMs.
if (args.install):
print("# uninstalling (most errors can be ignored)")
cmd_ok(container, "rpm", "--erase", PACKAGES)
print("# installing")
for p in PACKAGES:
cmd_ok(container, "rpm", "--erase", "--nodeps", p)
print("# installing")
rpm_path = rpms[p][0]
rpm_ext = rpms[p][-1]
file = '%s/%s-%s.%s' % (rpm_path, p, rpm_vr, rpm_ext)
cmd(container, "rpm", "--install", file)
cmd(container, "rpm", "--install", "--force", file)
cmd(container, "rpm", "-qa", "charliecloud*")

# Lint RPMs and spec file. Last so problems that don’t result in program
Expand Down
45 changes: 36 additions & 9 deletions packaging/fedora/charliecloud.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ Summary: Lightweight user-defined software stacks for high-performance com
License: ASL 2.0
URL: https://hpc.github.io/%{name}/
Source0: https://github.com/hpc/%{name}/releases/downloads/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc rsync bash
Requires: squashfuse squashfs-tools
Patch1: el7-pkgdir.patch
BuildRequires: gcc rsync bash findutils
%if 0%{?el7}
Patch0: el7-pkgdir.patch
%endif
%if 0%{!?el7} && 0%{!?el8}
Requires: fuse3 squashfuse
BuildRequires: fuse3-libs fuse3-devel squashfuse-devel
Patch1: no-squashfuse-rpath.patch
%endif

%description
Charliecloud uses Linux user namespaces to run containers with no privileged
Expand All @@ -34,14 +40,14 @@ For more information: https://hpc.github.io/charliecloud
%package builder
Summary: Charliecloud container image building tools
License: ASL 2.0 and MIT
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python%{python3_pkgversion}-lark-parser
BuildRequires: python%{python3_pkgversion}-requests
Requires: %{name}
Requires: python3
Requires: python%{python3_pkgversion}-lark-parser
Requires: python%{python3_pkgversion}-requests
%if 0%{!?el7}
Requires: git >= 2.28.1
%endif
Provides: bundled(python%{python3_pkgversion}-lark-parser) = 1.1.9

%description builder
Expand All @@ -63,7 +69,10 @@ Html and man page documentation for %{name}.
%package test
Summary: Charliecloud test suite
License: ASL 2.0
Requires: %{name} %{name}-builder /usr/bin/bats
Requires: %{name} %{name}-builder
%if 0%{!?el7}
Requires: bats
%endif
Obsoletes: %{name}-test < %{version}-%{release}

%description test
Expand All @@ -73,16 +82,25 @@ Test fixtures for %{name}.
%setup -q

%if 0%{?el7}
%patch1 -p1
%patch0 -p1
%endif

%if 0%{!?el7} && 0%{!?el8}
%patch 1 -p1
%endif

%build
# Use old inlining behavior, see:
# https://github.com/hpc/charliecloud/issues/735
CFLAGS=${CFLAGS:-%optflags -fgnu89-inline}; export CFLAGS
# FIXME: use --disable test when https://github.com/hpc/charliecloud/issues/1836
# is resolved.
%configure --docdir=%{_pkgdocdir} \
--libdir=%{_prefix}/lib \
--with-python=/usr/bin/python3 \
%if 0%{!?el7} && 0%{!?el8}
--with-libsquashfuse=/usr \
%endif
%if 0%{?el7}
--with-sphinx-build=%{_bindir}/sphinx-build-3.6
%else
Expand Down Expand Up @@ -112,6 +130,13 @@ EOF
%{__rm} -rf %{buildroot}%{_pkgdocdir}/html/_static/fonts
%{__rm} -rf %{buildroot}%{_pkgdocdir}/html/_static/js

# Remove el7 test bits; unnecessary after #1836 is resolved.
%if 0%{?el7}
%{__rm} -f %{buildroot}%{_bindir}/ch-test
%{__rm} -rf %{buildroot}%{_libexecdir}/%{name}
%{__rm} -f %{buildroot}%{_mandir}/man1/ch-test.1*
%endif

# Use Fedora package sphinx bits.
sphinxdir=%{python3_sitelib}/sphinx_rtd_theme/static
ln -s "${sphinxdir}/css" %{buildroot}%{_pkgdocdir}/html/_static/css
Expand Down Expand Up @@ -166,11 +191,13 @@ ln -s "${sphinxdir}/js" %{buildroot}%{_pkgdocdir}/html/_static/js
%{_pkgdocdir}/html
%{?el7:%exclude %{_pkgdocdir}/examples/*/__pycache__}


%files test
%if 0%{?el7}
%else
%{_bindir}/ch-test
%{_libexecdir}/%{name}
%{_mandir}/man1/ch-test.1*
%endif

%changelog
* Thu Apr 16 2020 <[email protected]> - @VERSION@-@RELEASE@
Expand Down
21 changes: 10 additions & 11 deletions packaging/fedora/el7-pkgdir.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
diff -ru charliecloud/bin/ch-test charliecloud-lib/bin/ch-test
--- charliecloud/bin/ch-test 2020-04-07 12:19:37.054609706 -0600
+++ charliecloud-lib/bin/ch-test 2020-04-15 16:36:55.128831767 -0600
@@ -662,7 +662,7 @@
--- a/bin/ch-test 2024-01-19 13:17:53.000000000 -0500
+++ b/bin/ch-test 2024-02-09 14:37:15.388753491 -0500
@@ -779,7 +779,7 @@

# Find test directories. Note some of this gets rewritten at install time.
CHTEST_DIR=${ch_base}/test
-CHTEST_EXAMPLES_DIR=${ch_base}/examples
+CHTEST_EXAMPLES_DIR=${ch_base}-${ch_version}/examples
if [[ ! -f ${ch_base}/VERSION ]]; then
# installed
CHTEST_INSTALLED=yes
CHTEST_GITWD=
CHTEST_DIR=${ch_base}/libexec/charliecloud/test
- CHTEST_EXAMPLES_DIR=${ch_base}/share/doc/charliecloud/examples
+ CHTEST_EXAMPLES_DIR=${ch_base}/share/doc/charliecloud-${ch_version}/examples
else
# build dir
CHTEST_INSTALLED=
11 changes: 11 additions & 0 deletions packaging/fedora/no-squashfuse-rpath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/configure 2024-02-09 11:26:45.647046362 -0500
+++ b/configure 2024-02-09 11:30:18.613833446 -0500
@@ -7137,7 +7137,7 @@
else $as_nop
rpath_libsquashfuse=
fi
- CH_RUN_LIBS="-lsquashfuse_ll -lfuse3 $rpath_libsquashfuse $CH_RUN_LIBS"
+ CH_RUN_LIBS="-lsquashfuse_ll -lfuse3 $CH_RUN_LIBS"
else $as_nop
have_libsquashfuse=no
fi
12 changes: 0 additions & 12 deletions packaging/fedora/printf.patch

This file was deleted.

Loading
Loading