]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without selinux # without SELinux support | |
4 | # | |
5 | Summary: Cron daemon for executing programs at set times | |
6 | Name: cronie | |
7 | Version: 1.4.1 | |
8 | Release: 0.1 | |
9 | License: MIT and BSD and GPLv2 | |
10 | Group: Daemons | |
11 | Source0: https://fedorahosted.org/cronie/attachment/wiki/WikiStart/%{name}-%{version}.tar.gz?format=raw | |
12 | # Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd | |
13 | Source1: %{name}.init | |
14 | Source2: cron.logrotate | |
15 | Source3: cron.sysconfig | |
16 | Source4: %{name}.crontab | |
17 | Source5: %{name}.pam | |
18 | Patch0: %{name}-paths.patch | |
19 | URL: https://fedorahosted.org/cronie/ | |
20 | BuildRequires: audit-libs-devel | |
21 | %{?with_selinux:BuildRequires: libselinux-devel} | |
22 | BuildRequires: pam-devel | |
23 | BuildRequires: rpmbuild(macros) >= 1.268 | |
24 | Requires(post): fileutils | |
25 | Requires(post,preun): /sbin/chkconfig | |
26 | Requires(post,preun): rc-scripts | |
27 | Requires(postun): /usr/sbin/groupdel | |
28 | Requires(pre): /usr/bin/getgid | |
29 | Requires(pre): /usr/sbin/groupadd | |
30 | Requires: /bin/run-parts | |
31 | Requires: /sbin/chkconfig | |
32 | Requires: psmisc >= 20.1 | |
33 | Requires: rc-scripts | |
34 | Provides: crondaemon | |
35 | Provides: crontabs = 1.7 | |
36 | Provides: group(crontab) | |
37 | Provides: vixie-cron = 4:4.4 | |
38 | Obsoletes: crondaemon | |
39 | Obsoletes: crontabs | |
40 | Obsoletes: vixie-cron <= 4:4.3 | |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | Cronie contains the standard UNIX daemon crond that runs specified | |
45 | programs at scheduled times and related tools. It is based on the | |
46 | original cron and has security and configuration enhancements like the | |
47 | ability to use pam and SELinux. | |
48 | ||
49 | %package anacron | |
50 | Summary: Utility for running regular jobs | |
51 | Group: Base | |
52 | Provides: anacron = 2.4 | |
53 | Obsoletes: anacron <= 2.3 | |
54 | ||
55 | %description anacron | |
56 | Anacron becames part of cronie. Anacron is used only for running | |
57 | regular jobs. The default settings execute regular jobs by anacron, | |
58 | however this could be overloaded in settings. | |
59 | ||
60 | %prep | |
61 | %setup -q | |
62 | %patch0 -p1 | |
63 | ||
64 | %build | |
65 | %configure \ | |
66 | --with-pam \ | |
67 | --with%{?!with_selinux:out}-selinux \ | |
68 | --with-audit \ | |
69 | --with-inotify \ | |
70 | --enable-anacron | |
71 | ||
72 | %{__make} | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \ | |
77 | $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \ | |
78 | $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d} | |
79 | ||
80 | %{__make} install \ | |
81 | DESTDIR=$RPM_BUILD_ROOT | |
82 | ||
83 | install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron | |
84 | ||
85 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond | |
86 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron | |
87 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron | |
88 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab | |
89 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond | |
90 | ||
91 | for a in fi fr id ja ko pl; do | |
92 | if test -f $a/man1/crontab.1; then | |
93 | install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1 | |
94 | install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1 | |
95 | fi | |
96 | if test -f $a/man5/crontab.5; then | |
97 | install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5 | |
98 | install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5 | |
99 | fi | |
100 | if test -f $a/man8/cron.8; then | |
101 | install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8 | |
102 | install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8 | |
103 | fi | |
104 | done | |
105 | ||
106 | touch $RPM_BUILD_ROOT/var/log/cron | |
107 | ||
108 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF' | |
109 | # cron.allow This file describes the names of the users which are | |
110 | # allowed to use the local cron daemon | |
111 | root | |
112 | EOF | |
113 | ||
114 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF' | |
115 | # cron.deny This file describes the names of the users which are | |
116 | # NOT allowed to use the local cron daemon | |
117 | EOF | |
118 | ||
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %pre | |
123 | %groupadd -g 117 -r -f crontab | |
124 | ||
125 | %post | |
126 | /sbin/chkconfig --add crond | |
127 | umask 027 | |
128 | touch /var/log/cron | |
129 | chgrp crontab /var/log/cron | |
130 | chmod 660 /var/log/cron | |
131 | %service crond restart "Cron Daemon" | |
132 | ||
133 | %preun | |
134 | if [ "$1" = "0" ]; then | |
135 | %service crond stop | |
136 | /sbin/chkconfig --del crond | |
137 | fi | |
138 | ||
139 | %postun | |
140 | if [ "$1" = "0" ]; then | |
141 | %groupremove crontab | |
142 | fi | |
143 | ||
144 | %triggerpostun -- hc-cron | |
145 | # reinstall crond init.d links, which could be different | |
146 | /sbin/chkconfig --del crond | |
147 | /sbin/chkconfig --add crond | |
148 | ||
149 | %files | |
150 | %defattr(644,root,root,755) | |
151 | %doc AUTHORS ChangeLog README | |
152 | %attr(750,root,crontab) %dir %{_sysconfdir}/cron* | |
153 | %attr(640,root,crontab) %config(noreplace,missingok) /etc/cron.d/crontab | |
154 | %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow | |
155 | %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny | |
156 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron | |
157 | %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/crond | |
158 | %attr(754,root,root) /etc/rc.d/init.d/crond | |
159 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/cron | |
160 | %attr(755,root,root) %{_sbindir}/crond | |
161 | %attr(2755,root,crontab) %{_bindir}/crontab | |
162 | ||
163 | %{_mandir}/man8/crond.8* | |
164 | %{_mandir}/man8/cron.8* | |
165 | %{_mandir}/man5/crontab.5* | |
166 | %{_mandir}/man1/crontab.1* | |
167 | ||
168 | %attr(1730,root,crontab) /var/spool/cron | |
169 | %attr(660,root,crontab) %ghost /var/log/cron | |
170 | ||
171 | %files anacron | |
172 | %defattr(644,root,root,755) | |
173 | %attr(755,root,root) %{_sbindir}/anacron | |
174 | %attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron | |
175 | %{_mandir}/man5/anacrontab.5* | |
176 | %{_mandir}/man8/anacron.8* |