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