3 %bcond_without selinux # without SELinux support
5 Summary: Cron daemon for executing programs at set times
9 License: MIT and BSD and GPLv2
11 Source0: https://fedorahosted.org/cronie/attachment/wiki/WikiStart/%{name}-%{version}.tar.gz?format=raw
12 # Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd
14 Source2: cron.logrotate
15 Source3: cron.sysconfig
16 Source4: %{name}.crontab
18 URL: https://fedorahosted.org/cronie/
19 BuildRequires: audit-libs-devel
20 %{?with_selinux:BuildRequires: libselinux-devel}
21 BuildRequires: pam-devel
22 BuildRequires: rpmbuild(macros) >= 1.268
23 Requires(post): fileutils
24 Requires(post,preun): /sbin/chkconfig
25 Requires(post,preun): rc-scripts
26 Requires(postun): /usr/sbin/groupdel
27 Requires(pre): /usr/bin/getgid
28 Requires(pre): /usr/sbin/groupadd
29 Requires: /bin/run-parts
30 Requires: /sbin/chkconfig
31 Requires: psmisc >= 20.1
34 Provides: crontabs = 1.7
35 Provides: group(crontab)
36 Provides: vixie-cron = 4:4.4
39 Obsoletes: vixie-cron <= 4:4.3
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 Cronie contains the standard UNIX daemon crond that runs specified
44 programs at scheduled times and related tools. It is based on the
45 original cron and has security and configuration enhancements like the
46 ability to use pam and SELinux.
49 Summary: Utility for running regular jobs
51 Provides: anacron = 2.4
52 Obsoletes: anacron <= 2.3
55 Anacron becames part of cronie. Anacron is used only for running
56 regular jobs. The default settings execute regular jobs by anacron,
57 however this could be overloaded in settings.
64 SYSCRONTAB=/etc/cron.d/crontab \
65 SYS_CROND_DIR=/etc/cron.d \
66 --sysconfdir=/etc/cron.d \
68 --with%{?!with_selinux:out}-selinux \
76 rm -rf $RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
78 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
79 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
82 DESTDIR=$RPM_BUILD_ROOT
84 install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
86 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
87 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
88 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
89 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
90 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond
92 for a in fi fr id ja ko pl; do
93 if test -f $a/man1/crontab.1; then
94 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
95 install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
97 if test -f $a/man5/crontab.5; then
98 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
99 install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
101 if test -f $a/man8/cron.8; then
102 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
103 install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
107 touch $RPM_BUILD_ROOT/var/log/cron
109 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF'
110 # cron.allow This file describes the names of the users which are
111 # allowed to use the local cron daemon
115 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF'
116 # cron.deny This file describes the names of the users which are
117 # NOT allowed to use the local cron daemon
121 rm -rf $RPM_BUILD_ROOT
124 %groupadd -g 117 -r -f crontab
127 /sbin/chkconfig --add crond
130 chgrp crontab /var/log/cron
131 chmod 660 /var/log/cron
132 %service crond restart "Cron Daemon"
135 if [ "$1" = "0" ]; then
137 /sbin/chkconfig --del crond
141 if [ "$1" = "0" ]; then
145 %triggerpostun -- hc-cron
146 # reinstall crond init.d links, which could be different
147 /sbin/chkconfig --del crond
148 /sbin/chkconfig --add crond
151 %defattr(644,root,root,755)
152 %doc AUTHORS ChangeLog README
153 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
154 %attr(640,root,crontab) %config(noreplace,missingok) /etc/cron.d/crontab
155 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
156 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
157 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
158 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/crond
159 %attr(754,root,root) /etc/rc.d/init.d/crond
160 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/cron
161 %attr(755,root,root) %{_sbindir}/crond
162 %attr(2755,root,crontab) %{_bindir}/crontab
164 %{_mandir}/man8/crond.8*
165 %{_mandir}/man8/cron.8*
166 %{_mandir}/man5/crontab.5*
167 %{_mandir}/man1/crontab.1*
169 %attr(1730,root,crontab) /var/spool/cron
170 %attr(660,root,crontab) %ghost /var/log/cron
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{_sbindir}/anacron
175 %attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron
176 %{_mandir}/man5/anacrontab.5*
177 %{_mandir}/man8/anacron.8*