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