Skip to content

Commit 04332ca

Browse files
authored
Merge pull request #1026 from jmarrero/spec-update
contrib/packaging/bootc.spec: sync with current Fedora rawhide
2 parents 8dff320 + 8af4271 commit 04332ca

File tree

2 files changed

+88
-34
lines changed

2 files changed

+88
-34
lines changed

contrib/packaging/bootc.spec

Lines changed: 84 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,108 @@
11
%bcond_without check
2+
%if 0%{?rhel} >= 10 || 0%{?fedora} > 41
3+
%bcond_without ostree_ext
4+
%else
5+
%bcond_with ostree_ext
6+
%endif
7+
8+
%if 0%{?rhel}
9+
%bcond_without rhsm
10+
%else
11+
%bcond_with rhsm
12+
%endif
213

314
Name: bootc
4-
Version: 0.1
15+
Version: 1.1.4
516
Release: 1%{?dist}
6-
Summary: Boot containers
17+
Summary: Bootable container system
718

8-
License: ASL 2.0
19+
# Apache-2.0
20+
# Apache-2.0 OR BSL-1.0
21+
# Apache-2.0 OR MIT
22+
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
23+
# BSD-3-Clause
24+
# MIT
25+
# MIT OR Apache-2.0
26+
# Unlicense OR MIT
27+
License: Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
928
URL: https://github.com/containers/bootc
10-
Source0: https://github.com/containers/bootc/releases/download/v%{version}/bootc-%{version}.tar.zstd
11-
Source1: https://github.com/containers/bootc/releases/download/v%{version}/bootc-%{version}-vendor.tar.zstd
29+
Source0: %{url}/releases/download/v%{version}/bootc-%{version}.tar.zstd
30+
Source1: %{url}/releases/download/v%{version}/bootc-%{version}-vendor.tar.zstd
31+
32+
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
33+
ExcludeArch: %{ix86}
1234

35+
BuildRequires: libzstd-devel
1336
BuildRequires: make
14-
BuildRequires: openssl-devel
15-
BuildRequires: cargo
16-
BuildRequires: systemd
17-
# For autosetup -Sgit
18-
BuildRequires: git
19-
BuildRequires: zlib-devel
2037
BuildRequires: ostree-devel
2138
BuildRequires: openssl-devel
22-
BuildRequires: systemd-devel
23-
BuildRequires: libzstd-devel
39+
%if 0%{?rhel}
40+
BuildRequires: rust-toolset
41+
%else
42+
BuildRequires: cargo-rpm-macros >= 25
43+
%endif
44+
BuildRequires: systemd
45+
# For tests
46+
BuildRequires: skopeo ostree
47+
48+
# Backing storage tooling https://github.com/containers/composefs/issues/125
49+
Requires: composefs
50+
# For OS updates
51+
Requires: ostree
52+
Requires: skopeo
53+
Requires: podman
54+
# For bootloader updates
55+
Recommends: bootupd
56+
57+
# A made up provides so that rpm-ostree can depend on it
58+
%if %{with ostree_ext}
59+
Provides: ostree-cli(ostree-container)
60+
%endif
2461

2562
%description
2663
%{summary}
2764

65+
%prep
66+
%autosetup -p1 -a1
67+
%cargo_prep -v vendor
68+
69+
%build
70+
%if 0%{?rhel} == 10
71+
%cargo_build %{?with_rhsm:-f rhsm}
72+
%else
73+
%cargo_build %{?with_rhsm:--features rhsm}
74+
%endif
75+
76+
%cargo_vendor_manifest
77+
%cargo_license_summary
78+
%{cargo_license} > LICENSE.dependencies
79+
80+
%install
81+
%make_install INSTALL="install -p -c"
82+
%if %{with ostree_ext}
83+
make install-ostree-hooks DESTDIR=%{?buildroot}
84+
%endif
85+
86+
%if %{with check}
87+
%check
88+
%cargo_test
89+
%endif
90+
2891
%files
29-
%license LICENSE-APACHE LICENSE-MIT
92+
%license LICENSE-MIT
93+
%license LICENSE-APACHE
94+
%license LICENSE.dependencies
95+
%license cargo-vendor.txt
3096
%doc README.md
3197
%{_bindir}/bootc
98+
%{_prefix}/lib/bootc/
3299
%{_prefix}/lib/systemd/system-generators/*
33-
%{_prefix}/lib/bootc
100+
%if %{with ostree_ext}
101+
%{_prefix}/libexec/libostree/ext/*
102+
%endif
34103
%{_unitdir}/*
35104
%{_docdir}/bootc/*
36105
%{_mandir}/man*/bootc*
37106

38-
%prep
39-
%autosetup -p1 -Sgit
40-
tar -xv -f %{SOURCE1}
41-
mkdir -p .cargo
42-
cat >>.cargo/config.toml << EOF
43-
[source.crates-io]
44-
replace-with = "vendored-sources"
45-
46-
[source.vendored-sources]
47-
directory = "vendor"
48-
EOF
49-
50-
%build
51-
make
52-
53-
%install
54-
%make_install INSTALL="install -p -c"
55-
56107
%changelog
57108
%autochangelog

lib/src/lints.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ mod tests {
297297
assert!(check_baseimage_root(&td).is_err());
298298

299299
// Copy our reference base image content from the source dir
300-
let manifest = std::env::var_os("CARGO_MANIFEST_PATH").unwrap();
300+
let Some(manifest) = std::env::var_os("CARGO_MANIFEST_PATH") else {
301+
// This was only added in relatively recent cargo
302+
return Ok(());
303+
};
301304
let srcdir = Path::new(&manifest)
302305
.parent()
303306
.unwrap()

0 commit comments

Comments
 (0)