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