-
Notifications
You must be signed in to change notification settings - Fork 0
/
totpm.spec
63 lines (49 loc) · 1.42 KB
/
totpm.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Generated by rust2rpm 26
%bcond_without check
# prevent library files from being installed
%global cargo_install_lib 0
Name: totpm
Version: 0.1.1
Release: 1%{?dist}
Summary: A TPM-backed command line TOTP client. Like Google Authenticator in your terminal.
SourceLicense: MIT
License: MIT
URL: https://github.com/koditoriet/totpm
Source0: totpm-%{version}.tar.gz
Source1: totpm.sysusers
BuildRequires: swtpm
BuildRequires: cargo-rpm-macros >= 26
BuildRequires: systemd-rpm-macros
%{?sysusers_requires_compat}
%global _description %{expand:
%{summary}.}
%description %{_description}
%prep
%autosetup -n totpm-%{version} -p1
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies
%install
%cargo_install
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/totpm.conf
install -p -D -m 0644 totpm.conf %{buildroot}/etc/totpm.conf
mkdir -p %{buildroot}/var/lib/totpm
%pre
%sysusers_create_compat %{SOURCE1}
%if %{with check}
%check
%cargo_test
%endif
%files
%attr(0644, root, root) %{_sysusersdir}/totpm.conf
%config %attr(0644, root, root) /etc/totpm.conf
%attr(0644, root, root) %license LICENSE
%attr(0644, root, root) %license LICENSE.dependencies
%attr(4755, totpm, totpm) %{_bindir}/totpm
%dir %attr(0700, totpm, totpm) /var/lib/totpm
%changelog
%autochangelog