File ntpd-rs.spec of Package failed_ntpd-rs

Name:           ntpd-rs
Version:        1.5.0
Release:        1.1
Summary:        Network Time Protocol daemon written in Rust

License:        MIT
URL:            https://example.org/ntpd-rs
Source0:        ntpd-rs-1.5.0.tar.gz
Source1:        vendor.tar.zst

BuildRequires:  rust
BuildRequires:  cargo
BuildRequires:  cmake

%description
ntpd-rs is an implementation of an NTP daemon written in Rust.

%prep
%autosetup -n %{name}-%{version}
# vendor.tar.zst contains vendored crates, unpack if present
%if %{?with_vendor}
%setup -q -c -T
/usr/lib/rpm/rpmuncompress -x %{_sourcedir}/vendor.tar.zst || :
%endif

%build
# Keep environment consistent with upstream build invocation
unset LIBSSH2_SYS_USE_PKG_CONFIG || true
export CARGO_AUDITABLE=auditable
export CARGO_INCREMENTAL=0
export CARGO_FEATURE_VENDORED=1
export RUSTFLAGS=' -Clink-arg=-Wl,-z,relro,-z,now -C debuginfo=2 -C strip=none'
export CARGO_TARGET_DIR=%{_builddir}/%{name}-%{version}/target

# Build with cargo (offline/locked) to mirror upstream packaging
%{__cargo} auditable build -j%{_smp_mflags} --offline --locked --release

%install
rm -rf %{buildroot}
install -d %{buildroot}%{_bindir}
# Upstream build will place binary under target/release/
install -m 0755 %{_builddir}/%{name}-%{version}/target/release/ntpd-rs %{buildroot}%{_bindir}/ntpd-rs

%files
%license LICENSE*
%doc README*
%{_bindir}/ntpd-rs

%changelog
* Sun Aug 10 2025 Your Name <you@example.com> - 1.5.0-1.1
- Add BuildRequires: cmake to satisfy aws-lc-sys build script which requires cmake.
openSUSE Build Service is sponsored by