2 # - added support for selinux
4 Summary: A periodical command scheduler which aims at replacing Vixie Cron
5 Summary(pl): Serwer okresowego uruchamiania poleceñ zastepuj±cy Vixie Crona
11 Source0: http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
12 # Source0-md5: 73042f2666dff27444789d542bbcd607
14 Source2: cron.logrotate
15 Source3: cron.sysconfig
16 Source4: %{name}.crontab
20 URL: http://fcron.free.fr/
21 #BuildRequires: libselinux-devel
22 BuildRequires: pam-devel
23 BuildRequires: rpmbuild(macros) >= 1.159
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /usr/sbin/groupadd
27 Requires(post,preun): /sbin/chkconfig
28 Requires(post): fileutils
29 Requires(postun): /usr/sbin/groupdel
30 Requires: /bin/run-parts
31 Requires: psmisc >= 20.1
32 Provides: crontabs >= 1.7
34 Provides: group(crontab)
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 Fcron is a periodical command scheduler which aims at replacing Vixie
44 Cron, so it implements most of its functionalities. But fcron does not
45 assume that your system is running neither all the time nor regularly:
46 you can, for instance, tell fcron to execute tasks every x hours y
47 minutes of system up time or to do a job only once in a specified
48 interval of time. You can also set a nice value to a job, run it
49 depending on the system load average and much more !
52 Fcron jest serwerem okresowego uruchamiania poleceñ maj±cym za cel
53 zast±pienie Vixie Crona, posiadaj±cym zaimplementowane wiêkszo¶æ
54 spo¶ród jego funkcji. Jednak¿e fcron nie zak³ada, ¿e system dzia³a
55 ca³y czas, ani ¿e jest uruchamiany regularnie: mo¿na, na przyk³ad,
56 kazaæ fcronowi uruchamiaæ zadanie co ka¿de x godzin y minut od
57 uruchomienia systemu lub wykonywaæ zadanie dok³adnie raz w podanym
58 okresie czasu. Umo¿liwia równie¿ ustawianie warto¶ci nice dla zadania,
59 uruchamianie go w zale¿no¶ci od obci±¿enia systemu i du¿o wiêcej.
66 --with-spooldir=%{_var}/spool/cron \
67 --with-run-non-privileged=no \
68 --with-boot-install=no \
70 --with-username=crontab \
71 --with-groupname=crontab \
74 --with-boot-install=no
78 echo "#!/bin/sh" > script/user-group
81 rm -rf $RPM_BUILD_ROOT
82 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
83 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
84 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
87 DESTDIR=$RPM_BUILD_ROOT \
88 DESTSBIN=$RPM_BUILD_ROOT%{_sbindir} \
89 DESTBIN=$RPM_BUILD_ROOT%{_bindir} \
90 DESTMAN=$RPM_BUILD_ROOT%{_mandir} \
96 #fix premission for rpmbuild
97 chmod +rw $RPM_BUILD_ROOT/usr/*bin/*
99 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
100 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
102 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
103 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
104 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
105 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
106 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
107 install %{SOURCE6} $RPM_BUILD_ROOT/etc/fcron.conf
108 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
110 #for a in fi fr id ja ko pl ; do
111 # if test -f $a/man1/crontab.1 ; then
112 # install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
113 # install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
115 # if test -f $a/man5/crontab.5 ; then
116 # install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
117 # install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
119 # if test -f $a/man8/cron.8 ; then
120 # install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
121 # install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
122 # echo .so cron.8 > $RPM_BUILD_ROOT%{_mandir}/$a/man8/crond.8
126 touch $RPM_BUILD_ROOT/var/log/cron
128 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
129 # cron.allow This file describes the names of the users which are
130 # allowed to use the local cron daemon
134 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
135 # cron.deny This file describes the names of the users which are
136 # NOT allowed to use the local cron daemon
140 rm -rf $RPM_BUILD_ROOT
143 if [ -n "`/usr/bin/getgid crontab`" ]; then
144 if [ "`/usr/bin/getgid crontab`" != "117" ]; then
145 echo "Error: group crontab doesn't have gid=117. Correct this before installing cron." 1>&2
149 echo "Adding group crontab GID=117."
150 /usr/sbin/groupadd -g 117 -r -f crontab
153 if [ -n "`/bin/id -u crontab 2>/dev/null`" ]; then
154 if [ "`/bin/id -u crontab`" != "134" ]; then
155 echo "Error: user crontab doesn't have uid=134. Correct this before installing %{name}." 1>&2
159 /usr/sbin/useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab 1>&2
163 if [ "$1" = "1" ]; then
164 if [ -d /var/spool/cron ]; then
165 for FILE in /var/spool/cron/*; do
166 mv -f $FILE $FILE.orig
167 USER=`basename $FILE`
168 chown crontab:crontab $FILE.orig
170 (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
172 if [ -f /var/spool/cron/root.orig ]; then
173 chmod 600 /var/spool/cron/root.orig
174 chown root:root /var/spool/cron/root.orig
179 if [ "$1" = "2" ]; then
180 FILE=`find /var/spool/cron -name \*.orig`
181 for FILE in $FILE; do
182 BASENAME=`basename $FILE`
183 USER=`echo "$BASENAME"| sed 's/.orig//'`
184 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
188 /sbin/chkconfig --add crond
189 if [ -f /var/lock/subsys/crond ]; then
190 /etc/rc.d/init.d/crond restart >&2
192 echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
197 chgrp crontab /var/log/cron
198 chmod 660 /var/log/cron
201 if [ "$1" = "0" ]; then
202 if [ -f /var/lock/subsys/crond ]; then
203 /etc/rc.d/init.d/crond stop >&2
205 /sbin/chkconfig --del crond
207 rm -f /var/spool/cron/systab*
209 FILE=`find /var/spool/cron -name \*.orig`
210 for FILE in $FILE; do
211 BASENAME=`basename $FILE`
212 USER="`echo "$BASENAME"| sed 's/.orig//'`"
213 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
214 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
215 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
217 rm -rf /var/spool/cron/rm.*
218 rm -rf /var/spool/cron/fcrontab.sig
222 if [ "$1" = "0" ]; then
227 %triggerpostun -- vixie-cron <= 3.0.1-85
228 for i in `/bin/ls /var/spool/cron 2>/dev/null`
230 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
232 /bin/chmod 660 /var/log/cron
233 /bin/chgrp crontab /var/log/cron
234 /bin/chmod 640 /etc/cron/cron.*
235 /bin/chgrp crontab /etc/cron/cron.*
237 %triggerpostun -- vixie-cron <= 3.0.1-73
238 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
239 mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
241 if [ -f /etc/cron.d/cron.allow ]; then
242 mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
244 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
245 mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
247 if [ -f /etc/cron.d/cron.deny ]; then
248 mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
251 %triggerpostun -- vixie-cron <= 3.0.1-70
252 if [ -f /etc/cron.allow ]; then
253 mv -f /etc/cron.allow /etc/cron/cron.allow
255 if [ -f /etc/cron.deny ]; then
256 mv -f /etc/cron.deny /etc/cron/cron.deny
259 %triggerpostun -- hc-cron
260 /sbin/chkconfig --del crond
261 /sbin/chkconfig --add crond
263 %triggerpostun -- hc-cron <= 0.14-12
264 for i in `/bin/ls /var/spool/cron 2>/dev/null`
266 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
268 /bin/chmod 660 /var/log/cron
269 /bin/chgrp crontab /var/log/cron
270 /bin/chmod 640 /etc/cron/cron.*
271 /bin/chgrp crontab /etc/cron/cron.*
274 %defattr(644,root,root,755)
275 %doc doc/HTML doc/olddoc/{FAQ,CHANGES,README,THANKS,TODO}
276 %attr(0750,root,crontab) %dir %{_sysconfdir}/cron*
277 %attr(0644,root,crontab) %config(noreplace) /etc/cron.d/crontab
278 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
279 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
280 %attr(0640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
281 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcron
282 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcrontab
283 %attr(0754,root,root) /etc/rc.d/init.d/crond
284 %config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) /etc/logrotate.d/cron
285 %attr(0640,root,crontab) %config(noreplace) /etc/fcron.conf
286 %attr(0755,root,root) %{_sbindir}/crond
287 %attr(6111,crontab,crontab) %{_bindir}/fcrontab
288 %attr(6111,crontab,crontab) %{_bindir}/crontab
289 %attr(4711,root,root) %{_bindir}/fcronsighup
290 %attr(6111,crontab,crontab) %{_bindir}/fcrondyn
293 #%%lang(fi) %{_mandir}/fi/man*/*
294 #%%lang(fr) %{_mandir}/fr/man*/*
295 #%%lang(id) %{_mandir}/id/man*/*
296 #%%lang(ja) %{_mandir}/ja/man*/*
297 #%%lang(ko) %{_mandir}/ko/man*/*
298 #%%lang(pl) %{_mandir}/pl/man*/*
300 %attr(1730,root,crontab) /var/spool/cron
301 %attr(0660,root,crontab) %ghost /var/log/cron