]> git.pld-linux.org Git - packages/fcron.git/blob - fcron.spec
896e186c6b03217b754dbb42f24cc61a04523b00
[packages/fcron.git] / fcron.spec
1 Summary:        A periodical command scheduler which aims at replacing Vixie Cron
2 Summary(pl.UTF-8):      Serwer okresowego uruchamiania poleceń zastępujący Vixie Crona
3 Name:           fcron
4 Version:        3.0.2
5 Release:        1
6 License:        GPL
7 Group:          Daemons
8 Source0:        http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
9 # Source0-md5:  f35e6af41d356ebcb38882f86a14fb94
10 Source1:        %{name}.init
11 Source2:        cron.logrotate
12 Source3:        cron.sysconfig
13 Source4:        %{name}.crontab
14 Source5:        %{name}.pam
15 Source6:        %{name}.conf
16 Source7:        %{name}tab.pam
17 Source8:        %{name}.systab
18 Patch0:         %{name}-mail_output_only_if_there_is_output.patch
19 Patch1:         %{name}-configure.patch
20 URL:            http://fcron.free.fr/
21 # configure tests -x (check can be removed, just like sendmail)
22 BuildRequires:  /bin/vi
23 BuildRequires:  autoconf
24 BuildRequires:  automake
25 BuildRequires:  libselinux-devel
26 BuildRequires:  pam-devel
27 BuildRequires:  rpmbuild(macros) >= 1.268
28 Requires(post): fileutils
29 Requires(post,preun):   /sbin/chkconfig
30 Requires(postun):       /usr/sbin/groupdel
31 Requires(pre):  /bin/id
32 Requires(pre):  /usr/bin/getgid
33 Requires(pre):  /usr/sbin/groupadd
34 Requires(pre):  /usr/sbin/useradd
35 Requires:       /bin/run-parts
36 Requires:       psmisc >= 20.1
37 Requires:       rc-scripts
38 Provides:       crondaemon
39 Provides:       crontabs >= 1.7
40 Provides:       group(crontab)
41 Obsoletes:      crontabs
42 Obsoletes:      hc-cron
43 Obsoletes:      mcron
44 Obsoletes:      vixie-cron
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
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 !
55
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.
65
66 %prep
67 %setup -q
68 %patch0 -p1
69 %patch1 -p1
70
71 %build
72 %{__aclocal}
73 %{__autoconf}
74 %configure \
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 \
80         --with-fcrondyn=yes \
81         --with-username=crontab \
82         --with-groupname=crontab \
83         --with-pam=yes \
84         --with-selinux=yes \
85         --with-boot-install=no \
86         --with-editor=/bin/vi
87
88 %{__make} \
89         OPTION="%{rpmcflags}"
90
91 echo "#!/bin/sh" > script/user-group
92
93 %install
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}
98
99 %{__make} install \
100         DESTDIR=$RPM_BUILD_ROOT \
101         DESTSBIN=$RPM_BUILD_ROOT%{_sbindir} \
102         DESTBIN=$RPM_BUILD_ROOT%{_bindir} \
103         DESTMAN=$RPM_BUILD_ROOT%{_mandir} \
104         ROOTNAME=$(id -u) \
105         ROOTGROUP=$(id -g) \
106         USERNAME=$(id -u) \
107         GROUPNAME=$(id -g)
108
109 #fix premission for rpmbuild
110 chmod +rw $RPM_BUILD_ROOT%{_prefix}/*bin/*
111
112 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
113 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
114
115 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
116 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
117 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
118 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
119 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
120 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/fcron.conf
121 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
122 install %{SOURCE8} $RPM_BUILD_ROOT/etc/cron.hourly/fcron.systab
123
124 touch $RPM_BUILD_ROOT/var/log/cron
125
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
129 root
130 EOF
131
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
135 EOF2
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %pre
141 %groupadd -g 117 -r -f crontab
142 %useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab
143
144 %post
145 if [ "$1" = "1" ]; then
146         if [ -d /var/spool/cron ]; then
147                 FIND=`find /var/spool/cron -type f`
148                 for FILE in $FIND; do
149                         mv -f $FILE $FILE.orig
150                         USER=`basename $FILE`
151                         chown crontab:crontab $FILE.orig
152                         chmod 640 $FILE.orig
153                         (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
154                 done
155                 if [ -f /var/spool/cron/root.orig ]; then
156                         chmod 600 /var/spool/cron/root.orig
157                         chown root:root /var/spool/cron/root.orig
158                 fi
159         fi
160 fi
161
162 if [ "$1" = "2" ]; then
163         FIND=`find /var/spool/cron -name \*.orig`
164         for FILE in $FIND; do
165                 BASENAME=`basename $FILE`
166                 USER=`echo "$BASENAME"| sed 's/.orig//'`
167                 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
168         done
169 fi
170
171 /sbin/chkconfig --add crond
172 %service crond restart "cron daemon"
173
174 umask 027
175 touch /var/log/cron
176 chgrp crontab /var/log/cron
177 chmod 660 /var/log/cron
178
179 %preun
180 if [ "$1" = "0" ]; then
181         %service crond stop
182         /sbin/chkconfig --del crond
183
184         rm -f /var/spool/cron/systab*
185
186         FIND=`find /var/spool/cron -name '*.orig'`
187         for FILE in $FIND; do
188                 BASENAME=`basename $FILE`
189                 USER="${BASENAME%.orig}"
190                 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
191                 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
192                 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
193         done
194         rm -f /var/spool/cron/rm\.*
195         rm -f /var/spool/cron/fcrontab.sig
196         rm -f /var/spool/cron/new\.*
197 fi
198
199 %postun
200 if [ "$1" = "0" ]; then
201         %userremove crontab
202         %groupremove crontab
203 fi
204
205 %triggerpostun -- vixie-cron <= 3.0.1-85
206 for i in `/bin/ls /var/spool/cron 2>/dev/null`
207 do
208         chown ${i} /var/spool/cron/${i} 2>/dev/null || :
209 done
210 /bin/chmod 660 /var/log/cron
211 /bin/chgrp crontab /var/log/cron
212 /bin/chmod 640 /etc/cron/cron.*
213 /bin/chgrp crontab /etc/cron/cron.*
214
215 %triggerpostun -- vixie-cron <= 3.0.1-73
216 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
217         mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
218 fi
219 if [ -f /etc/cron.d/cron.allow ]; then
220         mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
221 fi
222 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
223         mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
224 fi
225 if [ -f /etc/cron.d/cron.deny ]; then
226         mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
227 fi
228
229 %triggerpostun -- vixie-cron <= 3.0.1-70
230 if [ -f /etc/cron.allow ]; then
231         mv -f /etc/cron.allow /etc/cron/cron.allow
232 fi
233 if [ -f /etc/cron.deny ]; then
234         mv -f /etc/cron.deny /etc/cron/cron.deny
235 fi
236
237 %triggerpostun -- hc-cron
238 /sbin/chkconfig --del crond
239 /sbin/chkconfig --add crond
240
241 %triggerpostun -- hc-cron <= 0.14-12
242 for i in `/bin/ls /var/spool/cron 2>/dev/null`; do
243         chown ${i} /var/spool/cron/${i} 2>/dev/null || :
244 done
245 /bin/chmod 660 /var/log/cron
246 /bin/chgrp crontab /var/log/cron
247 /bin/chmod 640 /etc/cron/cron.*
248 /bin/chgrp crontab /etc/cron/cron.*
249
250 %files
251 %defattr(644,root,root,755)
252 %doc doc/en/HTML doc/en/txt/{faq.txt,changes.txt,readme.txt,thanks.txt,todo.txt} 
253 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
254 %attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name}.systab
255 %attr(640,root,crontab) %config(noreplace) /etc/cron.d/crontab
256 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
257 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
258 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
259 %attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcron
260 %attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcrontab
261 %attr(754,root,root) /etc/rc.d/init.d/crond
262 %config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) /etc/logrotate.d/cron
263 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fcron.*
264 %attr(640,root,crontab) %config(noreplace) %{_sysconfdir}/fcron.conf
265 %attr(755,root,root) %{_sbindir}/crond
266 %attr(6111,crontab,crontab) %{_bindir}/fcrontab
267 %attr(6111,crontab,crontab) %{_bindir}/crontab
268 %attr(4711,root,root) %{_bindir}/fcronsighup
269 %attr(6111,crontab,crontab) %{_bindir}/fcrondyn
270 %{_mandir}/man1/fcrondyn.1*
271 %{_mandir}/man1/fcrontab.1*
272 %{_mandir}/man3/bitstring.3*
273 %{_mandir}/man5/fcron.conf.5*
274 %{_mandir}/man5/fcrontab.5*
275 %{_mandir}/man8/fcron.8*
276 %lang(fr) %{_mandir}/fr/man1/fcrondyn.1*
277 %lang(fr) %{_mandir}/fr/man1/fcrontab.1*
278 %lang(fr) %{_mandir}/fr/man3/bitstring.3*
279 %lang(fr) %{_mandir}/fr/man5/fcron.conf.5*
280 %lang(fr) %{_mandir}/fr/man5/fcrontab.5*
281 %lang(fr) %{_mandir}/fr/man8/fcron.8*
282 %attr(1730,root,crontab) /var/spool/cron
283 %attr(660,root,crontab) %ghost /var/log/cron
This page took 1.439416 seconds and 2 git commands to generate.