2 # - write missing files
3 Summary: A periodical command scheduler which aims at replacing Vixie Cron
4 Summary(pl): Serwer okresowego uruchamiania poleceñ zastepuj±cy Vixie Crona
10 Source0: http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
11 # Source0-md5: 73042f2666dff27444789d542bbcd607
13 Source2: cron.logrotate
14 Source3: cron.sysconfig
15 Source4: %{name}.crontab
19 URL: http://fcron.free.fr/
20 #BuildRequires: libselinux-devel
21 BuildRequires: pam-devel
22 BuildRequires: rpmbuild(macros) >= 1.159
24 Requires(pre): /usr/bin/getgid
25 Requires(pre): /usr/sbin/groupadd
26 Requires(post,preun): /sbin/chkconfig
27 Requires(post): fileutils
28 Requires(postun): /usr/sbin/groupdel
29 Requires: /bin/run-parts
30 Requires: psmisc >= 20.1
31 Provides: crontabs >= 1.7
33 Provides: group(crontab)
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 Fcron is a periodical command scheduler which aims at replacing Vixie
43 Cron, so it implements most of its functionalities. But fcron does not
44 assume that your system is running neither all the time nor regularly:
45 you can, for instance, tell fcron to execute tasks every x hours y
46 minutes of system up time or to do a job only once in a specified
47 interval of time. You can also set a nice value to a job, run it
48 depending on the system load average and much more !
51 Fcron jest serwerem okresowego uruchamiania poleceñ maj±cym za cel
52 zast±pienie Vixie Crona, posiadaj±cym zaimplementowane wiêkszo¶æ
53 spo¶ród jego funkcji. Jednak¿e fcron nie zak³ada, ¿e system dzia³a
54 ca³y czas, ani ¿e jest uruchamiany regularnie: mo¿na, na przyk³ad,
55 kazaæ fcronowi uruchamiaæ zadanie co ka¿de x godzin y minut od
56 uruchomienia systemu lub wykonywaæ zadanie dok³adnie raz w podanym
57 okresie czasu. Umo¿liwia równie¿ ustawianie warto¶ci nice dla zadania,
58 uruchamianie go w zale¿no¶ci od obci±¿enia systemu i du¿o wiêcej.
65 --with-spooldir=%{_var}/spool/cron \
66 --with-run-non-privileged=no \
67 --with-boot-install=no \
69 --with-username=root \
70 --with-groupname=crontab \
73 --with-boot-install=no
77 echo "#!/bin/sh" > script/user-group
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
82 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
83 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
86 DESTDIR=$RPM_BUILD_ROOT \
87 DESTSBIN=$RPM_BUILD_ROOT%{_sbindir} \
88 DESTBIN=$RPM_BUILD_ROOT%{_bindir} \
89 DESTMAN=$RPM_BUILD_ROOT%{_mandir} \
95 #ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
97 #fix premission for rpmbuild
98 chmod +rw $RPM_BUILD_ROOT/usr/*bin/*
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
108 #for a in fi fr id ja ko pl ; do
109 # if test -f $a/man1/crontab.1 ; then
110 # install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
111 # install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
113 # if test -f $a/man5/crontab.5 ; then
114 # install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
115 # install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
117 # if test -f $a/man8/cron.8 ; then
118 # install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
119 # install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
120 # echo .so cron.8 > $RPM_BUILD_ROOT%{_mandir}/$a/man8/crond.8
124 touch $RPM_BUILD_ROOT/var/log/cron
126 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
127 # cron.allow This file describes the names of the users which are
128 # allowed to use the local cron daemon
132 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
133 # cron.deny This file describes the names of the users which are
134 # NOT allowed to use the local cron daemon
138 rm -rf $RPM_BUILD_ROOT
141 if [ -n "`/usr/bin/getgid crontab`" ]; then
142 if [ "`/usr/bin/getgid crontab`" != "117" ]; then
143 echo "Error: group crontab doesn't have gid=117. Correct this before installing cron." 1>&2
147 echo "Adding group crontab GID=117."
148 /usr/sbin/groupadd -g 117 -r -f crontab
152 for FILE in /var/spool/cron/*; do
153 mv -f $FILE $FILE.orig
154 BASENAME=`basename $FILE`
155 FCRONTAB=`echo "$BASENAME"`
156 (test ! -z "$FCRONTAB" && fcrontab -u $FCRONTAB -z) > /dev/null 2>&1
159 /sbin/chkconfig --add crond
160 if [ -f /var/lock/subsys/crond ]; then
161 /etc/rc.d/init.d/crond restart >&2
163 echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
167 chgrp crontab /var/log/cron
168 chmod 660 /var/log/cron
171 if [ "$1" = "0" ]; then
172 if [ -f /var/lock/subsys/crond ]; then
173 /etc/rc.d/init.d/crond stop >&2
175 /sbin/chkconfig --del crond
178 for FILE in /var/spool/cron/*.orig; do
179 BASENAME=`basename $FILE`
180 mv -f $FILE /var/spool/cron/`echo "$BASENAME"| sed 's/.orig//'` >/dev/null 2>&1
184 if [ "$1" = "0" ]; then
188 %triggerpostun -- vixie-cron <= 3.0.1-85
189 for i in `/bin/ls /var/spool/cron 2>/dev/null`
191 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
193 /bin/chmod 660 /var/log/cron
194 /bin/chgrp crontab /var/log/cron
195 /bin/chmod 640 /etc/cron/cron.*
196 /bin/chgrp crontab /etc/cron/cron.*
198 %triggerpostun -- vixie-cron <= 3.0.1-73
199 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
200 mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
202 if [ -f /etc/cron.d/cron.allow ]; then
203 mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
205 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
206 mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
208 if [ -f /etc/cron.d/cron.deny ]; then
209 mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
212 %triggerpostun -- vixie-cron <= 3.0.1-70
213 if [ -f /etc/cron.allow ]; then
214 mv -f /etc/cron.allow /etc/cron/cron.allow
216 if [ -f /etc/cron.deny ]; then
217 mv -f /etc/cron.deny /etc/cron/cron.deny
220 %triggerpostun -- hc-cron
221 /sbin/chkconfig --del crond
222 /sbin/chkconfig --add crond
224 %triggerpostun -- hc-cron <= 0.14-12
225 for i in `/bin/ls /var/spool/cron 2>/dev/null`
227 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
229 /bin/chmod 660 /var/log/cron
230 /bin/chgrp crontab /var/log/cron
231 /bin/chmod 640 /etc/cron/cron.*
232 /bin/chgrp crontab /etc/cron/cron.*
235 %defattr(644,root,root,755)
236 #%%doc CHANGES CONVERSION FEATURES MAIL README THANKS
237 %attr(0750,root,crontab) %dir %{_sysconfdir}/cron*
238 %attr(0644,root,crontab) %config(noreplace) /etc/cron.d/crontab
239 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
240 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
241 %attr(0640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
242 %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcron
243 %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcrontab
244 %attr(0754,root,root) /etc/rc.d/init.d/crond
245 %config /etc/logrotate.d/cron
246 %attr(0640,root,root) %config(noreplace) /etc/fcron.conf
247 %attr(0755,root,root) %{_sbindir}/fcron
248 %attr(4755,root,crontab) %{_bindir}/fcrontab
249 %attr(0755,root,crontab) %{_bindir}/fcronsighup
250 %attr(0755,root,crontab) %{_bindir}/fcrondyn
253 #%%lang(fi) %{_mandir}/fi/man*/*
254 #%%lang(fr) %{_mandir}/fr/man*/*
255 #%%lang(id) %{_mandir}/id/man*/*
256 #%%lang(ja) %{_mandir}/ja/man*/*
257 #%%lang(ko) %{_mandir}/ko/man*/*
258 #%%lang(pl) %{_mandir}/pl/man*/*
260 %attr(1730,root,crontab) /var/spool/cron
261 %attr(0660,root,crontab) %ghost /var/log/cron