ssh-key-dir/rust-ssh-key-dir.spec

96 lines
2.3 KiB
RPMSpec
Raw Normal View History

2024-04-18 10:48:17 +08:00
%define debug_package %{nil}
2022-01-26 10:39:50 +08:00
%bcond_without check
%global __cargo_skip_build 0
%global crate ssh-key-dir
Name: rust-%{crate}
2022-11-08 09:47:05 +08:00
Version: 0.1.4
2024-04-18 10:48:17 +08:00
Release: 4
2022-01-26 10:39:50 +08:00
Summary: sshd AuthorizedKeysCommand to read ~/.ssh/authorized_keys.d
License: Apache-2.0
2022-01-26 10:39:50 +08:00
URL: https://crates.io/crates/ssh-key-dir
Source: %{crate}-%{version}.crate
Source1: https://github.com/coreos/%{crate}/releases/download/v%{version}/%{crate}-%{version}-vendor.tar.gz
2022-11-08 09:47:05 +08:00
BuildRequires: rust-packaging >= 21
2022-01-26 10:39:50 +08:00
%global _description %{expand:
sshd AuthorizedKeysCommand to read key files from ~/.ssh/authorized_keys.d.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
License: Apache-2.0 and MIT
2022-01-26 10:39:50 +08:00
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} -p1
%cargo_prep
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
%cargo_install
mkdir -p %{buildroot}%{_libexecdir}
2022-11-08 09:47:05 +08:00
mv %{_builddir}/ssh-key-dir-0.1.4/.cargo/bin/ssh-key-dir %{buildroot}%{_libexecdir}
2022-01-26 10:39:50 +08:00
install -Dpm0644 -t %{buildroot}%{_sysconfdir}/ssh/sshd_config.d conf/40-ssh-key-dir.conf
%if %{with check}
%check
%cargo_test
%endif
%changelog
2024-04-18 10:48:17 +08:00
* Thu Apr 18 2024 lijian <lijian2@kylinos.cn> - 0.1.4-4
- Fix build error, I9HLT0
* Fri Dec 09 2022 liukuo <liukuo@kylinos.cn> - 0.1.4-3
- License compliance rectification
* Fri Dec 09 2022 chendexi <chendexi@kylinos.cn> - 0.1.4-2
2022-12-09 14:49:38 +08:00
- Fix unsafe compile option STRIP
2022-11-08 09:47:05 +08:00
* Tue Nov 08 2022 duyiwei <duyiwei@kylinos.cn> - 0.1.4-1
- upgrade version to 0.1.4
2022-06-07 10:34:31 +08:00
* Tue Jun 07 2022 duyiwei <duyiwei@kylinos.cn> - 0.1.3-1
- upgrade to 0.1.3
2022-01-26 10:39:50 +08:00
* Wed Jan 26 2022 duyiwei <duyiwei@kylinos.cn> - 0.1.2-1
2022-06-07 10:34:31 +08:00
- Package init