# Usage # rpmbuild --undefine=_disable_source_fetch -ba pam_ssh_agent.spec # Generated by rust2rpm 27 %bcond check 1 # prevent library files from being installed %global cargo_install_lib 0 ## define versions of built-in dependencies # Fedora <= 43 + EL <= 10 %define pam_bindings 0.1.1 %define ssh_agent_client_rs 0.9.1 # EL <= 10 %define ssh_key 0.6.5 %define ssh_encoding 0.2.0 %define ssh_cipher 0.2.0 %define ed25519_dalek 2.1.1 %define curve25519_dalek 4.1.3 %define curve25519_dalek_derive 0.1.1 %define p256 0.13.2 %define p521 0.13.3 %if 0%{?fedora} <= 43 || 0%{?rhel} <= 10 %define b_pam_bindings 1 %define b_ssh_agent_client_rs 1 %endif %if 0%{?rhel} && 0%{?rhel} <= 10 %define b_ssh_key 1 %define b_ssh_encoding 1 %define b_ssh_cipher 1 %define b_ed25519_dalek 1 %define b_curve25519_dalek 1 %define b_curve25519_dalek_derive 1 %define b_p256 1 %define b_p521 1 %endif Name: pam_ssh_agent Version: 0.5.1 Release: 3 Summary: PAM module for ssh-agent based authentication SourceLicense: MIT License: Apache-2.0 or MIT URL: https://github.com/nresare/pam-ssh-agent Source0: https://github.com/nresare/pam-ssh-agent/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: pam-devel Source10: https://static.crates.io/crates/pam-bindings/pam-bindings-%{pam_bindings}.crate Source11: https://static.crates.io/crates/ssh-agent-client-rs/ssh-agent-client-rs-%{ssh_agent_client_rs}.crate Source12: https://static.crates.io/crates/ssh-key/ssh-key-%{ssh_key}.crate Source13: https://static.crates.io/crates/ssh-encoding/ssh-encoding-%{ssh_encoding}.crate Source14: https://static.crates.io/crates/ssh-cipher/ssh-cipher-%{ssh_cipher}.crate Source15: https://static.crates.io/crates/ed25519-dalek/ed25519-dalek-%{ed25519_dalek}.crate Source16: https://static.crates.io/crates/p256/p256-%{p256}.crate Source17: https://static.crates.io/crates/p521/p521-%{p521}.crate Source18: https://static.crates.io/crates/curve25519-dalek/curve25519-dalek-%{curve25519_dalek}.crate Source19: https://static.crates.io/crates/curve25519-dalek-derive/curve25519-dalek-derive-%{curve25519_dalek_derive}.crate # built-in dependencies %if 0%{?b_pam_bindings} %define has_bundles 1 Provides: bundled(crate(pam-binding+default)) = %{pam_bindings} %else BuildRequires: rust-pam-bindings+default-devel %endif %if 0%{?b_ssh_agent_client_rs} %define has_bundles 1 Provides: bundled(crate(ssh-agent-client-rs+default)) = %{ssh_agent_client_rs} BuildRequires: rust-bytes-devel BuildRequires: rust-thiserror1-devel %else BuildRequires: rust-ssh-agent-client-rs+default-devel %endif %if 0%{?b_ssh_key} %define has_bundles 1 Provides: bundled(crate(ssh-key+default)) = %{ssh_key} Provides: bundled(crate(ssh-key+crypto)) = %{ssh_key} BuildRequires: rust-num-bigint-dig-devel BuildRequires: rust-p384-devel BuildRequires: rust-rsa-devel BuildRequires: rust-sha2-devel BuildRequires: rust-cipher-devel %else BuildRequires: rust-ssh-key+default-devel BuildRequires: rust-ssh-key+crypto-devel %endif %if 0%{?b_ssh_encoding} %define has_bundles 1 Provides: bundled(crate(ssh-encoding+default)) = %{ssh_encoding} BuildRequires: rust-pem-rfc7468-devel %else BuildRequires: rust-ssh-encoding+default-devel %endif %if 0%{?b_ssh_cipher} %define has_bundles 1 Provides: bundled(crate(ssh-cipher+default)) = %{ssh_cipher} %else BuildRequires: rust-ssh-cipher+default-devel %endif %if 0%{?b_ed25519_dalek} %define has_bundles 1 Provides: bundled(crate(ed25519-dalek)) = %{ed25519_dalek} BuildRequires: rust-ed25519-devel %else BuildRequires: rust-ed25519-dalek-devel %endif %if 0%{?b_p256} %define has_bundles 1 Provides: bundled(crate(p256)) = %{p256} BuildRequires: rust-ecdsa-devel BuildRequires: rust-rfc6979-devel %else BuildRequires: rust-p256-devel %endif %if 0%{?b_p521} %define has_bundles 1 Provides: bundled(crate(p521)) = %{p521} %else BuildRequires: rust-p521-devel %endif %if 0%{?b_curve25519_dalek} %define has_bundles 1 Provides: bundled(crate(curve25519-dalek)) = %{curve25519_dalek} BuildRequires: rust-rustc_version-devel BuildRequires: rust-fiat-crypto-devel %else BuildRequires: rust-curve25519-dalek-devel %endif %if 0%{?b_curve25519_dalek_derive} %define has_bundles 1 Provides: bundled(crate(curve25519-dalek-derive)) = %{curve25519_dalek_derive} %else BuildRequires: rust-curve25519-dalek-derive-devel %endif BuildRequires: cargo-rpm-macros >= 26 ## from Cargo.toml BuildRequires: rust-anyhow+default-devel BuildRequires: rust-getrandom0.2+default-devel BuildRequires: rust-signature+default-devel BuildRequires: rust-syslog+default-devel %global _description %{expand: %{summary}.} %description %{_description} %prep %autosetup -n pam-ssh-agent-%{version} -p1 # built-in dependencies %if 0%{?b_pam_bindings} %{__tar} xzf %{SOURCE10} %{__sed} -i 's/\(pam-bindings\) = .*/\1 = { path = "pam-bindings-%{pam_bindings}" }/' Cargo.toml %endif %if 0%{?b_ssh_agent_client_rs} %{__tar} xzf %{SOURCE11} %{__sed} -i 's/\(ssh-agent-client-rs\) = .*/\1 = { path = "ssh-agent-client-rs-%{ssh_agent_client_rs}" }/' Cargo.toml %endif %if 0%{?b_ssh_key} %{__tar} xzf %{SOURCE12} %{__sed} -i 's/\(ssh-key\) = .*/\1 = { path = "ssh-key-%{ssh_key}", features = ["crypto"] }/' Cargo.toml %{__sed} -i 's/\(dependencies.ssh-key\]\)/\1\npath = "..\/ssh-key-%{ssh_key}"/' ssh-agent-client-rs-%{ssh_agent_client_rs}/Cargo.toml %endif %if 0%{?b_ed25519_dalek} %{__tar} xzf %{SOURCE15} %{__sed} -i 's/\(dependencies.ed25519-dalek\]\)/\1\npath = "..\/ed25519-dalek-%{ed25519_dalek}"/' ssh-key-%{ssh_key}/Cargo.toml %endif %if 0%{?b_ssh_cipher} %{__tar} xzf %{SOURCE14} %{__sed} -i 's/\(dependencies.cipher\]\)/\1\npath = "..\/ssh-cipher-%{ssh_cipher}"/' ssh-key-%{ssh_key}/Cargo.toml %endif %if 0%{?b_ssh_encoding} %{__tar} xzf %{SOURCE13} %{__sed} -i 's/\(dependencies.ssh-encoding\]\)/\1\npath = "..\/ssh-encoding-%{ssh_encoding}"/' ssh-agent-client-rs-%{ssh_agent_client_rs}/Cargo.toml %{__sed} -i 's/\(dependencies.encoding\]\)/\1\npath = "..\/ssh-encoding-%{ssh_encoding}"/' ssh-key-%{ssh_key}/Cargo.toml %{__sed} -i 's/\(dependencies.encoding\]\)/\1\npath = "..\/ssh-encoding-%{ssh_encoding}"/' ssh-cipher-%{ssh_cipher}/Cargo.toml %endif %if 0%{?b_p256} %{__tar} xzf %{SOURCE16} %{__sed} -i 's/\(dependencies.p256\]\)/\1\npath = "..\/p256-%{p256}"/' ssh-key-%{ssh_key}/Cargo.toml %endif %if 0%{?b_p521} %{__tar} xzf %{SOURCE17} %{__sed} -i 's/\(dependencies.p521\]\)/\1\npath = "..\/p521-%{p521}"/' ssh-key-%{ssh_key}/Cargo.toml %endif %if 0%{?b_curve25519_dalek} %{__tar} xzf %{SOURCE18} %{__sed} -i 's/\(dependencies.curve25519-dalek\]\)/\1\npath = "..\/curve25519-dalek-%{curve25519_dalek}"/' ed25519-dalek-%{ed25519_dalek}/Cargo.toml %endif %if 0%{?b_curve25519_dalek_derive} %{__tar} xzf %{SOURCE19} %{__sed} -i 's/\(dependencies.curve25519-dalek-derive\]\)/\1\npath = "..\/curve25519-dalek-derive-%{curve25519_dalek_derive}"/' curve25519-dalek-%{curve25519_dalek}/Cargo.toml %endif %cargo_prep %generate_buildrequires %if 0%{has_bundles} %else %cargo_generate_buildrequires %endif %build %cargo_build %{cargo_license_summary} %install install -d -m 755 %{buildroot}%{_libdir}/security install -m 755 target/release/libpam_ssh_agent.so %{buildroot}%{_libdir}/security %check %if %{with check} %cargo_test %endif %files %doc README.md %{_libdir}/security/libpam_ssh_agent.so %changelog * Thu May 15 2025 Peter Bieringer - 0.5.1-3 - Unconditionally package all sources to avoid issues with copr builds * Tue May 13 2025 Peter Bieringer - 0.5.1-2 - Add support for EL10 by conditional bundling of ssh_key=0.6.5 ssh-encoding=0.2.0 ssh-cipher=0.2.0 ed25519-dalek=2.1.1 curve25519-dalek=4.1.3 curve25519-dalek-derive=0.1.1 p256=0.13.2 p521=0.13.3 * Mon May 12 2025 Peter Bieringer - 0.5.1-1 - Upstream 0.5.1 incl. bundled pam-bindings=0.1.1 and ssh-agent-client-rs=0.9.1