diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1f759d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/ssh-key-dir-0.1.1.crate diff --git a/rust-ssh-key-dir.spec b/rust-ssh-key-dir.spec new file mode 100644 index 0000000..95d6466 --- /dev/null +++ b/rust-ssh-key-dir.spec @@ -0,0 +1,72 @@ +# Generated by rust2rpm 13 +%bcond_without check +%global __cargo_skip_build 0 + +%global crate ssh-key-dir + +Name: rust-%{crate} +Version: 0.1.1 +Release: 1%{?dist} +Summary: sshd AuthorizedKeysCommand to read ~/.ssh/authorized_keys.d + +# Upstream license specification: Apache-2.0 +License: ASL 2.0 +URL: https://crates.io/crates/ssh-key-dir +Source: %{crates_source} + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging + +%global _description %{expand: +sshd AuthorizedKeysCommand to read key files from ~/.ssh/authorized_keys.d.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +Requires: openssh-server +Requires(post): openssh-server +Requires(post): systemd +Requires(postun): openssh-server +Requires(postun): systemd + +%description -n %{crate} %{_description} + +%files -n %{crate} +%{_libexecdir}/ssh-key-dir +%config(noreplace) %{_sysconfdir}/ssh/sshd_config.d/40-ssh-key-dir.conf +%doc README.md +%license LICENSE + +%post -n %{crate} +/usr/bin/systemctl try-reload-or-restart sshd.service + +%postun -n %{crate} +if [ $1 == 0 ] ; then + /usr/bin/systemctl try-reload-or-restart sshd.service +fi + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install +mv %{buildroot}%{_bindir} %{buildroot}%{_libexecdir} +install -Dpm0644 -t %{buildroot}%{_sysconfdir}/ssh/sshd_config.d conf/40-ssh-key-dir.conf + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Wed Jun 17 2020 Benjamin Gilbert - 0.1.1-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..4a75c5a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ssh-key-dir-0.1.1.crate) = 8481d7002438a062500bc12171f045e346e51f494c63ae78550dd98bbe48901fb284ff996df1f64e8e72b2bc0e4a56332f21c87696a7e7b83a162261be00c889