2 # - check -mail_output_only_if_there_is_output.patch. I'm not sure we need it in >= 3.0.4 version
3 Summary: A periodical command scheduler which aims at replacing Vixie Cron
4 Summary(pl.UTF-8): Serwer okresowego uruchamiania poleceń zastępujący Vixie Crona
10 Source0: http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
11 # Source0-md5: 5a26a1dfd91fdc7e87401e98aef870e6
13 Source2: cron.logrotate
14 Source3: cron.sysconfig
15 Source4: %{name}.crontab
18 Source7: %{name}tab.pam
19 Source8: %{name}.systab
20 Patch0: %{name}-configure.patch
21 Patch1: %{name}-Makefile.patch
22 URL: http://fcron.free.fr/
23 # configure tests -x (check can be removed, just like sendmail)
24 BuildRequires: /bin/vi
25 BuildRequires: autoconf
26 BuildRequires: automake
27 BuildRequires: libselinux-devel
28 BuildRequires: pam-devel
29 BuildRequires: rpmbuild(macros) >= 1.268
30 Requires(post): fileutils
31 Requires(post,preun): /sbin/chkconfig
32 Requires(postun): /usr/sbin/groupdel
33 Requires(pre): /bin/id
34 Requires(pre): /usr/bin/getgid
35 Requires(pre): /usr/sbin/groupadd
36 Requires(pre): /usr/sbin/useradd
37 Requires: /bin/run-parts
38 Requires: psmisc >= 20.1
41 Provides: crontabs = 1.7
42 Provides: group(crontab)
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 Fcron is a periodical command scheduler which aims at replacing Vixie
49 Cron, so it implements most of its functionalities. But fcron does not
50 assume that your system is running neither all the time nor regularly:
51 you can, for instance, tell fcron to execute tasks every x hours y
52 minutes of system up time or to do a job only once in a specified
53 interval of time. You can also set a nice value to a job, run it
54 depending on the system load average and much more !
56 %description -l pl.UTF-8
57 Fcron jest serwerem okresowego uruchamiania poleceń mającym za cel
58 zastąpienie Vixie Crona, posiadającym zaimplementowane większość
59 spośród jego funkcji. Jednakże fcron nie zakłada, że system działa
60 cały czas, ani że jest uruchamiany regularnie: można, na przykład,
61 kazać fcronowi uruchamiać zadanie co każde x godzin y minut od
62 uruchomienia systemu lub wykonywać zadanie dokładnie raz w podanym
63 okresie czasu. Umożliwia również ustawianie wartości nice dla zadania,
64 uruchamianie go w zależności od obciążenia systemu i dużo więcej.
75 --with-sendmail=/usr/sbin/sendmail \
76 --with-sysfcrontab=systab \
77 --with-spooldir=%{_var}/spool/cron \
78 --with-run-non-privileged=no \
79 --with-boot-install=no \
81 --with-username=crontab \
82 --with-groupname=crontab \
85 --with-boot-install=no \
91 echo "#!/bin/sh" > script/user-group
94 rm -rf $RPM_BUILD_ROOT
95 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
96 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
97 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
99 %{__make} install-staged \
100 DESTDIR=$RPM_BUILD_ROOT \
106 #fix premission for rpmbuild
107 chmod +rw $RPM_BUILD_ROOT%{_prefix}/*bin/*
109 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
110 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
112 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
113 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
114 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
115 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
116 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
117 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/fcron.conf
118 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
119 install %{SOURCE8} $RPM_BUILD_ROOT/etc/cron.hourly/fcron.systab
121 touch $RPM_BUILD_ROOT/var/log/cron
123 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF'
124 # cron.allow This file describes the names of the users which are
125 # allowed to use the local cron daemon
129 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF'
130 # cron.deny This file describes the names of the users which are
131 # NOT allowed to use the local cron daemon
135 rm -rf $RPM_BUILD_ROOT
138 %groupadd -g 117 -r -f crontab
139 %useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab
142 if [ "$1" = "1" ]; then
143 if [ -d /var/spool/cron ]; then
144 FIND=`find /var/spool/cron -type f`
145 for FILE in $FIND; do
146 mv -f $FILE $FILE.orig
147 USER=`basename $FILE`
148 chown crontab:crontab $FILE.orig
150 (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
152 if [ -f /var/spool/cron/root.orig ]; then
153 chmod 600 /var/spool/cron/root.orig
154 chown root:root /var/spool/cron/root.orig
159 if [ "$1" = "2" ]; then
160 FIND=`find /var/spool/cron -name \*.orig`
161 for FILE in $FIND; do
162 BASENAME=`basename $FILE`
163 USER=`echo "$BASENAME"| sed 's/.orig//'`
164 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
168 /sbin/chkconfig --add crond
169 %service crond restart "Cron Daemon"
173 chgrp crontab /var/log/cron
174 chmod 660 /var/log/cron
177 if [ "$1" = "0" ]; then
179 /sbin/chkconfig --del crond
181 rm -f /var/spool/cron/systab*
183 FIND=`find /var/spool/cron -name '*.orig'`
184 for FILE in $FIND; do
185 BASENAME=`basename $FILE`
186 USER="${BASENAME%.orig}"
187 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
188 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
189 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
191 rm -f /var/spool/cron/rm.*
192 rm -f /var/spool/cron/fcrontab.sig
193 rm -f /var/spool/cron/new.*
197 if [ "$1" = "0" ]; then
202 %triggerpostun -- hc-cron
203 # reinstall crond init.d links, which could be different
204 /sbin/chkconfig --del crond
205 /sbin/chkconfig --add crond
208 %defattr(644,root,root,755)
209 %doc doc/en/HTML doc/en/txt/{faq.txt,changes.txt,readme.txt,thanks.txt,todo.txt}
210 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
211 %attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name}.systab
212 %attr(640,root,crontab) %config(noreplace) /etc/cron.d/crontab
213 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
214 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
215 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
216 %attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcron
217 %attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcrontab
218 %attr(754,root,root) /etc/rc.d/init.d/crond
219 %config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) /etc/logrotate.d/cron
220 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fcron.*
221 %attr(640,root,crontab) %config(noreplace) %{_sysconfdir}/fcron.conf
222 %attr(755,root,root) %{_sbindir}/crond
223 %attr(6111,crontab,crontab) %{_bindir}/fcrontab
224 %attr(6111,crontab,crontab) %{_bindir}/crontab
225 %attr(4711,root,root) %{_bindir}/fcronsighup
226 %attr(6111,crontab,crontab) %{_bindir}/fcrondyn
227 %{_mandir}/man1/fcrondyn.1*
228 %{_mandir}/man1/fcrontab.1*
229 %{_mandir}/man3/bitstring.3*
230 %{_mandir}/man5/fcron.conf.5*
231 %{_mandir}/man5/fcrontab.5*
232 %{_mandir}/man8/fcron.8*
233 %lang(fr) %{_mandir}/fr/man1/fcrondyn.1*
234 %lang(fr) %{_mandir}/fr/man1/fcrontab.1*
235 %lang(fr) %{_mandir}/fr/man3/bitstring.3*
236 %lang(fr) %{_mandir}/fr/man5/fcron.conf.5*
237 %lang(fr) %{_mandir}/fr/man5/fcrontab.5*
238 %lang(fr) %{_mandir}/fr/man8/fcron.8*
239 %attr(1730,root,crontab) /var/spool/cron
240 %attr(660,root,crontab) %ghost /var/log/cron