Skip to content

Commit

Permalink
pkg: Update / tidy rpm spec file
Browse files Browse the repository at this point in the history
Tidy up the rpm spec file.

* Remove the manual handling of build root, GOPATH etc. Not needed as
  we are using go modules now.
* Remove redundant explicit deps.
* Fix crun -> runc dep for EL7.
* Use rpm make_xxx macros instead of direct make calls.
* Ensure all directories created are owned by package.

Fixes sylabs/singularity#1142
Fixes sylabs/singularity#1141

Signed-off-by: Edita Kizinevic <edita.kizinevic@cern.ch>
  • Loading branch information
dtrudg authored and edytuk committed Dec 5, 2022
1 parent 9f7a674 commit e9afc84
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
18 changes: 16 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sudo apt-get install -y \
crun
```

On CentOS/RHEL:
On CentOS/RHEL 8 and above:

```sh
# Install basic tools for compiling
Expand All @@ -51,6 +51,20 @@ sudo yum install -y \
crun
```

On CentOS/RHEL 7:

```sh
# Install basic tools for compiling
sudo yum groupinstall -y 'Development Tools'
# Install RPM packages for dependencies
sudo yum install -y \
libseccomp-devel \
glib2-devel \
squashfs-tools \
cryptsetup \
runc
```

On SLE/openSUSE

```sh
Expand All @@ -64,7 +78,7 @@ sudo zypper install -y \
crun
```

_Note - `crun` can be ommitted if you will not use the `apptainer oci`
_Note - `crun` / `runc` can be ommitted if you will not use the `apptainer oci`
commands, or the `--oci` execution mode._

## Install Go
Expand Down
7 changes: 7 additions & 0 deletions dist/rpm/apptainer.rpmlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
addFilter(r'setuid-binary /usr/libexec/apptainer/bin/starter-suid')
addFilter(r'non-standard-executable-perm /usr/libexec/apptainer/bin/starter-suid')
addFilter(r'zero-length /etc/apptainer/capability.json')
addFilter(r'zero-length /etc/apptainer/global-pgp-public')
addFilter(r'readelf-failed /usr/bin/apptainer 'utf-8' codec can't decode byte 0xc2')
addFilter(r'readelf-failed /usr/libexec/apptainer/bin/starter 'utf-8' codec can't decode byte 0xc2')
addFilter(r'readelf-failed /usr/libexec/apptainer/bin/starter-suid 'utf-8' codec can't decode byte 0xc2')
28 changes: 23 additions & 5 deletions dist/rpm/apptainer.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@
# Uncomment this to include a multithreaded version of squashfuse_ll
# %%global squashfuse_version 0.1.105

Summary: Application and environment virtualization
Name: apptainer
Version: @PACKAGE_RPM_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}
Summary: Application and environment virtualization

# See LICENSE.md for first party code (BSD-3-Clause and LBNL BSD)
# See LICENSE_THIRD_PARTY.md for incorporated code (ASL 2.0)
# See LICENSE_DEPENDENCIES.md for dependencies
# License identifiers taken from: https://fedoraproject.org/wiki/Licensing
License: BSD and LBNL BSD and ASL 2.0

URL: https://apptainer.org
Source: https://github.com/%{name}/%{name}/releases/download/v%{package_version}/%{name}-%{package_version}.tar.gz
@PACKAGE_GOLANG_SOURCE@
Expand All @@ -69,17 +71,30 @@ Obsoletes: singularity-runtime < 3.0
BuildRequires: binutils-gold
%endif
BuildRequires: golang
BuildRequires: git
BuildRequires: gcc
BuildRequires: make
# Paths to runtime dependencies detected by mconfig, so must be present at build time.
BuildRequires: cryptsetup
%if "%{_target_vendor}" == "suse"
Requires: squashfs
%else
Requires: squashfs-tools
%endif
# Required for building bundled conmon
BuildRequires: libseccomp-devel
# crun requirement not satisfied on EL7 or SLES default repos - use runc there.
%if "%{_target_vendor}" == "suse" || 0%{?rhel} > 7
Requires: crun
%else
Requires: runc
%endif
%if "%{_target_vendor}" == "suse"
Requires: squashfs
%else
Requires: shadow-utils
Requires: squashfs-tools
%endif
BuildRequires: cryptsetup
Requires: cryptsetup
%if "%{?squashfuse_version}" != ""
BuildRequires: autoconf
BuildRequires: automake
Expand All @@ -88,7 +103,6 @@ BuildRequires: pkgconfig
BuildRequires: fuse3-devel
BuildRequires: zlib-devel
%endif
Requires: crun
Requires: squashfuse
Requires: fakeroot
Requires: fuse-overlayfs
Expand Down Expand Up @@ -200,13 +214,17 @@ rmdir %{_sysconfdir}/singularity/* %{_sysconfdir}/singularity 2>/dev/null || tru
%dir %{_libexecdir}/%{name}
%dir %{_libexecdir}/%{name}/bin
%{_libexecdir}/%{name}/bin/starter
%dir %{_libexecdir}/%{name}/cni
%if "%{?squashfuse_version}" != ""
%{_libexecdir}/%{name}/bin/squashfuse_ll
%endif
%{_libexecdir}/%{name}/cni
%{_libexecdir}/%{name}/lib
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/*
%dir %{_sysconfdir}/%{name}/cgroups
%dir %{_sysconfdir}/%{name}/network
%dir %{_sysconfdir}/%{name}/seccomp-profiles
%{_datadir}/bash-completion/completions/*
%dir %{_localstatedir}/%{name}
%dir %{_localstatedir}/%{name}/mnt
Expand All @@ -218,9 +236,9 @@ rmdir %{_sysconfdir}/singularity/* %{_sysconfdir}/singularity 2>/dev/null || tru
%license LICENSE_DEPENDENCIES.md
%doc README.md
%doc CHANGELOG.md
%doc CONTRIBUTING.md

%files suid
%attr(4755, root, root) %{_libexecdir}/%{name}/bin/starter-suid

%changelog

0 comments on commit e9afc84

Please sign in to comment.