1 Summary: A periodical command scheduler which aims at replacing Vixie Cron
2 Summary(pl): Serwer okresowego uruchamiania poleceñ zastêpuj±cy Vixie Crona
8 Source0: http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
9 # Source0-md5: bf39dcef6d0c452f167f5a31a1231e4e
11 Source2: cron.logrotate
12 Source3: cron.sysconfig
13 Source4: %{name}.crontab
17 Source8: %{name}.systab
18 URL: http://fcron.free.fr/
19 BuildRequires: libselinux-devel
20 BuildRequires: pam-devel
21 BuildRequires: rpmbuild(macros) >= 1.159
23 Requires(pre): /usr/bin/getgid
24 Requires(pre): /usr/sbin/groupadd
25 Requires(post,preun): /sbin/chkconfig
26 Requires(post): fileutils
27 Requires(postun): /usr/sbin/groupdel
28 Requires: /bin/run-parts
29 Requires: psmisc >= 20.1
30 Provides: crontabs >= 1.7
32 Provides: group(crontab)
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 Fcron is a periodical command scheduler which aims at replacing Vixie
41 Cron, so it implements most of its functionalities. But fcron does not
42 assume that your system is running neither all the time nor regularly:
43 you can, for instance, tell fcron to execute tasks every x hours y
44 minutes of system up time or to do a job only once in a specified
45 interval of time. You can also set a nice value to a job, run it
46 depending on the system load average and much more !
49 Fcron jest serwerem okresowego uruchamiania poleceñ maj±cym za cel
50 zast±pienie Vixie Crona, posiadaj±cym zaimplementowane wiêkszo¶æ
51 spo¶ród jego funkcji. Jednak¿e fcron nie zak³ada, ¿e system dzia³a
52 ca³y czas, ani ¿e jest uruchamiany regularnie: mo¿na, na przyk³ad,
53 kazaæ fcronowi uruchamiaæ zadanie co ka¿de x godzin y minut od
54 uruchomienia systemu lub wykonywaæ zadanie dok³adnie raz w podanym
55 okresie czasu. Umo¿liwia równie¿ ustawianie warto¶ci nice dla zadania,
56 uruchamianie go w zale¿no¶ci od obci±¿enia systemu i du¿o wiêcej.
63 --with-sysfcrontab=systab \
64 --with-spooldir=%{_var}/spool/cron \
65 --with-run-non-privileged=no \
66 --with-boot-install=no \
68 --with-username=crontab \
69 --with-groupname=crontab \
72 --with-boot-install=no
74 %{__make} OPTION="%{rpmcflags}"
76 echo "#!/bin/sh" > script/user-group
79 rm -rf $RPM_BUILD_ROOT
80 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
81 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
82 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
85 DESTDIR=$RPM_BUILD_ROOT \
86 DESTSBIN=$RPM_BUILD_ROOT%{_sbindir} \
87 DESTBIN=$RPM_BUILD_ROOT%{_bindir} \
88 DESTMAN=$RPM_BUILD_ROOT%{_mandir} \
94 #fix premission for rpmbuild
95 chmod +rw $RPM_BUILD_ROOT/usr/*bin/*
97 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
98 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
100 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
101 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
102 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
103 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
104 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
105 install %{SOURCE6} $RPM_BUILD_ROOT/etc/fcron.conf
106 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
107 install %{SOURCE8} $RPM_BUILD_ROOT/etc/cron.hourly/fcron.systab
109 touch $RPM_BUILD_ROOT/var/log/cron
111 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
112 # cron.allow This file describes the names of the users which are
113 # allowed to use the local cron daemon
117 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
118 # cron.deny This file describes the names of the users which are
119 # NOT allowed to use the local cron daemon
123 rm -rf $RPM_BUILD_ROOT
126 if [ -n "`/usr/bin/getgid crontab`" ]; then
127 if [ "`/usr/bin/getgid crontab`" != "117" ]; then
128 echo "Error: group crontab doesn't have gid=117. Correct this before installing cron." 1>&2
132 echo "Adding group crontab GID=117."
133 /usr/sbin/groupadd -g 117 -r -f crontab
136 if [ -n "`/bin/id -u crontab 2>/dev/null`" ]; then
137 if [ "`/bin/id -u crontab`" != "134" ]; then
138 echo "Error: user crontab doesn't have uid=134. Correct this before installing %{name}." 1>&2
142 /usr/sbin/useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab 1>&2
146 if [ "$1" = "1" ]; then
147 if [ -d /var/spool/cron ]; then
148 FIND=`find /var/spool/cron -type f`
149 for FILE in $FIND; do
150 mv -f $FILE $FILE.orig
151 USER=`basename $FILE`
152 chown crontab:crontab $FILE.orig
154 (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
156 if [ -f /var/spool/cron/root.orig ]; then
157 chmod 600 /var/spool/cron/root.orig
158 chown root:root /var/spool/cron/root.orig
163 if [ "$1" = "2" ]; then
164 FIND=`find /var/spool/cron -name \*.orig`
165 for FILE in $FIND; do
166 BASENAME=`basename $FILE`
167 USER=`echo "$BASENAME"| sed 's/.orig//'`
168 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
172 /sbin/chkconfig --add crond
173 if [ -f /var/lock/subsys/crond ]; then
174 /etc/rc.d/init.d/crond restart >&2
176 echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
181 chgrp crontab /var/log/cron
182 chmod 660 /var/log/cron
185 if [ "$1" = "0" ]; then
186 if [ -f /var/lock/subsys/crond ]; then
187 /etc/rc.d/init.d/crond stop >&2
189 /sbin/chkconfig --del crond
191 rm -f /var/spool/cron/systab*
193 FIND=`find /var/spool/cron -name \*.orig`
194 for FILE in $FIND; do
195 BASENAME=`basename $FILE`
196 USER="`echo "$BASENAME"| sed 's/.orig//'`"
197 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
198 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
199 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
201 rm -f /var/spool/cron/rm\.*
202 rm -f /var/spool/cron/fcrontab.sig
203 rm -f /var/spool/cron/new\.*
207 if [ "$1" = "0" ]; then
212 %triggerpostun -- vixie-cron <= 3.0.1-85
213 for i in `/bin/ls /var/spool/cron 2>/dev/null`
215 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
217 /bin/chmod 660 /var/log/cron
218 /bin/chgrp crontab /var/log/cron
219 /bin/chmod 640 /etc/cron/cron.*
220 /bin/chgrp crontab /etc/cron/cron.*
222 %triggerpostun -- vixie-cron <= 3.0.1-73
223 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
224 mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
226 if [ -f /etc/cron.d/cron.allow ]; then
227 mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
229 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
230 mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
232 if [ -f /etc/cron.d/cron.deny ]; then
233 mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
236 %triggerpostun -- vixie-cron <= 3.0.1-70
237 if [ -f /etc/cron.allow ]; then
238 mv -f /etc/cron.allow /etc/cron/cron.allow
240 if [ -f /etc/cron.deny ]; then
241 mv -f /etc/cron.deny /etc/cron/cron.deny
244 %triggerpostun -- hc-cron
245 /sbin/chkconfig --del crond
246 /sbin/chkconfig --add crond
248 %triggerpostun -- hc-cron <= 0.14-12
249 for i in `/bin/ls /var/spool/cron 2>/dev/null`
251 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
253 /bin/chmod 660 /var/log/cron
254 /bin/chgrp crontab /var/log/cron
255 /bin/chmod 640 /etc/cron/cron.*
256 /bin/chgrp crontab /etc/cron/cron.*
259 %defattr(644,root,root,755)
260 %doc doc/HTML doc/olddoc/{FAQ,CHANGES,README,THANKS,TODO}
261 %attr(0750,root,crontab) %dir %{_sysconfdir}/cron*
262 %attr(0750,root,root) %{_sysconfdir}/cron.hourly/%{name}.systab
263 %attr(0640,root,crontab) %config(noreplace) /etc/cron.d/crontab
264 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
265 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
266 %attr(0640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
267 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcron
268 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcrontab
269 %attr(0754,root,root) /etc/rc.d/init.d/crond
270 %config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) /etc/logrotate.d/cron
271 %attr(0640,root,crontab) %config(noreplace) /etc/fcron.conf
272 %attr(0755,root,root) %{_sbindir}/crond
273 %attr(6111,crontab,crontab) %{_bindir}/fcrontab
274 %attr(6111,crontab,crontab) %{_bindir}/crontab
275 %attr(4711,root,root) %{_bindir}/fcronsighup
276 %attr(6111,crontab,crontab) %{_bindir}/fcrondyn
277 %{_mandir}/man1/fcrondyn.1.*
278 %{_mandir}/man1/fcrontab.1.*
279 %{_mandir}/man5/fcron.conf.5*
280 %{_mandir}/man5/fcrontab.5*
281 %{_mandir}/man8/fcron.8*
282 %attr(1730,root,crontab) /var/spool/cron
283 %attr(0660,root,crontab) %ghost /var/log/cron