Package crun: Specfile

%global _unpackaged_files_terminate_build 1
%define git_commit 88886aef25302adfd40a9335372bbc2b970c8ae5

Summary: OCI runtime written in C
Name: crun
Version: 0.14.1
Release: alt1
Group: Development/Other
License: GPLv3+
Url: https://github.com/containers/crun

Source0: %name-%version.tar
# git submodules
Source11: libocispec.tar
Source12: image-spec.tar
Source13: runtime-spec.tar

BuildRequires: libcap-devel
BuildRequires: libsystemd-devel
BuildRequires: libyajl-devel
BuildRequires: libseccomp-devel
%ifarch aarch64 ppc64le x86_64
BuildRequires: libcriu-devel >= 3.13
%endif
BuildRequires: gperf
BuildRequires: go-md2man
BuildRequires: python3
Provides: oci-runtime = 2

%description
crun is a runtime for running OCI containers

%prep
%setup
tar -xf %SOURCE11 -C libocispec
tar -xf %SOURCE12 -C libocispec/image-spec
tar -xf %SOURCE13 -C libocispec/runtime-spec
echo "%version" > .tarball-version
printf "/* autogenerated.  */\n#ifndef GIT_VERSION\n# define GIT_VERSION \"%s\"\n#endif\n" %git_commit > git-version.h

%build
%autoreconf
%configure --disable-silent-rules
# fix parallel build
%make_build -C libocispec src/json_common.h src/json_common.c
%make_build

%install
%makeinstall_std
rm -f %buildroot%_libdir/*.a

%files
%doc COPYING
%_bindir/%name
%_man1dir/*

%changelog
* Tue Sep 08 2020 Andrew A. Vasilyev <andy@altlinux.org> 0.14.1-alt1
- 0.14.1

* Sat Jul 04 2020 Alexey Shabalin <shaba@altlinux.org> 0.14-alt1
- 0.14

* Fri Mar 13 2020 Alexey Shabalin <shaba@altlinux.org> 0.13-alt1
- 0.13

* Wed Dec 11 2019 Alexey Shabalin <shaba@altlinux.org> 0.10.6-alt1
- 0.10.6 (fixes: CVE-2019-18837)

* Wed Nov 06 2019 Alexey Shabalin <shaba@altlinux.org> 0.10.4-alt1
- 0.10.4

* Thu Oct 10 2019 Alexey Shabalin <shaba@altlinux.org> 0.10.2-alt1
- 0.10.2

* Mon Sep 23 2019 Alexey Shabalin <shaba@altlinux.org> 0.9.1-alt1
- 0.9.1

* Fri Sep 13 2019 Alexey Shabalin <shaba@altlinux.org> 0.9-alt1
- Initial build