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