]> git.pld-linux.org Git - packages/fcron.git/blob - fcron.spec
75f10c80195e940a1b1b13b7bff151dec475b6a7
[packages/fcron.git] / fcron.spec
1 Summary:        A periodical command scheduler which aims at replacing Vixie Cron
2 Summary(pl):    Serwer okresowego uruchamiania poleceñ zastepuj±cy Vixie Crona
3 Name:           fcron
4 Version:        2.9.4
5 Release:        0.1
6 License:        GPL
7 Group:          Daemons
8 Source0:        http://fcron.free.fr/%{name}-%{version}.src.tar.gz
9 # Source0-md5:  4bfcff1002a7231f374591511bacadb2
10 Source1:        %{name}.init
11 Source2:        cron.logrotate
12 Source3:        cron.sysconfig
13 Source4:        %{name}.crontab
14 Source5:        %{name}.pam
15 URL:            http://fcron.free.fr/
16 BuildRequires:  libselinux-devel
17 BuildRequires:  pam-devel
18 PreReq:         rc-scripts
19 Requires(pre):  /usr/bin/getgid
20 Requires(pre):  /usr/sbin/groupadd
21 Requires(post,preun):   /sbin/chkconfig
22 Requires(post): fileutils
23 Requires(postun):       /usr/sbin/groupdel
24 Requires:       /bin/run-parts
25 Requires:       psmisc >= 20.1
26 Provides:       crontabs >= 1.7
27 Provides:       crondaemon
28 Obsoletes:      crontabs
29 Obsoletes:      crondaemon
30 Obsoletes:      hc-cron
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 Fcron is a periodical command scheduler which aims at replacing Vixie
35 Cron, so it implements most of its functionalities. But fcron does not
36 assume that your system is running neither all the time nor regularly:
37 you can, for instance, tell fcron to execute tasks every x hours y
38 minutes of system up time or to do a job only once in a specified
39 interval of time. You can also set a nice value to a job, run it
40 depending on the system load average and much more !
41
42 %description -l pl
43 Fcron jest serwerem okresowego uruchamiania poleceñ maj±cym za cel
44 zast±pienie Vixie Crona, posiadaj±cym zaimplementowane wiêkszo¶æ
45 spo¶ród jego funkcji. Jednak¿e fcron nie zak³ada, ¿e system dzia³a
46 ca³y czas, ani ¿e jest uruchamiany regularnie: mo¿na, na przyk³ad,
47 kazaæ fcronowi uruchamiaæ zadanie co ka¿de x godzin y minut od
48 uruchomienia systemu lub wykonywaæ zadanie dok³adnie raz w podanym
49 okresie czasu. Umo¿liwia równie¿ ustawianie warto¶ci nice dla zadania,
50 uruchamianie go w zale¿no¶ci od obci±¿enia systemu i du¿o wiêcej.
51
52 %prep
53 %setup -q
54
55 %build
56 %configure \
57         --with-spooldir=%{_var}/spool/cron \
58         --with-run-non-privileged=no \
59         --with-boot-install=no \
60         --with-fcrondyn=yes \
61         --with-username=crontab \
62         --with-groupname=crontab \
63         --with-pam=yes \
64         --with-selinux=yes
65
66 %{__make}
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
71         $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
72         $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
73
74 %{__make} install \
75         DESTDIR=$RPM_BUILD_ROOT \
76         DESTMAN=$RPM_BUILD_ROOT%{_mandir}
77
78 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
79 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
80 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
81 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
82 install %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/cron
83
84 for a in fi fr id ja ko pl ; do
85         if test -f $a/man1/crontab.1 ; then
86                 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1
87                 install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1
88         fi
89         if test -f $a/man5/crontab.5 ; then
90                 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5
91                 install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5
92         fi
93         if test -f $a/man8/cron.8 ; then
94                 install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8
95                 install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8
96                 echo .so cron.8 > $RPM_BUILD_ROOT%{_mandir}/$a/man8/crond.8
97         fi
98 done
99
100 touch $RPM_BUILD_ROOT/var/log/cron
101
102 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
103 # cron.allow   This file describes the names of the users which are
104 #               allowed to use the local cron daemon
105 root
106 EOF
107
108 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
109 # cron.deny    This file describes the names of the users which are
110 #               NOT allowed to use the local cron daemon
111 EOF2
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %pre
117 if [ -n "`/usr/bin/getgid crontab`" ]; then
118         if [ "`/usr/bin/getgid crontab`" != "117" ]; then
119                 echo "Error: group crontab doesn't have gid=117. Correct this before installing cron." 1>&2
120                 exit 1
121         fi
122 else
123         echo "Adding group crontab GID=117."
124         /usr/sbin/groupadd -g 117 -r -f crontab
125 fi
126
127 %post
128 /sbin/chkconfig --add crond
129 if [ -f /var/lock/subsys/crond ]; then
130         /etc/rc.d/init.d/crond restart >&2
131 else
132         echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
133 fi
134 umask 027
135 touch /var/log/cron
136 chgrp crontab /var/log/cron
137 chmod 660 /var/log/cron
138
139 %preun
140 if [ "$1" = "0" ]; then
141         if [ -f /var/lock/subsys/crond ]; then
142                 /etc/rc.d/init.d/crond stop >&2
143         fi
144         /sbin/chkconfig --del crond
145 fi
146
147 %postun
148 if [ "$1" = "0" ]; then
149         echo "Removing group crontab."
150         /usr/sbin/groupdel crontab
151 fi
152
153 %triggerpostun -- vixie-cron <= 3.0.1-85
154 for i in `/bin/ls /var/spool/cron 2>/dev/null`
155 do
156         chown ${i} /var/spool/cron/${i} 2>/dev/null || :
157 done
158 /bin/chmod 660 /var/log/cron
159 /bin/chgrp crontab /var/log/cron
160 /bin/chmod 640 /etc/cron/cron.*
161 /bin/chgrp crontab /etc/cron/cron.*
162
163 %triggerpostun -- vixie-cron <= 3.0.1-73
164 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
165         mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
166 fi
167 if [ -f /etc/cron.d/cron.allow ]; then
168         mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
169 fi
170 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
171         mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
172 fi
173 if [ -f /etc/cron.d/cron.deny ]; then
174         mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
175 fi
176
177 %triggerpostun -- vixie-cron <= 3.0.1-70
178 if [ -f /etc/cron.allow ]; then
179         mv -f /etc/cron.allow /etc/cron/cron.allow
180 fi
181 if [ -f /etc/cron.deny ]; then
182         mv -f /etc/cron.deny /etc/cron/cron.deny
183 fi
184
185 %triggerpostun -- hc-cron
186 /sbin/chkconfig --del crond
187 /sbin/chkconfig --add crond
188
189 %triggerpostun -- hc-cron <= 0.14-12
190 for i in `/bin/ls /var/spool/cron 2>/dev/null`
191 do
192         chown ${i} /var/spool/cron/${i} 2>/dev/null || :
193 done
194 /bin/chmod 660 /var/log/cron
195 /bin/chgrp crontab /var/log/cron
196 /bin/chmod 640 /etc/cron/cron.*
197 /bin/chgrp crontab /etc/cron/cron.*
198
199 %files
200 %defattr(644,root,root,755)
201 %doc CHANGES CONVERSION FEATURES MAIL README THANKS
202 %attr(0750,root,crontab) %dir %{_sysconfdir}/cron*
203 %attr(0644,root,crontab) %config(noreplace) /etc/cron.d/crontab
204 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
205 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
206 %attr(0640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
207 %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/cron
208 %attr(0754,root,root) /etc/rc.d/init.d/crond
209 %config /etc/logrotate.d/cron
210 %attr(0755,root,root) %{_sbindir}/crond
211 %attr(2755,root,crontab) %{_bindir}/crontab
212
213 %{_mandir}/man*/*
214 %lang(fi) %{_mandir}/fi/man*/*
215 %lang(fr) %{_mandir}/fr/man*/*
216 %lang(id) %{_mandir}/id/man*/*
217 %lang(ja) %{_mandir}/ja/man*/*
218 %lang(ko) %{_mandir}/ko/man*/*
219 %lang(pl) %{_mandir}/pl/man*/*
220
221 %attr(1730,root,crontab) /var/spool/cron
222 %attr(0660,root,crontab) %ghost /var/log/cron
This page took 0.091421 seconds and 3 git commands to generate.