Skip to content

Instantly share code, notes, and snippets.

@42wim
Last active October 19, 2018 22:01
Show Gist options
  • Select an option

  • Save 42wim/848fba2ed2d64d457f56eeebef0e85a2 to your computer and use it in GitHub Desktop.

Select an option

Save 42wim/848fba2ed2d64d457f56eeebef0e85a2 to your computer and use it in GitHub Desktop.
buildah 1.4 spec for centos 7
%global with_debug 1
%if 0%{?fedora} || 0%{?rhel} == 6
%global with_bundled 1
%global with_check 1
%else
%global with_bundled 0
%global with_check 0
%endif
%if 0%{?with_debug}
%global _dwz_low_mem_die_limit 0
%else
%global debug_package %{nil}
%endif
%global provider github
%global provider_tld com
%global project containers
%global repo buildah
# https://github.com/containers/buildah
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
%global commit 608fa843cce45e7ee58ccb71a90297b645a984d3
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: %{repo}
Version: 1.4
Release: 1.git%{shortcommit}%{?dist}
Summary: A command line tool used for creating OCI Images
License: ASL 2.0
URL: https://%{provider_prefix}
Source: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: git
BuildRequires: glib2-devel
BuildRequires: ostree-devel
BuildRequires: glibc-static
BuildRequires: go-md2man
BuildRequires: gpgme-devel
BuildRequires: device-mapper-devel
BuildRequires: btrfs-progs-devel
BuildRequires: libassuan-devel
BuildRequires: libseccomp-devel
Requires: runc >= 1.0.0-26
Requires: skopeo-containers >= 0.1.20-2
Requires: container-selinux
Provides: %{repo} = %{version}-%{release}
%description
The buildah package provides a command line tool which can be used to
* 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
%prep
%autosetup -Sgit -n %{name}-%{commit}
%build
mkdir _build
pushd _build
mkdir -p src/%{provider}.%{provider_tld}/%{project}
ln -s $(dirs +1 -l) src/%{import_path}
popd
mv vendor src
export GOPATH=$(pwd)/_build:$(pwd):%{gopath}
make all GIT_COMMIT=%{shortcommit}
%install
export GOPATH=$(pwd)/_build:$(pwd):%{gopath}
make DESTDIR=%{buildroot} PREFIX=%{_prefix} install install.completions
#define license tag if not already defined
%{!?_licensedir:%global license %doc}
%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}*
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment