1 Summary: A periodical command scheduler which aims at replacing Vixie Cron
7 Source0: http://fcron.free.fr/%{name}-%{version}.src.tar.gz
8 # Source0-md5: 4bfcff1002a7231f374591511bacadb2
10 Source2: cron.logrotate
11 Source3: cron.sysconfig
12 Source4: %{name}.crontab
15 Requires(pre): /usr/bin/getgid
16 Requires(pre): /usr/sbin/groupadd
17 Requires(post,preun): /sbin/chkconfig
18 Requires(post): fileutils
19 Requires(postun): /usr/sbin/groupdel
20 Requires: /bin/run-parts
21 Requires: psmisc >= 20.1
22 Provides: crontabs >= 1.7
27 BuildRequires: pam-devel
28 BuildRequires: libselinux-devel
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Fcron is a periodical command scheduler which aims at replacing Vixie
33 Cron, so it implements most of its functionalities. But fcron does not
34 assume that your system is running neither all the time nor regularly
35 : you can, for instance, tell fcron to execute tasks every x hours y
36 minutes of system up time or to do a job only once in a specified
37 interval of time. You can also set a nice value to a job, run it
38 depending on the system load average and much more !
45 --with-spooldir=%{_var}/spool/cron \
46 --with-run-non-privileged=no \
47 --with-boot-install=no \
49 --with-username=crontab \
50 --with-groupname=crontab \
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
59 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
60 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
63 DESTDIR=$RPM_BUILD_ROOT \
64 DESTMAN=$RPM_BUILD_ROOT%{_mandir}
66 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
67 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
68 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
69 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
70 install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/cron
72 for a in fi fr id ja ko pl ; do
73 if test -f $a/man1/crontab.1 ; then
74 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
75 install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
77 if test -f $a/man5/crontab.5 ; then
78 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
79 install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
81 if test -f $a/man8/cron.8 ; then
82 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
83 install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
84 echo .so cron.8 > $RPM_BUILD_ROOT%{_mandir}/$a/man8/crond.8
88 touch $RPM_BUILD_ROOT/var/log/cron
90 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
91 # cron.allow This file describes the names of the users which are
92 # allowed to use the local cron daemon
96 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
97 # cron.deny This file describes the names of the users which are
98 # NOT allowed to use the local cron daemon
102 rm -rf $RPM_BUILD_ROOT
105 if [ -n "`/usr/bin/getgid crontab`" ]; then
106 if [ "`/usr/bin/getgid crontab`" != "117" ]; then
107 echo "Error: group crontab doesn't have gid=117. Correct this before installing cron." 1>&2
111 echo "Adding group crontab GID=117."
112 /usr/sbin/groupadd -g 117 -r -f crontab
116 /sbin/chkconfig --add crond
117 if [ -f /var/lock/subsys/crond ]; then
118 /etc/rc.d/init.d/crond restart >&2
120 echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
124 chgrp crontab /var/log/cron
125 chmod 660 /var/log/cron
128 if [ "$1" = "0" ]; then
129 if [ -f /var/lock/subsys/crond ]; then
130 /etc/rc.d/init.d/crond stop >&2
132 /sbin/chkconfig --del crond
136 if [ "$1" = "0" ]; then
137 echo "Removing group crontab."
138 /usr/sbin/groupdel crontab
141 %triggerpostun -- vixie-cron <= 3.0.1-85
142 for i in `/bin/ls /var/spool/cron 2>/dev/null`
144 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
146 /bin/chmod 660 /var/log/cron
147 /bin/chgrp crontab /var/log/cron
148 /bin/chmod 640 /etc/cron/cron.*
149 /bin/chgrp crontab /etc/cron/cron.*
151 %triggerpostun -- vixie-cron <= 3.0.1-73
152 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
153 mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
155 if [ -f /etc/cron.d/cron.allow ]; then
156 mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
158 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
159 mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
161 if [ -f /etc/cron.d/cron.deny ]; then
162 mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
165 %triggerpostun -- vixie-cron <= 3.0.1-70
166 if [ -f /etc/cron.allow ]; then
167 mv -f /etc/cron.allow /etc/cron/cron.allow
169 if [ -f /etc/cron.deny ]; then
170 mv -f /etc/cron.deny /etc/cron/cron.deny
173 %triggerpostun -- hc-cron
174 /sbin/chkconfig --del crond
175 /sbin/chkconfig --add crond
177 %triggerpostun -- hc-cron <= 0.14-12
178 for i in `/bin/ls /var/spool/cron 2>/dev/null`
180 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
182 /bin/chmod 660 /var/log/cron
183 /bin/chgrp crontab /var/log/cron
184 /bin/chmod 640 /etc/cron/cron.*
185 /bin/chgrp crontab /etc/cron/cron.*
188 %defattr(644,root,root,755)
189 %doc CHANGES CONVERSION FEATURES MAIL README THANKS
190 %attr(0750,root,crontab) %dir %{_sysconfdir}/cron*
191 %attr(0644,root,crontab) %config(noreplace) /etc/cron.d/crontab
192 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
193 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
194 %attr(0640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
195 %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/cron
196 %attr(0754,root,root) /etc/rc.d/init.d/crond
197 %config /etc/logrotate.d/cron
198 %attr(0755,root,root) %{_sbindir}/crond
199 %attr(2755,root,crontab) %{_bindir}/crontab
202 %lang(fi) %{_mandir}/fi/man*/*
203 %lang(fr) %{_mandir}/fr/man*/*
204 %lang(id) %{_mandir}/id/man*/*
205 %lang(ja) %{_mandir}/ja/man*/*
206 %lang(ko) %{_mandir}/ko/man*/*
207 %lang(pl) %{_mandir}/pl/man*/*
209 %attr(1730,root,crontab) /var/spool/cron
210 %attr(0660,root,crontab) %ghost /var/log/cron