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