]>
Commit | Line | Data |
---|---|---|
9088c091 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without selinux # without SELinux support | |
946518b7 | 4 | %bcond_without inotify # without inotify support |
828712ad | 5 | %bcond_without audit # without audit support |
9088c091 AM |
6 | # |
7 | Summary: Cron daemon for executing programs at set times | |
8 | Name: cronie | |
9 | Version: 1.4.1 | |
d07a95b8 | 10 | Release: 2 |
9088c091 AM |
11 | License: MIT and BSD and GPLv2 |
12 | Group: Daemons | |
836fe967 | 13 | Source0: %{name}-%{version}.tar.gz |
9088c091 AM |
14 | # Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd |
15 | Source1: %{name}.init | |
16 | Source2: cron.logrotate | |
17 | Source3: cron.sysconfig | |
18 | Source4: %{name}.crontab | |
19 | Source5: %{name}.pam | |
f440f0d0 | 20 | Patch0: inotify-nosys.patch |
9088c091 | 21 | URL: https://fedorahosted.org/cronie/ |
828712ad ER |
22 | %{?with_audit:BuildRequires: audit-libs-devel} |
23 | BuildRequires: autoconf | |
24 | BuildRequires: automake | |
9088c091 AM |
25 | %{?with_selinux:BuildRequires: libselinux-devel} |
26 | BuildRequires: pam-devel | |
9088c091 AM |
27 | BuildRequires: rpmbuild(macros) >= 1.268 |
28 | Requires(post): fileutils | |
29 | Requires(post,preun): /sbin/chkconfig | |
30 | Requires(post,preun): rc-scripts | |
31 | Requires(postun): /usr/sbin/groupdel | |
32 | Requires(pre): /usr/bin/getgid | |
33 | Requires(pre): /usr/sbin/groupadd | |
34 | Requires: /bin/run-parts | |
35 | Requires: /sbin/chkconfig | |
36 | Requires: psmisc >= 20.1 | |
37 | Requires: rc-scripts | |
f440f0d0 | 38 | %{?with_inotify:Requires: uname(release) >= 2.6.13} |
9088c091 AM |
39 | Provides: crondaemon |
40 | Provides: crontabs = 1.7 | |
41 | Provides: group(crontab) | |
84a870a4 | 42 | Provides: vixie-cron = 4:4.4 |
9088c091 AM |
43 | Obsoletes: crondaemon |
44 | Obsoletes: crontabs | |
84a870a4 | 45 | Obsoletes: vixie-cron <= 4:4.3 |
9088c091 AM |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
47 | ||
48 | %description | |
84a870a4 AM |
49 | Cronie contains the standard UNIX daemon crond that runs specified |
50 | programs at scheduled times and related tools. It is based on the | |
51 | original cron and has security and configuration enhancements like the | |
52 | ability to use pam and SELinux. | |
9088c091 AM |
53 | |
54 | %package anacron | |
84a870a4 AM |
55 | Summary: Utility for running regular jobs |
56 | Group: Base | |
57 | Provides: anacron = 2.4 | |
58 | Obsoletes: anacron <= 2.3 | |
9088c091 AM |
59 | |
60 | %description anacron | |
84a870a4 AM |
61 | Anacron becames part of cronie. Anacron is used only for running |
62 | regular jobs. The default settings execute regular jobs by anacron, | |
63 | however this could be overloaded in settings. | |
9088c091 AM |
64 | |
65 | %prep | |
66 | %setup -q | |
f440f0d0 | 67 | %patch0 -p1 |
9088c091 AM |
68 | |
69 | %build | |
828712ad ER |
70 | %{__aclocal} |
71 | %{__autoconf} | |
72 | %{__autoheader} | |
73 | %{__automake} | |
9088c091 | 74 | %configure \ |
695ed2ed AM |
75 | SYSCRONTAB=/etc/cron.d/crontab \ |
76 | SYS_CROND_DIR=/etc/cron.d \ | |
72768a3d | 77 | --sysconfdir=/etc/cron \ |
9088c091 | 78 | --with-pam \ |
45b0067d | 79 | --with%{!?with_selinux:out}-selinux \ |
828712ad | 80 | --with%{!?with_audit:out}-audit \ |
946518b7 | 81 | --with%{!?with_inotify:out}-inotify \ |
9088c091 AM |
82 | --enable-anacron |
83 | ||
84 | %{__make} | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
d07a95b8 | 88 | install -d $RPM_BUILD_ROOT{/var/{log,spool/{ana,}cron},%{_mandir}} \ |
9088c091 AM |
89 | $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \ |
90 | $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d} | |
91 | ||
92 | %{__make} install \ | |
93 | DESTDIR=$RPM_BUILD_ROOT | |
94 | ||
95 | install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron | |
9088c091 AM |
96 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond |
97 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron | |
98 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron | |
99 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab | |
100 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond | |
101 | ||
102 | for a in fi fr id ja ko pl; do | |
103 | if test -f $a/man1/crontab.1; then | |
104 | install -d $RPM_BUILD_ROOT%{_mandir}/$a/man1 | |
105 | install $a/man1/crontab.1 $RPM_BUILD_ROOT%{_mandir}/$a/man1 | |
106 | fi | |
107 | if test -f $a/man5/crontab.5; then | |
108 | install -d $RPM_BUILD_ROOT%{_mandir}/$a/man5 | |
109 | install $a/man5/crontab.5 $RPM_BUILD_ROOT%{_mandir}/$a/man5 | |
110 | fi | |
111 | if test -f $a/man8/cron.8; then | |
112 | install -d $RPM_BUILD_ROOT%{_mandir}/$a/man8 | |
113 | install $a/man8/cron.8 $RPM_BUILD_ROOT%{_mandir}/$a/man8 | |
114 | fi | |
115 | done | |
116 | ||
117 | touch $RPM_BUILD_ROOT/var/log/cron | |
118 | ||
119 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << 'EOF' | |
120 | # cron.allow This file describes the names of the users which are | |
121 | # allowed to use the local cron daemon | |
122 | root | |
123 | EOF | |
124 | ||
125 | cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << 'EOF' | |
126 | # cron.deny This file describes the names of the users which are | |
127 | # NOT allowed to use the local cron daemon | |
128 | EOF | |
129 | ||
130 | %clean | |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
133 | %pre | |
134 | %groupadd -g 117 -r -f crontab | |
135 | ||
136 | %post | |
137 | /sbin/chkconfig --add crond | |
138 | umask 027 | |
139 | touch /var/log/cron | |
140 | chgrp crontab /var/log/cron | |
141 | chmod 660 /var/log/cron | |
142 | %service crond restart "Cron Daemon" | |
143 | ||
144 | %preun | |
145 | if [ "$1" = "0" ]; then | |
146 | %service crond stop | |
147 | /sbin/chkconfig --del crond | |
148 | fi | |
149 | ||
150 | %postun | |
151 | if [ "$1" = "0" ]; then | |
152 | %groupremove crontab | |
153 | fi | |
154 | ||
155 | %triggerpostun -- hc-cron | |
156 | # reinstall crond init.d links, which could be different | |
157 | /sbin/chkconfig --del crond | |
158 | /sbin/chkconfig --add crond | |
159 | ||
77af6cfd AM |
160 | %triggerun -- vixie-cron |
161 | # Prevent preun from crond from working | |
162 | chmod a-x /etc/rc.d/init.d/crond | |
163 | ||
164 | %triggerpostun -- vixie-cron | |
165 | # Restore what triggerun removed | |
166 | chmod 754 /etc/rc.d/init.d/crond | |
167 | /sbin/chkconfig --add crond | |
168 | ||
9088c091 AM |
169 | %files |
170 | %defattr(644,root,root,755) | |
171 | %doc AUTHORS ChangeLog README | |
172 | %attr(750,root,crontab) %dir %{_sysconfdir}/cron* | |
173 | %attr(640,root,crontab) %config(noreplace,missingok) /etc/cron.d/crontab | |
174 | %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow | |
175 | %attr(640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny | |
176 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron | |
177 | %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/crond | |
178 | %attr(754,root,root) /etc/rc.d/init.d/crond | |
179 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/cron | |
180 | %attr(755,root,root) %{_sbindir}/crond | |
181 | %attr(2755,root,crontab) %{_bindir}/crontab | |
182 | ||
183 | %{_mandir}/man8/crond.8* | |
184 | %{_mandir}/man8/cron.8* | |
185 | %{_mandir}/man5/crontab.5* | |
186 | %{_mandir}/man1/crontab.1* | |
187 | ||
188 | %attr(1730,root,crontab) /var/spool/cron | |
189 | %attr(660,root,crontab) %ghost /var/log/cron | |
190 | ||
191 | %files anacron | |
192 | %defattr(644,root,root,755) | |
193 | %attr(755,root,root) %{_sbindir}/anacron | |
84a870a4 | 194 | %attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron |
9088c091 AM |
195 | %{_mandir}/man5/anacrontab.5* |
196 | %{_mandir}/man8/anacron.8* | |
d07a95b8 AM |
197 | |
198 | %attr(1730,root,crontab) /var/spool/anacron |