moby-engine/moby-engine.spec
Maxwell G dba714b7dd Re-enable i686 builds
We cannot do this without also removing i686 from moby-engine's
dependents.
2024-08-01 00:23:27 -05:00

206 lines
6 KiB
RPMSpec

# This specfile is licensed under:
# SPDX-FileCopyrightText: Fedora Project Authors
# SPDX-FileCopyrightText: 2024 Maxwell G <maxwell@gtmx.me>
# SPDX-License-Identifier: MIT
# License Text: https://spdx.org/licenses/MIT.html
# Generated by go2rpm 1.11.0
%bcond_without check
# https://github.com/moby/moby
%global goipath github.com/docker/docker
%global forgeurl https://github.com/moby/moby
Version: 26.0.1
%gometa -L
%global common_description %{expand:
Docker is an open source project to build, ship and run any application as a
lightweight container.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest EC2 compute instance and
everything in between and they do not require you to use a particular
language, framework or packaging system. That makes them great building blocks
for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.
}
Name: moby-engine
Release: %autorelease
Summary: The open-source application container engine
# Generated with go-vendor-tools
License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND (Apache-2.0 OR GPL-2.0-or-later)
URL: %{gourl}
Source0: %{gosource}
# Generated with go-vendor-tools
Source1: %{archivename}-vendor.tar.bz2
Source2: go-vendor-tools.toml
Source3: moby-engine-systemd-sysusers.conf
Source4: macros.moby
Patch: 0001-systemd-adjust-docker.service-for-downstream.patch
BuildRequires: git-core
BuildRequires: go-vendor-tools
BuildRequires: make
BuildRequires: pkg-config
BuildRequires: systemd-devel
# docker.service depends on containerd
Requires: containerd
# The docker CLI is provided as a separate package to ease maintenace and avoid
# overcomplicating the specfile
Requires: docker-cli >= %{version}
Requires: moby-filesystem = %{?epoch:%{epoch}:}%{version}-%{release}
# tini-static is used as the docker-init binary
Requires: tini-static
# Other runtime packages (sorted)
Requires: container-selinux
Requires: iptables
Requires: libseccomp
Requires: systemd
Requires: tar
Requires: xz
# Provide docker name to help users who "dnf install docker"
Provides: docker = %{version}-%{release}
# Conflict with upstream packages
Conflicts: docker-ce
Conflicts: docker-ee
%description %{common_description}
%package nano
Summary: GNU nano syntax highlighting files for Moby
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: nano
Supplements: moby-engine
%description nano %{common_description}
This package installs %{summary}.
%package -n moby-filesystem
Summary: Filesystem package for docker cli plugins and other directories
BuildArch: noarch
License: LicenseRef-Not-Copyrightable
%description -n moby-filesystem %{common_description}
%{summary}.
%package -n moby-rpm-macros
Summary: RPM Macros for packaging moby plugins
BuildArch: noarch
%description -n moby-rpm-macros %{common_description}
%{summary}.
%prep
%goprep -A
%setup -q -T -D -a1 %{forgesetupargs}
%autopatch -p1
cp -p %{S:3} %{S:4} .
%generate_buildrequires
%go_vendor_license_buildrequires -c %{S:2}
%build
GO_LDFLAGS="" GO_BUILDTAGS=""
# DOCKER_DEBUG: Ensure that all debuginfo is preserved
BUILDFLAGS="%{gocompilerflags} -a -v -x" \
DOCKER_BUILDTAGS="rpm_crashback journald" \
DOCKER_GITCOMMIT=%{release} \
DOCKER_DEBUG=1 \
DOCKER_LDFLAGS=%{gobuild_ldflags_shescaped} \
LDFLAGS=%{gobuild_ldflags_shescaped} \
VERSION=%{version} \
GOPATH=%{gobuilddir} \
bash -x ./hack/make.sh dynbinary
%install
# Install licenses
%go_vendor_license_install -c %{S:2}
# Install binaries
install -Dpm 0755 bundles/dynbinary*/* -t %{buildroot}%{_bindir}
# Install systemd configuration
install -Dpm 0644 contrib/init/systemd/* -t %{buildroot}%{_unitdir}
# Install sysusers config
install -Dpm 0644 moby-engine-systemd-sysusers.conf %{buildroot}%{_sysusersdir}/moby-engine.conf
# Install udev rules
install -Dpm 0644 contrib/udev/80-docker.rules -t %{buildroot}%{_udevrulesdir}
# Install nano syntax
install -Dpm 644 contrib/syntax/nano/Dockerfile.nanorc -t %{buildroot}%{_datadir}/nano/
# moby-filesystem
mkdir -p %{buildroot}%{_libexecdir}/docker
mkdir -p %{buildroot}%{_libexecdir}/docker/cli-plugins
# moby-rpm-macros
install -Dpm 0644 macros.moby -t %{buildroot}%{_rpmmacrodir}
%check
%go_vendor_license_check -c %{S:2}
%if %{with check}
# Manually skip specific tests
for test in \
"TestSCTP4Proxy" \
%dnl Failed to enter netns: operation not permitted
"TestIfaceAddrs" \
%dnl failed to mount resolved path: operation not permitted
"TestJoinGoodSymlink" \
"TestJoinWithSymlinkReplace" \
"TestJoinCloseInvalidates"
do
awk -i inplace '/^func.*'"${test}"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' \
$(grep -rl "${test}")
done
export PATH="%{buildroot}%{_bindir}:${PATH}"
# graphdriver tests require extra permissions
# integration tests require a running docker daemon
# libnetwork tests cannot create netns in mock
# pkg/archive do not work in mock, either
%gocheck -t daemon/graphdriver -t integration -t libnetwork -d pkg/archive
%endif
%pre
%sysusers_create_compat %{S:3}
%post
%systemd_post docker.service docker.socket
%preun
%systemd_preun docker.service docker.socket
%postun
%systemd_postun_with_restart docker.service
%files -f %{go_vendor_license_filelist}
%license vendor/modules.txt
%doc README.md
%{_bindir}/docker-proxy
%{_bindir}/dockerd
%{_sysusersdir}/moby-engine.conf
%{_udevrulesdir}/80-docker.rules
%{_unitdir}/docker.service
%{_unitdir}/docker.socket
%files nano
%license AUTHORS LICENSE NOTICE
%{_datadir}/nano/Dockerfile.nanorc
%files -n moby-filesystem
%dir %{_libexecdir}/docker
%dir %{_libexecdir}/docker/cli-plugins
%files -n moby-rpm-macros
%license LICENSE
%{_rpmmacrodir}/macros.moby
%changelog
%autochangelog