fdc011f21a
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
120 lines
4.6 KiB
RPMSpec
120 lines
4.6 KiB
RPMSpec
# Generated by rust2rpm
|
|
%bcond_without check
|
|
|
|
%global crate afterburn
|
|
|
|
Name: rust-%{crate}
|
|
Version: 4.1.0
|
|
Release: 1%{?dist}
|
|
Summary: Simple cloud provider agent
|
|
|
|
# Upstream license specification: Apache-2.0
|
|
License: ASL 2.0
|
|
URL: https://crates.io/crates/afterburn
|
|
Source: %{crates_source}
|
|
# Initial patched metadata
|
|
# * Switch to split version of pnet_*
|
|
# * Downgrade reqwest to 0.9.13 temporarily
|
|
Patch0: afterburn-fix-metadata.diff
|
|
# Finish splitting pnet_*
|
|
Patch0001: 0001-Use-pnet_-subcrates.patch
|
|
|
|
ExclusiveArch: %{rust_arches}
|
|
|
|
BuildRequires: rust-packaging
|
|
BuildRequires: (crate(base64/default) >= 0.10.1 with crate(base64/default) < 0.11.0)
|
|
BuildRequires: (crate(byteorder/default) >= 1.3.0 with crate(byteorder/default) < 2.0.0)
|
|
BuildRequires: (crate(clap/default) >= 2.33.0 with crate(clap/default) < 3.0.0)
|
|
BuildRequires: (crate(error-chain) >= 0.12.0 with crate(error-chain) < 0.13.0)
|
|
BuildRequires: (crate(hostname/default) >= 0.1.0 with crate(hostname/default) < 0.2.0)
|
|
BuildRequires: (crate(ipnetwork/default) >= 0.14.0 with crate(ipnetwork/default) < 0.15.0)
|
|
BuildRequires: (crate(mime/default) >= 0.3.0 with crate(mime/default) < 0.4.0)
|
|
BuildRequires: (crate(nix/default) >= 0.13.0 with crate(nix/default) < 0.14.0)
|
|
BuildRequires: (crate(openssh-keys/default) >= 0.4.1 with crate(openssh-keys/default) < 0.5.0)
|
|
BuildRequires: (crate(openssl/default) >= 0.10.20 with crate(openssl/default) < 0.11.0)
|
|
BuildRequires: (crate(pnet_base/default) >= 0.22.0 with crate(pnet_base/default) < 0.23.0)
|
|
BuildRequires: (crate(pnet_datalink/default) >= 0.22.0 with crate(pnet_datalink/default) < 0.23.0)
|
|
BuildRequires: (crate(reqwest/default) >= 0.9.13 with crate(reqwest/default) < 0.10.0)
|
|
BuildRequires: (crate(serde-xml-rs/default) >= 0.3.0 with crate(serde-xml-rs/default) < 0.4.0)
|
|
BuildRequires: (crate(serde/default) >= 1.0.0 with crate(serde/default) < 2.0.0)
|
|
BuildRequires: (crate(serde_derive/default) >= 1.0.0 with crate(serde_derive/default) < 2.0.0)
|
|
BuildRequires: (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0)
|
|
BuildRequires: (crate(slog-async/default) >= 2.1.0 with crate(slog-async/default) < 3.0.0)
|
|
BuildRequires: (crate(slog-scope/default) >= 4.1.0 with crate(slog-scope/default) < 4.2.0)
|
|
BuildRequires: (crate(slog-term/default) >= 2.2.0 with crate(slog-term/default) < 3.0.0)
|
|
BuildRequires: (crate(slog/default) >= 2.0.0 with crate(slog/default) < 3.0.0)
|
|
BuildRequires: (crate(slog/max_level_trace) >= 2.0.0 with crate(slog/max_level_trace) < 3.0.0)
|
|
BuildRequires: (crate(slog/release_max_level_info) >= 2.0.0 with crate(slog/release_max_level_info) < 3.0.0)
|
|
BuildRequires: (crate(tempdir/default) >= 0.3.0 with crate(tempdir/default) < 0.4.0)
|
|
BuildRequires: (crate(tempfile/default) >= 3.0.7 with crate(tempfile/default) < 4.0.0)
|
|
BuildRequires: (crate(users/default) >= 0.9.1 with crate(users/default) < 0.10.0)
|
|
%if %{with check}
|
|
BuildRequires: (crate(mockito/default) >= 0.17.0 with crate(mockito/default) < 0.18.0)
|
|
%endif
|
|
BuildRequires: systemd
|
|
|
|
%global _description \
|
|
A simple cloud provider agent.
|
|
|
|
%description %{_description}
|
|
|
|
%package -n %{crate}
|
|
Summary: %{summary}
|
|
%{?systemd_requires}
|
|
|
|
%description -n %{crate} %{_description}
|
|
|
|
%files -n %{crate}
|
|
%license LICENSE
|
|
%doc README.md
|
|
%{_bindir}/afterburn
|
|
%{_unitdir}/afterburn.service
|
|
%{_unitdir}/afterburn-checkin.service
|
|
%{_unitdir}/afterburn-firstboot-checkin.service
|
|
%{_unitdir}/afterburn-sshkeys@.service
|
|
|
|
%post -n %{crate}
|
|
%systemd_post afterburn.service
|
|
%systemd_post afterburn-checkin.service
|
|
%systemd_post afterburn-firstboot-checkin.service
|
|
%systemd_post afterburn-sshkeys@.service
|
|
|
|
%preun -n %{crate}
|
|
%systemd_preun afterburn.service
|
|
%systemd_preun afterburn-checkin.service
|
|
%systemd_preun afterburn-firstboot-checkin.service
|
|
%systemd_preun afterburn-sshkeys@.service
|
|
|
|
%postun -n %{crate}
|
|
%systemd_postun afterburn.service
|
|
%systemd_postun afterburn-checkin.service
|
|
%systemd_postun afterburn-firstboot-checkin.service
|
|
%systemd_postun afterburn-sshkeys@.service
|
|
|
|
%prep
|
|
%autosetup -n %{crate}-%{version_no_tilde} -p1
|
|
# afterburn-sshkeys@.service is by default enabled for the 'core' user in
|
|
# Fedora CoreOS.
|
|
# Based on https://github.com/coreos/afterburn/blob/master/Makefile.
|
|
sed -e 's,@DEFAULT_INSTANCE@,core,' < \
|
|
systemd/afterburn-sshkeys@.service.in > \
|
|
systemd/afterburn-sshkeys@.service
|
|
%cargo_prep
|
|
|
|
%build
|
|
%cargo_build
|
|
|
|
%install
|
|
%cargo_install
|
|
%{__install} -Dpm0644 -t %{buildroot}%{_unitdir} \
|
|
systemd/*.service
|
|
|
|
%if %{with check}
|
|
%check
|
|
%cargo_test
|
|
%endif
|
|
|
|
%changelog
|
|
* Sat Apr 27 09:55:54 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.1.0-1
|
|
- Initial package
|