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