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