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