Package crun: Specfile

%global _unpackaged_files_terminate_build 1
%{?optflags_lto:%global optflags_lto %optflags_lto -ffat-lto-objects}
%define git_commit a220ca661ce078f2c37b38c92e66cf66c012d9c1
%define __nprocs 8
%def_disable embedded_yajl

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

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

BuildRequires: libcap-devel
BuildRequires: libsystemd-devel
BuildRequires: libseccomp-devel
BuildRequires: libblake3-devel
%{?_disable_embedded_yajl:BuildRequires: libyajl-devel}
%ifarch aarch64 ppc64le x86_64
BuildRequires: libcriu-devel >= 3.17
%endif
BuildRequires: libprotobuf-c-devel
BuildRequires: gperf
BuildRequires: go-md2man
BuildRequires: python3 python3-devel
BuildRequires: cmake
Provides: oci-runtime = 2

%description
crun is a runtime for running OCI containers.

%package -n lib%name
Summary: C library for crun
Group: System/Libraries

%description -n lib%name
C library for crun.

%package -n python3-module-crun
Summary: Python bindings for crun
Group: Development/Python3

%description -n python3-module-crun
Python bindings for crun.

%prep
%setup
tar -xf %SOURCE11 -C libocispec
tar -xf %SOURCE12 -C libocispec/image-spec
tar -xf %SOURCE13 -C libocispec/runtime-spec
tar -xf %SOURCE14 -C libocispec/yajl
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 \
	--with-python-bindings \
	%{?_enable_embedded_yajl:--enable-embedded-yajl=yes} \
	--enable-shared
%make_build

%install
%makeinstall_std
rm -f %buildroot%_libdir/lib%name.{a,la,so}
rm -f %buildroot%python3_sitelibdir/*.{a,la}

%files
%doc COPYING README.md
%_bindir/%name
%_man1dir/*

%files -n lib%name
%_libdir/lib%name.so.*

%files -n python3-module-crun
%python3_sitelibdir/python_%name.so

%changelog
* Fri Mar 01 2024 Andrew A. Vasilyev <andy@altlinux.org> 1.14.4-alt1
- 1.14.4

* Sat Feb 17 2024 Andrew A. Vasilyev <andy@altlinux.org> 1.14.3-alt1
- 1.14.3

* Thu Feb 08 2024 Andrew A. Vasilyev <andy@altlinux.org> 1.14.1-alt1
- 1.14.1

* Wed Jan 24 2024 Andrew A. Vasilyev <andy@altlinux.org> 1.14-alt1
- 1.14

* Thu Jan 18 2024 Andrew A. Vasilyev <andy@altlinux.org> 1.13-alt1
- 1.13

* Fri Dec 01 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.12-alt1
- 1.12

* Tue Nov 07 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.11.2-alt1
- 1.11.2

* Fri Oct 27 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.11-alt1
- 1.11

* Thu Sep 28 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.9.2-alt1
- 1.9.2

* Fri Sep 08 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.9-alt1
- 1.9

* Fri Sep 01 2023 Alexey Shabalin <shaba@altlinux.org> 1.8.7-alt1
- 1.8.7

* Fri Aug 11 2023 Alexey Shabalin <shaba@altlinux.org> 1.8.6-alt1
- 1.8.6
- build with system yajl.

* Sat Mar 25 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.8.3-alt1
- 1.8.3

* Tue Mar 21 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.8.2-alt2
- build with python bindings (ALT #45612)

* Tue Mar 21 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.8.2-alt1
- 1.8.2

* Mon Feb 27 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.8.1-alt1
- 1.8.1

* Tue Jan 31 2023 Andrew A. Vasilyev <andy@altlinux.org> 1.8-alt1
- 1.8

* Wed Nov 30 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.7.2-alt1
- 1.7.2

* Fri Nov 25 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.7.1-alt1
- 1.7.1

* Tue Nov 08 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.7-alt1
- 1.7

* Wed Sep 07 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.6-alt1
- 1.6

* Wed Jul 20 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.5-alt1
- 1.5

* Wed Apr 27 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.4.5-alt1
- 1.4.5

* Thu Mar 24 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.4.4-alt1
- 1.4.4

* Thu Mar 03 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.4.3-alt1
- 1.4.3

* Wed Jan 26 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.4.2-alt1
- 1.4.2

* Fri Jan 14 2022 Andrew A. Vasilyev <andy@altlinux.org> 1.4.1-alt1
- 1.4.1

* Fri Nov 05 2021 Andrew A. Vasilyev <andy@altlinux.org> 1.3-alt1
- 1.3

* Fri Oct 08 2021 Andrew A. Vasilyev <andy@altlinux.org> 1.2-alt1
- 1.2

* Mon Sep 27 2021 Andrew A. Vasilyev <andy@altlinux.org> 1.1-alt1
- 1.1

* Thu Aug 26 2021 Andrew A. Vasilyev <andy@altlinux.org> 1.0-alt1
- 1.0

* Mon Jul 26 2021 Andrew A. Vasilyev <andy@altlinux.org> 0.21-alt1
- 0.21

* Tue Jun 15 2021 Alexey Shabalin <shaba@altlinux.org> 0.20.1-alt1
- 0.20.1

* Sat Apr 24 2021 Alexey Shabalin <shaba@altlinux.org> 0.19.1-alt1
- 0.19.1

* Sat Feb 27 2021 Alexey Shabalin <shaba@altlinux.org> 0.18-alt1
- 0.18

* Fri Jan 22 2021 Alexey Shabalin <shaba@altlinux.org> 0.17-alt1
- 0.17

* Tue Nov 24 2020 Andrew A. Vasilyev <andy@altlinux.org> 0.16-alt1
- 0.16

* Tue Nov 03 2020 Andrew A. Vasilyev <andy@altlinux.org> 0.15.1-alt1
- 0.15.1

* Wed Sep 23 2020 Andrew A. Vasilyev <andy@altlinux.org> 0.15-alt1
- 0.15

* 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