]> git.pld-linux.org Git - packages/fcron.git/blob - fcron.spec
- restore sendmail configure fix
[packages/fcron.git] / fcron.spec
1 Summary:        A periodical command scheduler which aims at replacing Vixie Cron
2 Summary(pl.UTF-8):      Serwer okresowego uruchamiania poleceń zastępujący Vixie Crona
3 Name:           fcron
4 Version:        3.1.2
5 Release:        2
6 License:        GPL v2+
7 Group:          Daemons
8 Source0:        http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
9 # Source0-md5:  36bf213e15f3a480f2274f8e46cced0a
10 Source1:        %{name}.init
11 Source2:        cron.logrotate
12 Source3:        cron.sysconfig
13 Source4:        %{name}.crontab
14 Source5:        %{name}.pam
15 Source6:        %{name}.conf
16 Source7:        %{name}tab.pam
17 Source8:        %{name}.systab
18 Patch0:         %{name}-sendmail.patch
19 Patch1:         %{name}-Makefile.patch
20 Patch2:         %{name}-accept_readable_fcron.conf.patch
21 URL:            http://fcron.free.fr/
22 # configure tests -x (check can be removed, just like sendmail)
23 BuildRequires:  /bin/vi
24 BuildRequires:  autoconf
25 BuildRequires:  automake
26 BuildRequires:  libselinux-devel
27 BuildRequires:  pam-devel
28 BuildRequires:  rpmbuild(macros) >= 1.268
29 Requires(post): fileutils
30 Requires(post,preun):   /sbin/chkconfig
31 Requires(postun):       /usr/sbin/groupdel
32 Requires(pre):  /bin/id
33 Requires(pre):  /usr/bin/getgid
34 Requires(pre):  /usr/sbin/groupadd
35 Requires(pre):  /usr/sbin/useradd
36 Requires:       /bin/run-parts
37 Requires:       psmisc >= 20.1
38 Requires:       rc-scripts
39 Provides:       crondaemon
40 Provides:       crontabs = 1.7
41 Provides:       group(crontab)
42 Obsoletes:      crondaemon
43 Obsoletes:      crontabs
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %description
47 Fcron is a periodical command scheduler which aims at replacing Vixie
48 Cron, so it implements most of its functionalities. But fcron does not
49 assume that your system is running neither all the time nor regularly:
50 you can, for instance, tell fcron to execute tasks every x hours y
51 minutes of system up time or to do a job only once in a specified
52 interval of time. You can also set a nice value to a job, run it
53 depending on the system load average and much more !
54
55 %description -l pl.UTF-8
56 Fcron jest serwerem okresowego uruchamiania poleceń mającym za cel
57 zastąpienie Vixie Crona, posiadającym zaimplementowane większość
58 spośród jego funkcji. Jednakże fcron nie zakłada, że system działa
59 cały czas, ani że jest uruchamiany regularnie: można, na przykład,
60 kazać fcronowi uruchamiać zadanie co każde x godzin y minut od
61 uruchomienia systemu lub wykonywać zadanie dokładnie raz w podanym
62 okresie czasu. Umożliwia również ustawianie wartości nice dla zadania,
63 uruchamianie go w zależności od obciążenia systemu i dużo więcej.
64
65 %prep
66 %setup -q
67 %patch0 -p1
68 %patch1 -p1
69 %patch2 -p0
70
71 %build
72 %{__aclocal}
73 %{__autoconf}
74 %configure \
75         --with-sendmail=/usr/sbin/sendmail \
76         --with-sysfcrontab=systab \
77         --with-spooldir=%{_var}/spool/cron \
78         --with-run-non-privileged=no \
79         --with-boot-install=no \
80         --with-fcrondyn=yes \
81         --with-username=crontab \
82         --with-groupname=crontab \
83         --with-pam=yes \
84         --with-selinux=yes \
85         --with-boot-install=no \
86         --with-editor=/bin/vi
87
88 %{__make} \
89         OPTION="%{rpmcflags}"
90
91 echo "#!/bin/sh" > script/user-group
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
96         $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
97         $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
98
99 %{__make} install-staged \
100         DESTDIR=$RPM_BUILD_ROOT \
101         ROOTNAME=$(id -u) \
102         ROOTGROUP=$(id -g) \
103         USERNAME=$(id -u) \
104         GROUPNAME=$(id -g)
105
106 #fix premission for rpmbuild
107 chmod +rw $RPM_BUILD_ROOT%{_prefix}/*bin/*
108
109 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
110 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
111
112 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
113 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
114 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
115 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
116 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
117 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/fcron.conf
118 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
119 install %{SOURCE8} $RPM_BUILD_ROOT/etc/cron.hourly/fcron.systab
120
121 touch $RPM_BUILD_ROOT/var/log/cron
122
123 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF'
124 # cron.allow    This file describes the names of the users which are
125 #               allowed to use the local cron daemon
126 root
127 EOF
128
129 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF'
130 # cron.deny     This file describes the names of the users which are
131 #               NOT allowed to use the local cron daemon
132 EOF
133
134 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
135
136 %clean
137 rm -rf $RPM_BUILD_ROOT
138
139 %pre
140 %groupadd -g 117 -r -f crontab
141 %useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab
142
143 %post
144 if [ "$1" = "1" ]; then
145         if [ -d /var/spool/cron ]; then
146                 FIND=`find /var/spool/cron -type f`
147                 for FILE in $FIND; do
148                         mv -f $FILE $FILE.orig
149                         USER=`basename $FILE`
150                         chown crontab:crontab $FILE.orig
151                         chmod 640 $FILE.orig
152                         (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
153                 done
154                 if [ -f /var/spool/cron/root.orig ]; then
155                         chmod 600 /var/spool/cron/root.orig
156                         chown root:root /var/spool/cron/root.orig
157                 fi
158         fi
159 fi
160
161 if [ "$1" = "2" ]; then
162         FIND=`find /var/spool/cron -name \*.orig`
163         for FILE in $FIND; do
164                 BASENAME=`basename $FILE`
165                 USER=`echo "$BASENAME"| sed 's/.orig//'`
166                 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
167         done
168 fi
169
170 /sbin/chkconfig --add crond
171 %service crond restart "Cron Daemon"
172
173 umask 027
174 touch /var/log/cron
175 chgrp crontab /var/log/cron
176 chmod 660 /var/log/cron
177
178 %preun
179 if [ "$1" = "0" ]; then
180         %service crond stop
181         /sbin/chkconfig --del crond
182
183         rm -f /var/spool/cron/systab*
184
185         FIND=`find /var/spool/cron -name '*.orig'`
186         for FILE in $FIND; do
187                 BASENAME=`basename $FILE`
188                 USER="${BASENAME%.orig}"
189                 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
190                 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
191                 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
192         done
193         rm -f /var/spool/cron/rm.*
194         rm -f /var/spool/cron/fcrontab.sig
195         rm -f /var/spool/cron/new.*
196 fi
197
198 %postun
199 if [ "$1" = "0" ]; then
200         %userremove crontab
201         %groupremove crontab
202 fi
203
204 %triggerpostun -- hc-cron
205 # reinstall crond init.d links, which could be different
206 /sbin/chkconfig --del crond
207 /sbin/chkconfig --add crond
208
209 %files
210 %defattr(644,root,root,755)
211 %doc doc/en/HTML doc/en/txt/{faq.txt,changes.txt,readme.txt,thanks.txt,todo.txt}
212 %attr(750,root,crontab) %dir %{_sysconfdir}/cron*
213 %attr(750,root,root) %{_sysconfdir}/cron.hourly/%{name}.systab
214 %attr(640,root,crontab) %config(noreplace) /etc/cron.d/crontab
215 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
216 %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
217 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
218 %attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcron
219 %attr(644,root,crontab) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/fcrontab
220 %attr(754,root,root) /etc/rc.d/init.d/crond
221 %config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) /etc/logrotate.d/cron
222 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fcron.allow
223 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fcron.deny
224 %attr(640,root,crontab) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fcron.conf
225 %attr(755,root,root) %{_sbindir}/crond
226 %attr(6111,crontab,crontab) %{_bindir}/fcrontab
227 %attr(6111,crontab,crontab) %{_bindir}/crontab
228 %attr(4711,root,root) %{_bindir}/fcronsighup
229 %attr(6111,crontab,crontab) %{_bindir}/fcrondyn
230 %{_mandir}/man1/fcrondyn.1*
231 %{_mandir}/man1/fcrontab.1*
232 %{_mandir}/man3/bitstring.3*
233 %{_mandir}/man5/fcron.conf.5*
234 %{_mandir}/man5/fcrontab.5*
235 %{_mandir}/man8/fcron.8*
236 %lang(fr) %{_mandir}/fr/man1/fcrondyn.1*
237 %lang(fr) %{_mandir}/fr/man1/fcrontab.1*
238 %lang(fr) %{_mandir}/fr/man3/bitstring.3*
239 %lang(fr) %{_mandir}/fr/man5/fcron.conf.5*
240 %lang(fr) %{_mandir}/fr/man5/fcrontab.5*
241 %lang(fr) %{_mandir}/fr/man8/fcron.8*
242 %attr(1730,root,crontab) /var/spool/cron
243 %attr(660,root,crontab) %ghost /var/log/cron
This page took 0.040794 seconds and 3 git commands to generate.