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