%global domain github.com %global org kata-containers %global repo runtime %global download %{domain}/%{org}/%{repo} %global importname %{download} %global qemu qemu-kvm # https://github.com/kata-containers/runtime %global goipath github.com/kata-containers/runtime %global tag 1.9.0 Version: %{tag} %gometa # Document additional imported license (as generated by go2rpm) # These licenses are, at the moment, all ASL 2.0, so only # one copy would be needed in the rpm, but they are technically # different licenses for different components, so just in case... %global golicenses LICENSE virtcontainers/LICENSE\\\ virtcontainers/pkg/oci/LICENSE # List of documents in the source package (as generated by go2rpm) # These documents are copied into the RPM as a courtesy. %global godocs README.md CONTRIBUTING.md CODE_OF_CONDUCT.md\\\ virtcontainers/README.md\\\ virtcontainers/experimental/README.md\\\ virtcontainers/documentation/Developers.md\\\ virtcontainers/documentation/api/1.0/api.md\\\ virtcontainers/pkg/firecracker/README\\\ virtcontainers/persist/plugin/README.md pkg/README.md\\\ pkg/signals/README.md pkg/katautils/README.md\\\ pkg/katatestutils/README.md # Do not use {goname}, which is golang-github-kata-containers-runtime Name: kata-%{repo} Release: 1%{?dist} Url: %{gourl} Source0: %{gosource} Summary: Kata runtime to run containers in virtual machines License: ASL 2.0 BuildRequires: compiler(go-compiler) Requires: qemu-kvm >= 4.0.0 Requires: kata-proxy >= %{version} Requires: kata-shim >= %{version} Requires: kata-osbuilder >= %{version} # The following architectures lack the required qemu support ExcludeArch: %{arm} %{ix86} # Minor local patches Patch0001: 0001-Remove-shebang-in-non-executable-completion-script.patch %description %{summary} Kata Containers is an open source project and community working to build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs. %gopkg %prep %goprep %autosetup -p1 -n %{repo}-%{version} # Common variables to pass to 'make' # The machine type uses a modern default # The kernel parameters workaround an issue with cgroupsv2 after kernel 5.3 # To-do: add BUILDFLAGS=gobuildflags when the macro becomes available %global make_vars QEMUPATH=%{_bindir}/%{qemu} \\\ SKIP_GO_VERSION_CHECK=y \\\ MACHINETYPE="q35" \\\ KERNELPARAMS="systemd.unified_cgroup_hierarchy=0" \\\ SCRIPTS_DIR=%{_bindir} \\\ DESTDIR=%{buildroot} \\\ PREFIX=/usr \\\ DEFAULTSDIR=%{_datadir}/kata-containers/defaults \\\ CONFDIR=%{_datadir}/kata-containers/defaults # Not using gobuild here in order to stick to how upstream builds # (This builds multiple binaries) %build export PATH=$PATH:"$(pwd)/go/bin" export GOPATH="$(pwd)/go" mkdir -p go/src/%{domain}/%{org} ln -s $(pwd)/../%{repo}-%{version} go/src/%{importname} cd go/src/%{importname} %make_build %{make_vars} # Not using gopkginstall here in order to stick to how upstream builds %install export GOPATH=$(pwd)/go export PATH=$PATH:$GOPATH/bin cd go/src/%{importname} %make_install %{make_vars} # Disable the image= option, so we use initrd= by default sed -i -e 's/^image =/#image =/' %{buildroot}%{_datadir}/kata-containers/defaults/configuration.toml # Enable vsock as transport instead of virtio-serial sed -i -e 's/^#use_vsock =/use_vsock =/' %{buildroot}%{_datadir}/kata-containers/defaults/configuration.toml %files %dir %{_libexecdir}/kata-containers %{_bindir}/kata-runtime %{_bindir}/containerd-shim-kata-v2 %{_libexecdir}/kata-containers/kata-netmon %{_bindir}/kata-collect-data.sh %dir %{_datadir}/kata-containers %dir %{_datadir}/kata-containers/defaults %{_datadir}/kata-containers/defaults/configuration*.toml %{_datadir}/bash-completion/completions/kata-runtime %license LICENSE %doc README.md CONTRIBUTING.md %changelog * Thu Nov 14 2019 Christophe de Dinechin - 1.9.0-1 - Update to release 1.9.0 * Thu Oct 17 2019 Christophe de Dinechin - 1.8.2-4 - Exclude armv7hl and i686 architectures, which lack required qemu * Thu Oct 10 2019 Christophe de Dinechin - 1.8.2-3 - Integrate changes related to package review * Mon Sep 30 2019 Christophe de Dinechin - 1.8.2-2 - Integrate a number of changes suggested by Cole Robinson * Fri Sep 20 2019 Christophe de Dinechin - 1.8.2-1 - Update to 1.8.2 release * Fri Sep 13 2019 Christophe de Dinechin - 1.8.0-5 - Move binaries to libexec (no man page, not directly accessible) * Thu Sep 12 2019 Christophe de Dinechin - 1.8.0-4 - Remove shebang in bash completion script * Wed Aug 28 2019 Christophe de Dinechin - 1.8.0-2 - Remove nonexistent packages * Tue Jul 30 2019 Christophe de Dinechin - 1.8.0-1 - Update to 1.8.0 release * Fri Jul 12 2019 Christophe de Dinechin - 1.7.3-5 - Update to 1.7.3 release, cleanup spec file