2 # - update paths in manuals (create .in files and send upstream)
3 # - make /etc/pam.d independant of sysconfdir (configure-able option and send upstream)
6 %bcond_without inotify # without inotify support
7 %if "%{pld_release}" == "ac"
8 %bcond_with selinux # without SELinux support
9 %bcond_with audit # without audit support
11 %bcond_without selinux # without SELinux support
12 %bcond_without audit # without audit support
15 Summary: Cron daemon for executing programs at set times
19 License: MIT and BSD and GPLv2
21 Source0: %{name}-%{version}.tar.gz
22 # Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd
24 Source2: cron.logrotate
25 Source3: cron.sysconfig
26 Source4: %{name}.crontab
28 Patch0: inotify-nosys.patch
29 URL: https://fedorahosted.org/cronie/
30 %{?with_audit:BuildRequires: audit-libs-devel}
31 BuildRequires: autoconf
32 BuildRequires: automake
33 %{?with_selinux:BuildRequires: libselinux-devel}
34 BuildRequires: pam-devel
35 BuildRequires: rpm >= 4.4.9-56
36 BuildRequires: rpmbuild(macros) >= 1.268
37 Requires(post): fileutils
38 Requires(post,preun): /sbin/chkconfig
39 Requires(post,preun): rc-scripts
40 Requires(postun): /usr/sbin/groupdel
41 Requires(pre): /usr/bin/getgid
42 Requires(pre): /usr/sbin/groupadd
43 Requires: /bin/run-parts
44 Requires: /sbin/chkconfig
45 Requires: psmisc >= 20.1
47 %{?with_inotify:Requires: uname(release) >= 2.6.13}
49 Provides: crontabs = 1.7
50 Provides: group(crontab)
51 %if "%{pld_release}" == "th"
52 Provides: vixie-cron = 4:4.4
56 %if "%{pld_release}" == "th"
57 Obsoletes: vixie-cron <= 4:4.3
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 Cronie contains the standard UNIX daemon crond that runs specified
63 programs at scheduled times and related tools. It is based on the
64 original cron and has security and configuration enhancements like the
65 ability to use pam and SELinux.
68 Summary: Utility for running regular jobs
70 Provides: anacron = 2.4
71 Obsoletes: anacron <= 2.3
74 Anacron becames part of cronie. Anacron is used only for running
75 regular jobs. The default settings execute regular jobs by anacron,
76 however this could be overloaded in settings.
88 SYSCRONTAB=/etc/cron.d/crontab \
89 SYS_CROND_DIR=/etc/cron.d \
90 --sysconfdir=/etc/cron \
92 --with%{!?with_selinux:out}-selinux \
93 --with%{!?with_audit:out}-audit \
94 --with%{!?with_inotify:out}-inotify \
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT{/var/{log,spool/{ana,}cron},%{_mandir}} \
102 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
103 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
107 DESTDIR=$RPM_BUILD_ROOT
109 install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
110 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
111 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
112 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
113 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
114 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond
116 for a in fi fr id ja ko pl; do
117 if test -f $a/man1/crontab.1; then
118 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
119 install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
121 if test -f $a/man5/crontab.5; then
122 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
123 install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
125 if test -f $a/man8/cron.8; then
126 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
127 install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
131 touch $RPM_BUILD_ROOT/var/log/cron
133 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF'
134 # cron.allow This file describes the names of the users which are
135 # allowed to use the local cron daemon
139 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF'
140 # cron.deny This file describes the names of the users which are
141 # NOT allowed to use the local cron daemon
145 rm -rf $RPM_BUILD_ROOT
148 %groupadd -g 117 -r -f crontab
151 /sbin/chkconfig --add crond
154 chgrp crontab /var/log/cron
155 chmod 660 /var/log/cron
156 %service crond restart "Cron Daemon"
159 if [ "$1" = "0" ]; then
161 /sbin/chkconfig --del crond
165 if [ "$1" = "0" ]; then
169 %triggerpostun -- hc-cron
170 # reinstall crond init.d links, which could be different
171 /sbin/chkconfig --del crond
172 /sbin/chkconfig --add crond
174 %triggerun -- vixie-cron
175 # Prevent preun from crond from working
176 chmod a-x /etc/rc.d/init.d/crond
178 %triggerpostun -- vixie-cron
179 # Restore what triggerun removed
180 chmod 754 /etc/rc.d/init.d/crond
181 /sbin/chkconfig --add crond
184 %defattr(644,root,root,755)
185 %doc AUTHORS ChangeLog README
186 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
187 %attr(640,root,crontab) %config(noreplace,missingok) /etc/cron.d/crontab
188 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
189 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
190 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
191 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/crond
192 %attr(754,root,root) /etc/rc.d/init.d/crond
193 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/cron
194 %attr(755,root,root) %{_sbindir}/crond
195 %attr(2755,root,crontab) %{_bindir}/crontab
197 %{_mandir}/man8/crond.8*
198 %{_mandir}/man8/cron.8*
199 %{_mandir}/man5/crontab.5*
200 %{_mandir}/man1/crontab.1*
202 %attr(1730,root,crontab) /var/spool/cron
203 %attr(660,root,crontab) %ghost /var/log/cron
206 %defattr(644,root,root,755)
207 %attr(755,root,root) %{_sbindir}/anacron
208 %attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron
209 %{_mandir}/man5/anacrontab.5*
210 %{_mandir}/man8/anacron.8*
212 %attr(1730,root,crontab) /var/spool/anacron