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