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