2018-07-17 19:44:44 +00:00
|
|
|
%global with_debug 1
|
|
|
|
|
2017-05-02 13:02:54 +00:00
|
|
|
%if 0%{?with_debug}
|
2018-07-17 19:24:07 +00:00
|
|
|
%global _find_debuginfo_dwz_opts %{nil}
|
2017-05-02 13:02:54 +00:00
|
|
|
%global _dwz_low_mem_die_limit 0
|
|
|
|
%else
|
|
|
|
%global debug_package %{nil}
|
|
|
|
%endif
|
|
|
|
|
2020-03-19 17:04:08 +00:00
|
|
|
%global provider github
|
|
|
|
%global provider_tld com
|
|
|
|
%global project containers
|
|
|
|
%global repo buildah
|
2018-10-02 19:39:37 +00:00
|
|
|
# https://github.com/containers/buildah
|
2020-03-19 17:04:08 +00:00
|
|
|
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
|
|
|
|
%global git0 https://%{import_path}
|
2017-05-02 13:02:54 +00:00
|
|
|
|
2022-05-05 00:05:29 +00:00
|
|
|
%global built_tag v1.26.1
|
2021-09-10 13:26:02 +00:00
|
|
|
%global built_tag_strip %(b=%{built_tag}; echo ${b:1})
|
2022-01-26 22:00:31 +00:00
|
|
|
%global gen_version %(b=%{built_tag_strip}; echo ${b/-/"~"})
|
2019-09-05 17:54:22 +00:00
|
|
|
|
2018-04-08 02:57:58 +00:00
|
|
|
Name: %{repo}
|
2022-01-26 22:00:31 +00:00
|
|
|
Version: %{gen_version}
|
|
|
|
Release: %autorelease
|
2018-04-08 02:57:58 +00:00
|
|
|
Summary: A command line tool used for creating OCI Images
|
2022-02-17 14:11:06 +00:00
|
|
|
License: ASL 2.0 and BSD and MIT and MPLv2.0
|
2019-06-02 14:37:03 +00:00
|
|
|
URL: https://%{name}.io
|
2021-08-05 18:34:08 +00:00
|
|
|
Source: %{git0}/archive/%{built_tag}.tar.gz
|
2020-05-26 19:38:41 +00:00
|
|
|
BuildRequires: device-mapper-devel
|
2022-01-28 20:08:46 +00:00
|
|
|
BuildRequires: git-core
|
2021-08-02 18:52:01 +00:00
|
|
|
BuildRequires: golang >= 1.16.6
|
2018-04-08 02:57:58 +00:00
|
|
|
BuildRequires: glib2-devel
|
|
|
|
BuildRequires: glibc-static
|
2020-02-05 09:59:56 +00:00
|
|
|
BuildRequires: go-md2man
|
2021-06-14 19:59:41 +00:00
|
|
|
BuildRequires: go-rpm-macros
|
2018-04-08 02:57:58 +00:00
|
|
|
BuildRequires: gpgme-devel
|
|
|
|
BuildRequires: libassuan-devel
|
2018-04-16 03:01:41 +00:00
|
|
|
BuildRequires: make
|
2020-05-26 20:12:39 +00:00
|
|
|
BuildRequires: ostree-devel
|
2020-02-05 09:59:56 +00:00
|
|
|
BuildRequires: btrfs-progs-devel
|
2022-01-28 19:08:14 +00:00
|
|
|
Requires: containers-common >= 4:1-46
|
2022-05-04 19:07:31 +00:00
|
|
|
Suggests: containernetworking-plugins >= 0.9.1-1
|
|
|
|
Requires: netavark
|
|
|
|
Requires: iptables
|
|
|
|
Requires: nftables
|
2020-02-05 10:10:09 +00:00
|
|
|
BuildRequires: libseccomp-static
|
2020-09-21 11:50:00 +00:00
|
|
|
Requires: libseccomp >= 2.4.1-0
|
2020-11-20 13:54:25 +00:00
|
|
|
Suggests: cpp
|
2021-05-13 17:53:31 +00:00
|
|
|
Suggests: qemu-user-static
|
2022-01-28 19:22:56 +00:00
|
|
|
# awk '{print "Provides: bundled(golang("$1")) = "$2}' go.mod | sort | uniq | sed -e 's/-/_/g' -e '/bundled(golang())/d' -e '/bundled(golang(go\|module\|replace\|require))/d'
|
|
|
|
Provides: bundled(golang(github.com/containerd/containerd)) = v1.5.9
|
|
|
|
Provides: bundled(golang(github.com/containernetworking/cni)) = v1.0.1
|
2022-02-17 14:11:06 +00:00
|
|
|
Provides: bundled(golang(github.com/containers/common)) = v0.47.4
|
2022-02-04 14:20:58 +00:00
|
|
|
Provides: bundled(golang(github.com/containers/image/v5)) = v5.19.1
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/containers/ocicrypt)) = v1.1.2
|
2022-02-04 14:20:58 +00:00
|
|
|
Provides: bundled(golang(github.com/containers/storage)) = v1.38.2
|
2022-02-17 14:11:06 +00:00
|
|
|
Provides: bundled(golang(github.com/docker/distribution)) = v2.8.0+incompatible
|
2022-01-28 19:22:56 +00:00
|
|
|
Provides: bundled(golang(github.com/docker/docker)) = v20.10.12+incompatible
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/docker/go_units)) = v0.4.0
|
|
|
|
Provides: bundled(golang(github.com/docker/libnetwork)) = v0.8.0_dev.2.0.20190625141545_5a177b73e316
|
2022-02-17 14:11:06 +00:00
|
|
|
Provides: bundled(golang(github.com/fsouza/go_dockerclient)) = v1.7.8
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/ghodss/yaml)) = v1.0.0
|
|
|
|
Provides: bundled(golang(github.com/hashicorp/go_multierror)) = v1.1.1
|
|
|
|
Provides: bundled(golang(github.com/ishidawataru/sctp)) = v0.0.0_20210226210310_f2269e66cdee
|
|
|
|
Provides: bundled(golang(github.com/konsorten/go_windows_terminal_sequences)) = v1.0.3
|
|
|
|
Provides: bundled(golang(github.com/mattn/go_shellwords)) = v1.0.12
|
2022-01-28 19:22:56 +00:00
|
|
|
Provides: bundled(golang(github.com/onsi/ginkgo)) = v1.16.5
|
2022-02-04 14:20:58 +00:00
|
|
|
Provides: bundled(golang(github.com/onsi/gomega)) = v1.18.1
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/opencontainers/go_digest)) = v1.0.0
|
2022-01-28 19:22:56 +00:00
|
|
|
Provides: bundled(golang(github.com/opencontainers/image_spec)) = v1.0.3_0.20211202193544_a5463b7f9c84
|
|
|
|
Provides: bundled(golang(github.com/opencontainers/runc)) = v1.1.0
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/opencontainers/runtime_spec)) = v1.0.3_0.20210326190908_1c3f411f0417
|
|
|
|
Provides: bundled(golang(github.com/opencontainers/runtime_tools)) = v0.9.0
|
2022-01-28 19:22:56 +00:00
|
|
|
Provides: bundled(golang(github.com/opencontainers/selinux)) = v1.10.0
|
2022-02-04 14:20:58 +00:00
|
|
|
Provides: bundled(golang(github.com/openshift/imagebuilder)) = v1.2.2
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/pkg/errors)) = v0.9.1
|
2022-01-28 19:22:56 +00:00
|
|
|
Provides: bundled(golang(github.com/seccomp/libseccomp_golang)) = v0.9.2_0.20210429002308_3879420cc921
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/sirupsen/logrus)) = v1.8.1
|
2022-01-28 19:22:56 +00:00
|
|
|
Provides: bundled(golang(github.com/spf13/cobra)) = v1.3.0
|
2022-01-26 22:00:31 +00:00
|
|
|
Provides: bundled(golang(github.com/spf13/pflag)) = v1.0.5
|
|
|
|
Provides: bundled(golang(github.com/stretchr/testify)) = v1.7.0
|
|
|
|
Provides: bundled(golang(github.com/syndtr/gocapability)) = v0.0.0_20200815063812_42c35b437635
|
2017-05-02 13:02:54 +00:00
|
|
|
|
|
|
|
%description
|
2018-02-05 22:23:05 +00:00
|
|
|
The %{name} package provides a command line tool which can be used to
|
2017-05-02 13:02:54 +00:00
|
|
|
* create a working container from scratch
|
|
|
|
or
|
|
|
|
* create a working container from an image as a starting point
|
|
|
|
* mount/umount a working container's root file system for manipulation
|
|
|
|
* save container's root file system layer to create a new image
|
|
|
|
* delete a working container or an image
|
|
|
|
|
2019-10-16 13:40:21 +00:00
|
|
|
%package tests
|
|
|
|
Summary: Tests for %{name}
|
|
|
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
Requires: bats
|
|
|
|
Requires: bzip2
|
|
|
|
Requires: podman
|
|
|
|
Requires: golang
|
2020-02-10 20:40:20 +00:00
|
|
|
Requires: jq
|
2020-07-20 14:38:12 +00:00
|
|
|
Requires: httpd-tools
|
2020-09-03 18:11:46 +00:00
|
|
|
Requires: openssl
|
2021-04-15 20:59:20 +00:00
|
|
|
Requires: nmap-ncat
|
2022-02-01 21:49:38 +00:00
|
|
|
Requires: git-daemon
|
2019-10-16 13:40:21 +00:00
|
|
|
|
|
|
|
%description tests
|
|
|
|
%{summary}
|
|
|
|
|
|
|
|
This package contains system tests for %{name}
|
|
|
|
|
2017-05-02 13:02:54 +00:00
|
|
|
%prep
|
2022-01-28 20:08:46 +00:00
|
|
|
%autosetup -Sgit -n %{name}-%{built_tag_strip}
|
2017-05-02 13:02:54 +00:00
|
|
|
|
|
|
|
%build
|
2022-01-26 22:00:31 +00:00
|
|
|
%set_build_flags
|
|
|
|
export GOPATH=$(pwd)/_build:$(pwd)
|
|
|
|
export CGO_CFLAGS=$CFLAGS
|
|
|
|
# These extra flags present in $CFLAGS have been skipped for now as they break the build
|
|
|
|
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g')
|
|
|
|
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g')
|
|
|
|
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-annobin-cc1//g')
|
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full"
|
|
|
|
%endif
|
|
|
|
|
2017-05-02 13:02:54 +00:00
|
|
|
mkdir _build
|
|
|
|
pushd _build
|
|
|
|
mkdir -p src/%{provider}.%{provider_tld}/%{project}
|
|
|
|
ln -s $(dirs +1 -l) src/%{import_path}
|
|
|
|
popd
|
|
|
|
|
|
|
|
mv vendor src
|
|
|
|
|
2021-08-05 18:52:18 +00:00
|
|
|
export CNI_VERSION=`grep '^# github.com/containernetworking/cni ' src/modules.txt | sed 's,.* ,,'`
|
|
|
|
export LDFLAGS="-X main.buildInfo=`date +%s` -X main.cniVersion=${CNI_VERSION}"
|
|
|
|
|
2020-12-07 19:57:48 +00:00
|
|
|
export BUILDTAGS='seccomp selinux'
|
2020-09-03 13:28:18 +00:00
|
|
|
%gobuild -o bin/%{name} %{import_path}/cmd/%{name}
|
|
|
|
%gobuild -o bin/imgtype %{import_path}/tests/imgtype
|
2021-07-19 14:52:33 +00:00
|
|
|
%gobuild -o bin/copy %{import_path}/tests/copy
|
2019-07-07 23:40:20 +00:00
|
|
|
GOMD2MAN=go-md2man %{__make} -C docs
|
2017-05-02 13:02:54 +00:00
|
|
|
|
2022-01-28 19:08:14 +00:00
|
|
|
|
2017-05-02 13:02:54 +00:00
|
|
|
%install
|
|
|
|
export GOPATH=$(pwd)/_build:$(pwd):%{gopath}
|
|
|
|
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install install.completions
|
2019-07-07 23:40:20 +00:00
|
|
|
make DESTDIR=%{buildroot} PREFIX=%{_prefix} -C docs install
|
2017-05-02 13:02:54 +00:00
|
|
|
|
2019-10-16 13:40:21 +00:00
|
|
|
install -d -p %{buildroot}/%{_datadir}/%{name}/test/system
|
|
|
|
cp -pav tests/. %{buildroot}/%{_datadir}/%{name}/test/system
|
2020-09-03 13:28:18 +00:00
|
|
|
cp bin/imgtype %{buildroot}/%{_bindir}/%{name}-imgtype
|
2021-07-19 14:52:33 +00:00
|
|
|
cp bin/copy %{buildroot}/%{_bindir}/%{name}-copy
|
2019-10-16 13:40:21 +00:00
|
|
|
|
2017-05-02 13:02:54 +00:00
|
|
|
#define license tag if not already defined
|
|
|
|
%{!?_licensedir:%global license %doc}
|
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/%{name}
|
2018-02-05 22:23:05 +00:00
|
|
|
%{_mandir}/man1/%{name}*
|
2017-05-02 13:02:54 +00:00
|
|
|
%dir %{_datadir}/bash-completion
|
|
|
|
%dir %{_datadir}/bash-completion/completions
|
2018-02-05 22:23:05 +00:00
|
|
|
%{_datadir}/bash-completion/completions/%{name}
|
2017-05-02 13:02:54 +00:00
|
|
|
|
2019-10-16 13:40:21 +00:00
|
|
|
%files tests
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/%{name}-imgtype
|
2021-07-19 14:52:33 +00:00
|
|
|
%{_bindir}/%{name}-copy
|
2019-10-16 13:40:21 +00:00
|
|
|
%{_datadir}/%{name}/test
|
|
|
|
|
2017-05-02 13:02:54 +00:00
|
|
|
%changelog
|
2022-01-26 22:00:31 +00:00
|
|
|
%autochangelog
|