3 %bcond_without selinux # without SELinux support
4 %bcond_without inotify # without inotify support
6 Summary: Cron daemon for executing programs at set times
10 License: MIT and BSD and GPLv2
12 Source0: %{name}-%{version}.tar.gz
13 # Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd
15 Source2: cron.logrotate
16 Source3: cron.sysconfig
17 Source4: %{name}.crontab
19 URL: https://fedorahosted.org/cronie/
20 BuildRequires: audit-libs-devel
21 %{?with_inotify:BuildRequires: glibc-devel >= 6:2.4}
22 %{?with_selinux:BuildRequires: libselinux-devel}
23 BuildRequires: pam-devel
24 BuildRequires: rpmbuild(macros) >= 1.268
25 Requires(post): fileutils
26 Requires(post,preun): /sbin/chkconfig
27 Requires(post,preun): rc-scripts
28 Requires(postun): /usr/sbin/groupdel
29 Requires(pre): /usr/bin/getgid
30 Requires(pre): /usr/sbin/groupadd
31 Requires: /bin/run-parts
32 Requires: /sbin/chkconfig
33 Requires: psmisc >= 20.1
36 Provides: crontabs = 1.7
37 Provides: group(crontab)
38 Provides: vixie-cron = 4:4.4
41 Obsoletes: vixie-cron <= 4:4.3
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 Cronie contains the standard UNIX daemon crond that runs specified
46 programs at scheduled times and related tools. It is based on the
47 original cron and has security and configuration enhancements like the
48 ability to use pam and SELinux.
51 Summary: Utility for running regular jobs
53 Provides: anacron = 2.4
54 Obsoletes: anacron <= 2.3
57 Anacron becames part of cronie. Anacron is used only for running
58 regular jobs. The default settings execute regular jobs by anacron,
59 however this could be overloaded in settings.
66 SYSCRONTAB=/etc/cron.d/crontab \
67 SYS_CROND_DIR=/etc/cron.d \
68 --sysconfdir=/etc/cron \
70 --with%{!?with_selinux:out}-selinux \
72 --with%{!?with_inotify:out}-inotify \
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{/var/{log,spool/{ana,}cron},%{_mandir}} \
80 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
81 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
84 DESTDIR=$RPM_BUILD_ROOT
86 install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
87 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
88 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
89 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
90 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
91 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond
93 for a in fi fr id ja ko pl; do
94 if test -f $a/man1/crontab.1; then
95 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
96 install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
98 if test -f $a/man5/crontab.5; then
99 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
100 install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
102 if test -f $a/man8/cron.8; then
103 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
104 install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
108 touch $RPM_BUILD_ROOT/var/log/cron
110 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF'
111 # cron.allow This file describes the names of the users which are
112 # allowed to use the local cron daemon
116 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF'
117 # cron.deny This file describes the names of the users which are
118 # NOT allowed to use the local cron daemon
122 rm -rf $RPM_BUILD_ROOT
125 %groupadd -g 117 -r -f crontab
128 /sbin/chkconfig --add crond
131 chgrp crontab /var/log/cron
132 chmod 660 /var/log/cron
133 %service crond restart "Cron Daemon"
136 if [ "$1" = "0" ]; then
138 /sbin/chkconfig --del crond
142 if [ "$1" = "0" ]; then
146 %triggerpostun -- hc-cron
147 # reinstall crond init.d links, which could be different
148 /sbin/chkconfig --del crond
149 /sbin/chkconfig --add crond
151 %triggerun -- vixie-cron
152 # Prevent preun from crond from working
153 chmod a-x /etc/rc.d/init.d/crond
155 %triggerpostun -- vixie-cron
156 # Restore what triggerun removed
157 chmod 754 /etc/rc.d/init.d/crond
158 /sbin/chkconfig --add crond
161 %defattr(644,root,root,755)
162 %doc AUTHORS ChangeLog README
163 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
164 %attr(640,root,crontab) %config(noreplace,missingok) /etc/cron.d/crontab
165 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
166 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
167 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
168 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/crond
169 %attr(754,root,root) /etc/rc.d/init.d/crond
170 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/cron
171 %attr(755,root,root) %{_sbindir}/crond
172 %attr(2755,root,crontab) %{_bindir}/crontab
174 %{_mandir}/man8/crond.8*
175 %{_mandir}/man8/cron.8*
176 %{_mandir}/man5/crontab.5*
177 %{_mandir}/man1/crontab.1*
179 %attr(1730,root,crontab) /var/spool/cron
180 %attr(660,root,crontab) %ghost /var/log/cron
183 %defattr(644,root,root,755)
184 %attr(755,root,root) %{_sbindir}/anacron
185 %attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron
186 %{_mandir}/man5/anacrontab.5*
187 %{_mandir}/man8/anacron.8*
189 %attr(1730,root,crontab) /var/spool/anacron