- inotify bcond and glibc interface dep
[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
9088c091
AM
5#
6Summary: Cron daemon for executing programs at set times
7Name: cronie
8Version: 1.4.1
d07a95b8 9Release: 2
9088c091
AM
10License: MIT and BSD and GPLv2
11Group: Daemons
836fe967 12Source0: %{name}-%{version}.tar.gz
9088c091
AM
13# Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd
14Source1: %{name}.init
15Source2: cron.logrotate
16Source3: cron.sysconfig
17Source4: %{name}.crontab
18Source5: %{name}.pam
19URL: https://fedorahosted.org/cronie/
84a870a4 20BuildRequires: audit-libs-devel
946518b7 21%{?with_inotify:BuildRequires: glibc-devel >= 6:2.4}
9088c091
AM
22%{?with_selinux:BuildRequires: libselinux-devel}
23BuildRequires: pam-devel
9088c091
AM
24BuildRequires: rpmbuild(macros) >= 1.268
25Requires(post): fileutils
26Requires(post,preun): /sbin/chkconfig
27Requires(post,preun): rc-scripts
28Requires(postun): /usr/sbin/groupdel
29Requires(pre): /usr/bin/getgid
30Requires(pre): /usr/sbin/groupadd
31Requires: /bin/run-parts
32Requires: /sbin/chkconfig
33Requires: psmisc >= 20.1
34Requires: rc-scripts
35Provides: crondaemon
36Provides: crontabs = 1.7
37Provides: group(crontab)
84a870a4 38Provides: vixie-cron = 4:4.4
9088c091
AM
39Obsoletes: crondaemon
40Obsoletes: crontabs
84a870a4 41Obsoletes: vixie-cron <= 4:4.3
9088c091
AM
42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44%description
84a870a4
AM
45Cronie contains the standard UNIX daemon crond that runs specified
46programs at scheduled times and related tools. It is based on the
47original cron and has security and configuration enhancements like the
48ability to use pam and SELinux.
9088c091
AM
49
50%package anacron
84a870a4
AM
51Summary: Utility for running regular jobs
52Group: Base
53Provides: anacron = 2.4
54Obsoletes: anacron <= 2.3
9088c091
AM
55
56%description anacron
84a870a4
AM
57Anacron becames part of cronie. Anacron is used only for running
58regular jobs. The default settings execute regular jobs by anacron,
59however this could be overloaded in settings.
9088c091
AM
60
61%prep
62%setup -q
63
64%build
65%configure \
695ed2ed
AM
66 SYSCRONTAB=/etc/cron.d/crontab \
67 SYS_CROND_DIR=/etc/cron.d \
72768a3d 68 --sysconfdir=/etc/cron \
9088c091 69 --with-pam \
45b0067d 70 --with%{!?with_selinux:out}-selinux \
9088c091 71 --with-audit \
946518b7 72 --with%{!?with_inotify:out}-inotify \
9088c091
AM
73 --enable-anacron
74
75%{__make}
76
77%install
78rm -rf $RPM_BUILD_ROOT
d07a95b8 79install -d $RPM_BUILD_ROOT{/var/{log,spool/{ana,}cron},%{_mandir}} \
9088c091
AM
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
86install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
9088c091
AM
87install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
88install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
89install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
90install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
91install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond
92
93for 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
106done
107
108touch $RPM_BUILD_ROOT/var/log/cron
109
110cat > $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
113root
114EOF
115
116cat > $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
119EOF
120
121%clean
122rm -rf $RPM_BUILD_ROOT
123
124%pre
125%groupadd -g 117 -r -f crontab
126
127%post
128/sbin/chkconfig --add crond
129umask 027
130touch /var/log/cron
131chgrp crontab /var/log/cron
132chmod 660 /var/log/cron
133%service crond restart "Cron Daemon"
134
135%preun
136if [ "$1" = "0" ]; then
137 %service crond stop
138 /sbin/chkconfig --del crond
139fi
140
141%postun
142if [ "$1" = "0" ]; then
143 %groupremove crontab
144fi
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
77af6cfd
AM
151%triggerun -- vixie-cron
152# Prevent preun from crond from working
153chmod a-x /etc/rc.d/init.d/crond
154
155%triggerpostun -- vixie-cron
156# Restore what triggerun removed
157chmod 754 /etc/rc.d/init.d/crond
158/sbin/chkconfig --add crond
159
9088c091
AM
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
84a870a4 185%attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron
9088c091
AM
186%{_mandir}/man5/anacrontab.5*
187%{_mandir}/man8/anacron.8*
d07a95b8
AM
188
189%attr(1730,root,crontab) /var/spool/anacron
This page took 0.118517 seconds and 4 git commands to generate.