File bootc.spec of Package bootc

#
# spec file for package bootc
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           bootc
Version:        1.3.0
Release:        0
Summary:        Bootable container system
License:        Apache-2.0 OR MIT
URL:            https://github.com/containers/bootc
Source0:        %{url}/releases/download/v%{version}/%{name}-%{version}.tar.zstd#/%{name}-%{version}.tar.zst
Source1:        %{url}/releases/download/v%{version}/%{name}-%{version}-vendor.tar.zstd#/%{name}-%{version}-vendor.tar.zst
Source2:        cargo.conf
Patch0:         fix-Makefile.patch
BuildRequires:  cargo-packaging
BuildRequires:  libostree
BuildRequires:  rust >= 1.75
BuildRequires:  skopeo
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  pkgconfig(openssl) >= 3.0.0
BuildRequires:  pkgconfig(ostree-1)
BuildRequires:  pkgconfig(systemd)
Requires:       composefs
Requires:       podman
Requires:       skopeo
# For bootloader updates
Recommends: bootupd

%description
Transactional, in-place operating system updates using OCI/Docker container images.

%prep
%autosetup -a1 -p1
cp %{SOURCE2} .cargo/config
#fix version in Cargo.toml file so cli tool outputs the correct version
sed -i 's|version = "0.1.9"| version = "%{version}"|g' cli/Cargo.toml

%build
%{cargo_build}

%install
%make_install

%check
%{cargo_test} -- --skip test_is_mountpoint

%pre
%service_add_pre %{name}-fetch-apply-updates.service

%post
%service_add_post %{name}-fetch-apply-updates.service

%preun
%service_del_preun %{name}-fetch-apply-updates.service

%postun
%service_del_postun %{name}-fetch-apply-updates.service

%files
%license LICENSE-APACHE LICENSE-MIT
%doc README.md
%{_bindir}/%{name}
%{_bindir}/system-reinstall-bootc
%{_mandir}/man?/%{name}*.?%{?ext_man}
%{_datadir}/doc/bootc
%{_unitdir}/%{name}-fetch-apply-updates.*
%{_systemdgeneratordir}/%{name}-systemd-generator
%{_unitdir}/bootc-destructive-cleanup.service
%{_unitdir}/bootc-publish-rhsm-facts.service
%{_unitdir}/bootc-status-updated-onboot.target
%{_unitdir}/bootc-status-updated.path
%{_unitdir}/bootc-status-updated.target
%{_unitdir}/multi-user.target.wants/bootc-status-updated-onboot.target
%{_unitdir}/multi-user.target.wants/bootc-status-updated.path

%changelog
openSUSE Build Service is sponsored by