3 %bcond_without inotify # without inotify support
4 %if "%{pld_release}" == "ac"
5 %bcond_with selinux # without SELinux support
6 %bcond_with audit # without audit support
8 %bcond_without selinux # without SELinux support
9 %bcond_without audit # without audit support
12 Summary: Cron daemon for executing programs at set times
16 License: MIT and BSD and GPLv2
18 Source0: %{name}-%{version}.tar.gz
19 # Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd
21 Source2: cron.logrotate
22 Source3: cron.sysconfig
23 Source4: %{name}.crontab
25 Patch0: inotify-nosys.patch
26 URL: https://fedorahosted.org/cronie/
27 %{?with_audit:BuildRequires: audit-libs-devel}
28 BuildRequires: autoconf
29 BuildRequires: automake
30 %{?with_selinux:BuildRequires: libselinux-devel}
31 BuildRequires: pam-devel
32 BuildRequires: rpm >= 4.4.9-56
33 BuildRequires: rpmbuild(macros) >= 1.268
34 Requires(post): fileutils
35 Requires(post,preun): /sbin/chkconfig
36 Requires(post,preun): rc-scripts
37 Requires(postun): /usr/sbin/groupdel
38 Requires(pre): /usr/bin/getgid
39 Requires(pre): /usr/sbin/groupadd
40 Requires: /bin/run-parts
41 Requires: /sbin/chkconfig
42 Requires: psmisc >= 20.1
44 %{?with_inotify:Requires: uname(release) >= 2.6.13}
46 Provides: crontabs = 1.7
47 Provides: group(crontab)
48 %if "%{pld_release}" == "th"
49 Provides: vixie-cron = 4:4.4
53 %if "%{pld_release}" == "th"
54 Obsoletes: vixie-cron <= 4:4.3
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 Cronie contains the standard UNIX daemon crond that runs specified
60 programs at scheduled times and related tools. It is based on the
61 original cron and has security and configuration enhancements like the
62 ability to use pam and SELinux.
65 Summary: Utility for running regular jobs
67 Provides: anacron = 2.4
68 Obsoletes: anacron <= 2.3
71 Anacron becames part of cronie. Anacron is used only for running
72 regular jobs. The default settings execute regular jobs by anacron,
73 however this could be overloaded in settings.
85 SYSCRONTAB=/etc/cron.d/crontab \
86 SYS_CROND_DIR=/etc/cron.d \
87 --sysconfdir=/etc/cron \
89 --with%{!?with_selinux:out}-selinux \
90 --with%{!?with_audit:out}-audit \
91 --with%{!?with_inotify:out}-inotify \
97 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT{/var/{log,spool/{ana,}cron},%{_mandir}} \
99 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
100 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
104 DESTDIR=$RPM_BUILD_ROOT
106 install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
107 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
108 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
109 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
110 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
111 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond
113 for a in fi fr id ja ko pl; do
114 if test -f $a/man1/crontab.1; then
115 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
116 install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
118 if test -f $a/man5/crontab.5; then
119 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
120 install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
122 if test -f $a/man8/cron.8; then
123 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
124 install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
128 touch $RPM_BUILD_ROOT/var/log/cron
130 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF'
131 # cron.allow This file describes the names of the users which are
132 # allowed to use the local cron daemon
136 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF'
137 # cron.deny This file describes the names of the users which are
138 # NOT allowed to use the local cron daemon
142 rm -rf $RPM_BUILD_ROOT
145 %groupadd -g 117 -r -f crontab
148 /sbin/chkconfig --add crond
151 chgrp crontab /var/log/cron
152 chmod 660 /var/log/cron
153 %service crond restart "Cron Daemon"
156 if [ "$1" = "0" ]; then
158 /sbin/chkconfig --del crond
162 if [ "$1" = "0" ]; then
166 %triggerpostun -- hc-cron
167 # reinstall crond init.d links, which could be different
168 /sbin/chkconfig --del crond
169 /sbin/chkconfig --add crond
171 %triggerun -- vixie-cron
172 # Prevent preun from crond from working
173 chmod a-x /etc/rc.d/init.d/crond
175 %triggerpostun -- vixie-cron
176 # Restore what triggerun removed
177 chmod 754 /etc/rc.d/init.d/crond
178 /sbin/chkconfig --add crond
181 %defattr(644,root,root,755)
182 %doc AUTHORS ChangeLog README
183 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
184 %attr(640,root,crontab) %config(noreplace,missingok) /etc/cron.d/crontab
185 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
186 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
187 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
188 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/crond
189 %attr(754,root,root) /etc/rc.d/init.d/crond
190 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/cron
191 %attr(755,root,root) %{_sbindir}/crond
192 %attr(2755,root,crontab) %{_bindir}/crontab
194 %{_mandir}/man8/crond.8*
195 %{_mandir}/man8/cron.8*
196 %{_mandir}/man5/crontab.5*
197 %{_mandir}/man1/crontab.1*
199 %attr(1730,root,crontab) /var/spool/cron
200 %attr(660,root,crontab) %ghost /var/log/cron
203 %defattr(644,root,root,755)
204 %attr(755,root,root) %{_sbindir}/anacron
205 %attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron
206 %{_mandir}/man5/anacrontab.5*
207 %{_mandir}/man8/anacron.8*
209 %attr(1730,root,crontab) /var/spool/anacron