diff --git a/bootupd-0.2.5-vendor.tar.gz b/bootupd-0.2.5-vendor.tar.gz new file mode 100644 index 0000000..cf546fe Binary files /dev/null and b/bootupd-0.2.5-vendor.tar.gz differ diff --git a/bootupd-0.2.5.crate b/bootupd-0.2.5.crate new file mode 100644 index 0000000..af7cad4 Binary files /dev/null and b/bootupd-0.2.5.crate differ diff --git a/rust-bootupd.spec b/rust-bootupd.spec new file mode 100644 index 0000000..0e3cb73 --- /dev/null +++ b/rust-bootupd.spec @@ -0,0 +1,66 @@ +%global crate bootupd + +Name: rust-%{crate} +Version: 0.2.5 +Release: 1 +Summary: Bootloader updater + +License: ASL 2.0 +URL: https://crates.io/crates/bootupd +Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +Source1: https://github.com/coreos/%{crate}/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz + +ExclusiveArch: x86_64 aarch64 +BuildRequires: make +BuildRequires: openssl-devel +BuildRequires: rust-packaging +BuildRequires: systemd + +%global _description %{expand: +Bootloader updater} +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +License: ASL 2.0 +%{?systemd_requires} + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%doc README.md +%{_bindir}/bootupctl +%{_libexecdir}/bootupd +%{_unitdir}/* + +%prep +%autosetup -n %{crate}-%{version} -p1 +tar xvf %{SOURCE1} +mkdir -p .cargo +cat >.cargo/config << EOF +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOF + +%build +%cargo_build + +%install +%make_install INSTALL="install -p -c" + +%post -n %{crate} +%systemd_post bootupd.service bootupd.socket + +%preun -n %{crate} +%systemd_preun bootupd.service bootupd.socket + +%postun -n %{crate} +%systemd_postun bootupd.service bootupd.socket + +%changelog +* Mon Jan 17 2022 fushanqing - 0.2.5-1 +- Initial package \ No newline at end of file