-
Notifications
You must be signed in to change notification settings - Fork 1
/
overcommit.spec
85 lines (60 loc) · 2.03 KB
/
overcommit.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Name: overcommit
Version: 0.2
Release: 1%{?dist}
Summary: Set memory overcommit policy
Group: System Environment/Base
License: GPLv3+
URL: https://github.com/jumanjiman/overcommit
Source0: %{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
Requires: apply-sysctl
%description
Apply kernel tunables at boot-time to set overcommit policy.
See README.policies for more information, including how
to override the defaults.
This package includes three policy configs:
* heuristic (same as kernel default)
* always
* never
%prep
%setup -q
%build
%install
%{__rm} -rf %{buildroot}
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/rc.d/init.d
%{__install} -pm 755 src/overcommit %{buildroot}/%{_sysconfdir}/rc.d/init.d
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/sysconfig
%{__install} -pm 644 src/configs/overcommit.sample %{buildroot}/%{_sysconfdir}/sysconfig
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/%{name}
%{__install} -pm 644 src/configs/never-overcommit.conf %{buildroot}/%{_sysconfdir}/%{name}
%{__install} -pm 644 src/configs/default-overcommit.conf %{buildroot}/%{_sysconfdir}/%{name}
%{__install} -pm 644 src/configs/always-overcommit.conf %{buildroot}/%{_sysconfdir}/%{name}
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc COPYING.GPLv3
%doc README.memory
%doc README.policies
%doc %{_sysconfdir}/sysconfig/overcommit.sample
%config %{_sysconfdir}/%{name}/default-overcommit.conf
%config %{_sysconfdir}/%{name}/always-overcommit.conf
%config %{_sysconfdir}/%{name}/never-overcommit.conf
%{_sysconfdir}/rc.d/init.d
%preun
if [ $1 -eq 0 ]; then
service overcommit stop || :
chkconfig --del overcommit || :
fi
%post
if [ $1 -gt 0 ]; then
chkconfig --add overcommit &> /dev/null || :
fi
%changelog
* Tue Feb 08 2011 Paul Morgan <[email protected]> 0.2-1
- cleaner output while starting
* Tue Feb 08 2011 Paul Morgan <[email protected]> 0.1-1
- new package built with tito
* Tue Feb 08 2011 Paul Morgan <[email protected]> 0.1-1
- new package built with tito