]> git.pld-linux.org Git - packages/fcron.git/blame - fcron.spec
- 3.0.3
[packages/fcron.git] / fcron.spec
CommitLineData
5f59e5da 1Summary: A periodical command scheduler which aims at replacing Vixie Cron
5e12e637 2Summary(pl.UTF-8): Serwer okresowego uruchamiania poleceń zastępujący Vixie Crona
5f59e5da 3Name: fcron
06c71740 4Version: 3.0.3
3712a1f5 5Release: 1
5f59e5da
AM
6License: GPL
7Group: Daemons
ef65b337 8Source0: http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
06c71740 9# Source0-md5: c85e6eecd0564f37658ae250a491fd31
5f59e5da
AM
10Source1: %{name}.init
11Source2: cron.logrotate
12Source3: cron.sysconfig
13Source4: %{name}.crontab
14Source5: %{name}.pam
a6d0b5fe 15Source6: %{name}.conf
542b0197 16Source7: %{name}tab.pam
a58c6059 17Source8: %{name}.systab
d15f88ee 18Patch0: %{name}-mail_output_only_if_there_is_output.patch
6e82b599 19Patch1: %{name}-configure.patch
06c71740 20Patch2: %{name}-Makefile.patch
4db6ff6c 21URL: http://fcron.free.fr/
2665b9b3
JB
22# configure tests -x (check can be removed, just like sendmail)
23BuildRequires: /bin/vi
6e82b599 24BuildRequires: autoconf
7703e5de 25BuildRequires: automake
c5e6f976 26BuildRequires: libselinux-devel
4db6ff6c 27BuildRequires: pam-devel
7703e5de 28BuildRequires: rpmbuild(macros) >= 1.268
542b0197
ER
29Requires(post): fileutils
30Requires(post,preun): /sbin/chkconfig
31Requires(postun): /usr/sbin/groupdel
23e300cd 32Requires(pre): /bin/id
542b0197 33Requires(pre): /usr/bin/getgid
5f59e5da 34Requires(pre): /usr/sbin/groupadd
23e300cd 35Requires(pre): /usr/sbin/useradd
5f59e5da
AM
36Requires: /bin/run-parts
37Requires: psmisc >= 20.1
7c49a617 38Requires: rc-scripts
5f59e5da 39Provides: crondaemon
7703e5de 40Provides: crontabs >= 1.7
1ea95bdf 41Provides: group(crontab)
5f59e5da 42Obsoletes: crontabs
5f59e5da 43Obsoletes: hc-cron
1ea95bdf 44Obsoletes: mcron
45Obsoletes: vixie-cron
5f59e5da
AM
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%description
49Fcron is a periodical command scheduler which aims at replacing Vixie
50Cron, so it implements most of its functionalities. But fcron does not
a436a152 51assume that your system is running neither all the time nor regularly:
52you can, for instance, tell fcron to execute tasks every x hours y
5f59e5da
AM
53minutes of system up time or to do a job only once in a specified
54interval of time. You can also set a nice value to a job, run it
55depending on the system load average and much more !
56
23cad010
JR
57%description -l pl.UTF-8
58Fcron jest serwerem okresowego uruchamiania poleceń mającym za cel
59zastąpienie Vixie Crona, posiadającym zaimplementowane większość
60spośród jego funkcji. Jednakże fcron nie zakłada, że system działa
61cały czas, ani że jest uruchamiany regularnie: można, na przykład,
62kazać fcronowi uruchamiać zadanie co każde x godzin y minut od
63uruchomienia systemu lub wykonywać zadanie dokładnie raz w podanym
64okresie czasu. Umożliwia również ustawianie wartości nice dla zadania,
65uruchamianie go w zależności od obciążenia systemu i dużo więcej.
a436a152 66
5f59e5da
AM
67%prep
68%setup -q
d15f88ee 69%patch0 -p1
6e82b599 70%patch1 -p1
06c71740 71%patch2 -p1
5f59e5da
AM
72
73%build
6e82b599
AM
74%{__aclocal}
75%{__autoconf}
5f59e5da 76%configure \
feca1bdd 77 --with-sendmail=/usr/sbin/sendmail \
65b9ac1d 78 --with-sysfcrontab=systab \
5f59e5da
AM
79 --with-spooldir=%{_var}/spool/cron \
80 --with-run-non-privileged=no \
81 --with-boot-install=no \
82 --with-fcrondyn=yes \
6aa33d9c 83 --with-username=crontab \
5f59e5da
AM
84 --with-groupname=crontab \
85 --with-pam=yes \
c5e6f976 86 --with-selinux=yes \
0ebe5c1d 87 --with-boot-install=no \
2665b9b3 88 --with-editor=/bin/vi
4db6ff6c 89
2665b9b3
JB
90%{__make} \
91 OPTION="%{rpmcflags}"
5f59e5da 92
ef65b337
AM
93echo "#!/bin/sh" > script/user-group
94
5f59e5da
AM
95%install
96rm -rf $RPM_BUILD_ROOT
97install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
98 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
99 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
100
101%{__make} install \
102 DESTDIR=$RPM_BUILD_ROOT \
ef65b337
AM
103 ROOTNAME=$(id -u) \
104 ROOTGROUP=$(id -g) \
105 USERNAME=$(id -u) \
106 GROUPNAME=$(id -g)
5f59e5da 107
a6d0b5fe 108#fix premission for rpmbuild
7703e5de 109chmod +rw $RPM_BUILD_ROOT%{_prefix}/*bin/*
a6d0b5fe 110
2702a7d7 111ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
112mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
113
5f59e5da
AM
114install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
115install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
116install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
117install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
a6d0b5fe 118install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
542b0197 119install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/fcron.conf
a6d0b5fe 120install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
a58c6059 121install %{SOURCE8} $RPM_BUILD_ROOT/etc/cron.hourly/fcron.systab
5f59e5da 122
5f59e5da
AM
123touch $RPM_BUILD_ROOT/var/log/cron
124
125cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
9600229d 126# cron.allow This file describes the names of the users which are
127# allowed to use the local cron daemon
5f59e5da
AM
128root
129EOF
130
131cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
9600229d 132# cron.deny This file describes the names of the users which are
133# NOT allowed to use the local cron daemon
5f59e5da
AM
134EOF2
135
136%clean
137rm -rf $RPM_BUILD_ROOT
138
139%pre
23e300cd
ER
140%groupadd -g 117 -r -f crontab
141%useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab
f995433d 142
5f59e5da 143%post
6aa33d9c 144if [ "$1" = "1" ]; then
8f300fe8 145 if [ -d /var/spool/cron ]; then
c5e6f976 146 FIND=`find /var/spool/cron -type f`
147 for FILE in $FIND; do
8f300fe8 148 mv -f $FILE $FILE.orig
f995433d 149 USER=`basename $FILE`
6970373e 150 chown crontab:crontab $FILE.orig
f995433d 151 chmod 640 $FILE.orig
152 (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
8f300fe8 153 done
f995433d 154 if [ -f /var/spool/cron/root.orig ]; then
155 chmod 600 /var/spool/cron/root.orig
6970373e 156 chown root:root /var/spool/cron/root.orig
f995433d 157 fi
8f300fe8 158 fi
6aa33d9c 159fi
8f300fe8 160
8f300fe8 161if [ "$1" = "2" ]; then
c5e6f976 162 FIND=`find /var/spool/cron -name \*.orig`
163 for FILE in $FIND; do
8f300fe8 164 BASENAME=`basename $FILE`
f995433d 165 USER=`echo "$BASENAME"| sed 's/.orig//'`
6970373e 166 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
8f300fe8 167 done
6aa33d9c 168fi
a6d0b5fe 169
5f59e5da 170/sbin/chkconfig --add crond
7703e5de 171%service crond restart "cron daemon"
6aa33d9c 172
5f59e5da
AM
173umask 027
174touch /var/log/cron
175chgrp crontab /var/log/cron
176chmod 660 /var/log/cron
177
178%preun
179if [ "$1" = "0" ]; then
7703e5de 180 %service crond stop
5f59e5da 181 /sbin/chkconfig --del crond
5f59e5da 182
7703e5de 183 rm -f /var/spool/cron/systab*
0334340a 184
7703e5de
ER
185 FIND=`find /var/spool/cron -name '*.orig'`
186 for FILE in $FIND; do
187 BASENAME=`basename $FILE`
188 USER="${BASENAME%.orig}"
189 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
190 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
191 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
192 done
193 rm -f /var/spool/cron/rm\.*
194 rm -f /var/spool/cron/fcrontab.sig
195 rm -f /var/spool/cron/new\.*
6aa33d9c 196fi
a6d0b5fe 197
5f59e5da
AM
198%postun
199if [ "$1" = "0" ]; then
f995433d 200 %userremove crontab
2702a7d7 201 %groupremove crontab
5f59e5da
AM
202fi
203
204%triggerpostun -- vixie-cron <= 3.0.1-85
205for i in `/bin/ls /var/spool/cron 2>/dev/null`
206do
207 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
208done
209/bin/chmod 660 /var/log/cron
210/bin/chgrp crontab /var/log/cron
211/bin/chmod 640 /etc/cron/cron.*
212/bin/chgrp crontab /etc/cron/cron.*
213
214%triggerpostun -- vixie-cron <= 3.0.1-73
215if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
216 mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
217fi
218if [ -f /etc/cron.d/cron.allow ]; then
219 mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
220fi
221if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
222 mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
223fi
224if [ -f /etc/cron.d/cron.deny ]; then
225 mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
226fi
227
228%triggerpostun -- vixie-cron <= 3.0.1-70
229if [ -f /etc/cron.allow ]; then
230 mv -f /etc/cron.allow /etc/cron/cron.allow
231fi
232if [ -f /etc/cron.deny ]; then
233 mv -f /etc/cron.deny /etc/cron/cron.deny
234fi
235
236%triggerpostun -- hc-cron
237/sbin/chkconfig --del crond
238/sbin/chkconfig --add crond
239
240%triggerpostun -- hc-cron <= 0.14-12
7703e5de 241for i in `/bin/ls /var/spool/cron 2>/dev/null`; do
5f59e5da
AM
242 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
243done
244/bin/chmod 660 /var/log/cron
245/bin/chgrp crontab /var/log/cron
246/bin/chmod 640 /etc/cron/cron.*
247/bin/chgrp crontab /etc/cron/cron.*
248
249%files
250%defattr(644,root,root,755)
3712a1f5 251%doc doc/en/HTML doc/en/txt/{faq.txt,changes.txt,readme.txt,thanks.txt,todo.txt}
542b0197
ER
252%attr(750,root,crontab) %dir %{_sysconfdir}/cron*
253%attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name}.systab
254%attr(640,root,crontab) %config(noreplace) /etc/cron.d/crontab
255%attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
256%attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
257%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
258%attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcron
259%attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcrontab
260%attr(754,root,root) /etc/rc.d/init.d/crond
261%config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) /etc/logrotate.d/cron
3712a1f5 262%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fcron.*
542b0197
ER
263%attr(640,root,crontab) %config(noreplace) %{_sysconfdir}/fcron.conf
264%attr(755,root,root) %{_sbindir}/crond
6aa33d9c 265%attr(6111,crontab,crontab) %{_bindir}/fcrontab
f995433d 266%attr(6111,crontab,crontab) %{_bindir}/crontab
6aa33d9c 267%attr(4711,root,root) %{_bindir}/fcronsighup
268%attr(6111,crontab,crontab) %{_bindir}/fcrondyn
fef2f9d3
JB
269%{_mandir}/man1/fcrondyn.1*
270%{_mandir}/man1/fcrontab.1*
3712a1f5 271%{_mandir}/man3/bitstring.3*
c5e6f976 272%{_mandir}/man5/fcron.conf.5*
273%{_mandir}/man5/fcrontab.5*
274%{_mandir}/man8/fcron.8*
3712a1f5 275%lang(fr) %{_mandir}/fr/man1/fcrondyn.1*
276%lang(fr) %{_mandir}/fr/man1/fcrontab.1*
277%lang(fr) %{_mandir}/fr/man3/bitstring.3*
278%lang(fr) %{_mandir}/fr/man5/fcron.conf.5*
279%lang(fr) %{_mandir}/fr/man5/fcrontab.5*
280%lang(fr) %{_mandir}/fr/man8/fcron.8*
5f59e5da 281%attr(1730,root,crontab) /var/spool/cron
542b0197 282%attr(660,root,crontab) %ghost /var/log/cron
This page took 2.972884 seconds and 4 git commands to generate.