|
| 1 | +%global crate update-ssh-keys |
| 2 | +%global commit be3ce2acc50313a6826c578e9dbb67e17085d60d |
| 3 | +%global shortcommit %(echo %{commit} | cut -c1-7) |
| 4 | + |
| 5 | +# Below is a manually created tarball containing vendored Rust dependencies. |
| 6 | +# The vendored crates are needed because network access is disabled during build time. |
| 7 | +# |
| 8 | +# How to recreate this vendor tarball: |
| 9 | +# 1. Download the update-ssh-keys source tarball |
| 10 | +# 2. Extract it: tar xzf update-ssh-keys-X.Y.Z.tar.gz && cd update-ssh-keys-X.Y.Z |
| 11 | +# 3. Generate vendor directory: cargo vendor > /dev/null |
| 12 | +# 4. Create the vendor tarball: tar czf ../update-ssh-keys-X.Y.Z-vendor.tar.gz vendor/ |
| 13 | +# |
| 14 | +# Note: The vendor tarball should be uploaded to the GitHub releases page or stored |
| 15 | +# in the package's source location (using the format update-ssh-keys-VERSION-vendor.tar.gz) |
| 16 | + |
| 17 | +Name: update-ssh-keys |
| 18 | +Version: 0.3.0 |
| 19 | +Release: 1%{?dist} |
| 20 | +Summary: Utility for managing OpenSSH authorized public keys |
| 21 | + |
| 22 | +License: Apache-2.0 |
| 23 | +URL: https://github.com/flatcar/update-ssh-keys |
| 24 | +Vendor: Microsoft Corporation |
| 25 | +Distribution: Azure Linux |
| 26 | +Group: System Environment/Base |
| 27 | +Source0: https://github.com/flatcar/update-ssh-keys/archive/%{commit}.tar.gz#/%{name}-%{version}-%{shortcommit}.tar.gz |
| 28 | +SOURCE1: update-ssh-keys-0.3.0-vendor.tar.gz |
| 29 | +BuildRequires: cargo |
| 30 | +BuildRequires: rust >= 1.60 |
| 31 | + |
| 32 | +# make sure we have a new enough coreos-init that we won't conflict with the |
| 33 | +# old bash script |
| 34 | +Requires: coreos-init |
| 35 | + |
| 36 | +%ifarch x86_64 |
| 37 | +%define rust_def_target x86_64-unknown-linux-gnu |
| 38 | +%endif |
| 39 | +%ifarch aarch64 |
| 40 | +%define rust_def_target aarch64-unknown-linux-gnu |
| 41 | +%endif |
| 42 | + |
| 43 | +%description |
| 44 | +update-ssh-keys is a command line tool and library for managing OpenSSH |
| 45 | +authorized public keys. It keeps track of sets of keys with names, allows |
| 46 | +for adding additional keys, as well as deleting and disabling them. |
| 47 | + |
| 48 | +The tool is commonly used on Container Linux and Flatcar to manage SSH |
| 49 | +access in cloud environments. It can integrate with cloud-config and other |
| 50 | +provisioning systems to maintain authorized_keys files. |
| 51 | + |
| 52 | +%prep |
| 53 | +%autosetup -n update-ssh-keys-be3ce2acc50313a6826c578e9dbb67e17085d60d -a1 |
| 54 | + |
| 55 | +# Extract vendored crates |
| 56 | +tar xf %{SOURCE1} |
| 57 | +mkdir -p .cargo |
| 58 | + |
| 59 | +cat >.cargo/config << EOF |
| 60 | +[source.crates-io] |
| 61 | +replace-with = "vendored-sources" |
| 62 | + |
| 63 | +[source.vendored-sources] |
| 64 | +directory = "vendor" |
| 65 | +EOF |
| 66 | + |
| 67 | +%build |
| 68 | +cargo build --release --target=%{rust_def_target} --offline |
| 69 | + |
| 70 | +%install |
| 71 | +mkdir -p %{buildroot}%{_bindir} |
| 72 | +install -m 755 ./target/%{rust_def_target}/release/%{crate} %{buildroot}%{_bindir}/%{crate} |
| 73 | + |
| 74 | +%check |
| 75 | +cargo test --offline |
| 76 | + |
| 77 | +%files |
| 78 | +%license LICENSE |
| 79 | +%doc README.md |
| 80 | +%{_bindir}/%{crate} |
| 81 | + |
| 82 | +%changelog |
| 83 | +* Wed Feb 19 2026 Akarsh Chaudhary <v-akarshc@microsoft.com> - 0.3.0-1 |
| 84 | +- Initial Azure Linux import from the source project (license: same as "License" tag). |
| 85 | +- License verified |
0 commit comments