-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell-timeout.spec
More file actions
57 lines (45 loc) · 1.59 KB
/
shell-timeout.spec
File metadata and controls
57 lines (45 loc) · 1.59 KB
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
# test suite runs a bunch of podman, can't do that within the buildroot of koji or mock
%bcond tests 0
Name: shell-timeout
Version: 0.2.0
Release: %autorelease
BuildArch: noarch
License: GPL-3.0-or-later
Url: https://github.com/fermitools/shell-timeout
Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Requires: coreutils filesystem sed
%if %{with tests}
BuildRequires: make podman
%endif
Summary: A simple set of scripts for setting shell timeout automatically
%description
These scripts automatically set shell timeout values based on user ID (UID)
or group ID (GID) membership in POSIX shells (bash/zsh) and C shells (csh/tcsh).
When a matching user logs in, their shell will automatically terminate
after a configured period of inactivity.
%prep
%autosetup
%build
%install
# these must be in /etc/profile.d to actually work
install -p -m 644 -D src/shell-timeout.sh %{buildroot}%{_sysconfdir}/profile.d/shell-timeout.sh
install -p -m 644 -D src/shell-timeout.csh %{buildroot}%{_sysconfdir}/profile.d/shell-timeout.csh
# the scripts are hard coded to check
# /etc/default/shell-timeout
# /etc/default/shell-timeout.d
# variables here would be counter-productive as they don't change the code
install -p -m 644 -D conf/shell-timeout %{buildroot}/etc/default/shell-timeout
mkdir %{buildroot}/etc/default/shell-timeout.d
%check
%if %{with tests}
make test
%endif
%files
%license LICENSE
%doc README.md
%{_sysconfdir}/profile.d/shell-timeout.sh
%{_sysconfdir}/profile.d/shell-timeout.csh
%config(noreplace) /etc/default/shell-timeout
%dir /etc/default/shell-timeout.d
%changelog
%autochangelog