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