3 %bcond_without selinux # without SELinux support
4 %bcond_without inotify # without inotify support
5 %bcond_without audit # without audit support
7 Summary: Cron daemon for executing programs at set times
11 License: MIT and BSD and GPLv2
13 Source0: %{name}-%{version}.tar.gz
14 # Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd
16 Source2: cron.logrotate
17 Source3: cron.sysconfig
18 Source4: %{name}.crontab
20 Patch0: inotify-nosys.patch
21 URL: https://fedorahosted.org/cronie/
22 %{?with_audit:BuildRequires: audit-libs-devel}
23 BuildRequires: autoconf
24 BuildRequires: automake
25 %{?with_selinux:BuildRequires: libselinux-devel}
26 BuildRequires: pam-devel
27 BuildRequires: rpmbuild(macros) >= 1.268
28 Requires(post): fileutils
29 Requires(post,preun): /sbin/chkconfig
30 Requires(post,preun): rc-scripts
31 Requires(postun): /usr/sbin/groupdel
32 Requires(pre): /usr/bin/getgid
33 Requires(pre): /usr/sbin/groupadd
34 Requires: /bin/run-parts
35 Requires: /sbin/chkconfig
36 Requires: psmisc >= 20.1
38 %{?with_inotify:Requires: uname(release) >= 2.6.13}
40 Provides: crontabs = 1.7
41 Provides: group(crontab)
42 Provides: vixie-cron = 4:4.4
45 Obsoletes: vixie-cron <= 4:4.3
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 Cronie contains the standard UNIX daemon crond that runs specified
50 programs at scheduled times and related tools. It is based on the
51 original cron and has security and configuration enhancements like the
52 ability to use pam and SELinux.
55 Summary: Utility for running regular jobs
57 Provides: anacron = 2.4
58 Obsoletes: anacron <= 2.3
61 Anacron becames part of cronie. Anacron is used only for running
62 regular jobs. The default settings execute regular jobs by anacron,
63 however this could be overloaded in settings.
75 SYSCRONTAB=/etc/cron.d/crontab \
76 SYS_CROND_DIR=/etc/cron.d \
77 --sysconfdir=/etc/cron \
79 --with%{!?with_selinux:out}-selinux \
80 --with%{!?with_audit:out}-audit \
81 --with%{!?with_inotify:out}-inotify \
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT{/var/{log,spool/{ana,}cron},%{_mandir}} \
89 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
90 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
93 DESTDIR=$RPM_BUILD_ROOT
95 install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
96 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
97 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
98 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
99 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
100 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond
102 for a in fi fr id ja ko pl; do
103 if test -f $a/man1/crontab.1; then
104 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
105 install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
107 if test -f $a/man5/crontab.5; then
108 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
109 install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
111 if test -f $a/man8/cron.8; then
112 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
113 install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
117 touch $RPM_BUILD_ROOT/var/log/cron
119 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF'
120 # cron.allow This file describes the names of the users which are
121 # allowed to use the local cron daemon
125 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF'
126 # cron.deny This file describes the names of the users which are
127 # NOT allowed to use the local cron daemon
131 rm -rf $RPM_BUILD_ROOT
134 %groupadd -g 117 -r -f crontab
137 /sbin/chkconfig --add crond
140 chgrp crontab /var/log/cron
141 chmod 660 /var/log/cron
142 %service crond restart "Cron Daemon"
145 if [ "$1" = "0" ]; then
147 /sbin/chkconfig --del crond
151 if [ "$1" = "0" ]; then
155 %triggerpostun -- hc-cron
156 # reinstall crond init.d links, which could be different
157 /sbin/chkconfig --del crond
158 /sbin/chkconfig --add crond
160 %triggerun -- vixie-cron
161 # Prevent preun from crond from working
162 chmod a-x /etc/rc.d/init.d/crond
164 %triggerpostun -- vixie-cron
165 # Restore what triggerun removed
166 chmod 754 /etc/rc.d/init.d/crond
167 /sbin/chkconfig --add crond
170 %defattr(644,root,root,755)
171 %doc AUTHORS ChangeLog README
172 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
173 %attr(640,root,crontab) %config(noreplace,missingok) /etc/cron.d/crontab
174 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
175 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
176 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
177 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/crond
178 %attr(754,root,root) /etc/rc.d/init.d/crond
179 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/cron
180 %attr(755,root,root) %{_sbindir}/crond
181 %attr(2755,root,crontab) %{_bindir}/crontab
183 %{_mandir}/man8/crond.8*
184 %{_mandir}/man8/cron.8*
185 %{_mandir}/man5/crontab.5*
186 %{_mandir}/man1/crontab.1*
188 %attr(1730,root,crontab) /var/spool/cron
189 %attr(660,root,crontab) %ghost /var/log/cron
192 %defattr(644,root,root,755)
193 %attr(755,root,root) %{_sbindir}/anacron
194 %attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron
195 %{_mandir}/man5/anacrontab.5*
196 %{_mandir}/man8/anacron.8*
198 %attr(1730,root,crontab) /var/spool/anacron