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