|
| 1 | +%global debug_package %{nil} |
| 2 | + |
| 3 | +Summary: Tardev Snapshotter for containerd |
| 4 | +Name: tardev-snapshotter |
| 5 | +Version: 3.2.0.tardev1 |
| 6 | +Release: 1%{?dist} |
| 7 | +License: ASL 2.0 |
| 8 | +Group: Tools/Container |
| 9 | +Vendor: Microsoft Corporation |
| 10 | +Distribution: Azure Linux |
| 11 | + |
| 12 | +Source0:https://github.com/microsoft/kata-containers/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz |
| 13 | +# Note: the %%{name}-%%{name}-%%{version}-cargo.tar.gz file contains a cache created by capturing the contents downloaded into $CARGO_HOME. |
| 14 | +# To update the cache run regenerate-archives.sh |
| 15 | +Source1: %{_distro_sources_url}/%{name}-%{version}-cargo.tar.gz |
| 16 | + |
| 17 | +%{?systemd_requires} |
| 18 | + |
| 19 | +BuildRequires: clang-devel |
| 20 | +BuildRequires: cmake |
| 21 | +BuildRequires: device-mapper-devel |
| 22 | +BuildRequires: git |
| 23 | +BuildRequires: make |
| 24 | +BuildRequires: openssl-devel |
| 25 | +BuildRequires: pkgconfig(libudev) |
| 26 | +BuildRequires: protobuf-compiler |
| 27 | +BuildRequires: rust |
| 28 | + |
| 29 | +%description |
| 30 | +tardev-snapshotter is a snapshotter for containerd that uses tar archives to store snapshots. |
| 31 | + |
| 32 | +%prep |
| 33 | +# Setup .cargo directory |
| 34 | +mkdir -p $HOME |
| 35 | +pushd $HOME |
| 36 | +tar xf %{SOURCE1} --no-same-owner |
| 37 | +popd |
| 38 | + |
| 39 | +%autosetup -p1 |
| 40 | + |
| 41 | +%build |
| 42 | +export CARGO_NET_OFFLINE=true |
| 43 | +make |
| 44 | + |
| 45 | +%install |
| 46 | +mkdir -p %{buildroot}/%{_unitdir} |
| 47 | +install -D -p -m 0644 %{name}.service %{buildroot}%{_unitdir}/%{name}.service |
| 48 | +install -D -m 0755 target/release/%{name} %{buildroot}%{_bindir}/%{name} |
| 49 | + |
| 50 | +%post |
| 51 | +%systemd_post %{name}.service |
| 52 | + |
| 53 | +if [ $1 -eq 1 ]; then # Package install |
| 54 | + systemctl enable %{name}.service > /dev/null 2>&1 || : |
| 55 | + systemctl start %{name}.service > /dev/null 2>&1 || : |
| 56 | +fi |
| 57 | + |
| 58 | +%preun |
| 59 | +%systemd_preun %{name}.service |
| 60 | + |
| 61 | +%postun |
| 62 | +%systemd_postun_with_restart %{name}.service |
| 63 | + |
| 64 | +%files |
| 65 | +%license LICENSE |
| 66 | +%{_bindir}/%{name} |
| 67 | +%config(noreplace) %{_unitdir}/%{name}.service |
| 68 | + |
| 69 | +%changelog |
| 70 | +* Fri Mar 28 2025 Dallas Delaney <dadelan@microsoft.com> - 3.2.0.tardev1-1 |
| 71 | +- Add package to specs-extended |
| 72 | +- License verified |
| 73 | +- Original version for Azure Linux |
| 74 | + |
| 75 | +* Tue Dec 31 2024 Jiri Appl <jiria@microsoft.com> - 0.0.13-1 |
| 76 | +- Initial version |
0 commit comments