]> git.pld-linux.org Git - packages/cronie.git/blame_incremental - cronie.spec
- fix pam dir on install, disable selinux,audit on ac (need more work)
[packages/cronie.git] / cronie.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without inotify # without inotify support
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
9%bcond_without audit # without audit support
10%endif
11
12Summary: Cron daemon for executing programs at set times
13Name: cronie
14Version: 1.4.1
15Release: 3
16License: MIT and BSD and GPLv2
17Group: Daemons
18Source0: %{name}-%{version}.tar.gz
19# Source0-md5: 9c089d2035b9fa8263bc71da3eb31cdd
20Source1: %{name}.init
21Source2: cron.logrotate
22Source3: cron.sysconfig
23Source4: %{name}.crontab
24Source5: %{name}.pam
25Patch0: inotify-nosys.patch
26URL: https://fedorahosted.org/cronie/
27%{?with_audit:BuildRequires: audit-libs-devel}
28BuildRequires: autoconf
29BuildRequires: automake
30%{?with_selinux:BuildRequires: libselinux-devel}
31BuildRequires: pam-devel
32BuildRequires: rpm >= 4.4.9-56
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
44%{?with_inotify:Requires: uname(release) >= 2.6.13}
45Provides: crondaemon
46Provides: crontabs = 1.7
47Provides: group(crontab)
48%if "%{pld_release}" == "th"
49Provides: vixie-cron = 4:4.4
50%endif
51Obsoletes: crondaemon
52Obsoletes: crontabs
53%if "%{pld_release}" == "th"
54Obsoletes: vixie-cron <= 4:4.3
55%endif
56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58%description
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.
63
64%package anacron
65Summary: Utility for running regular jobs
66Group: Base
67Provides: anacron = 2.4
68Obsoletes: anacron <= 2.3
69
70%description anacron
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.
74
75%prep
76%setup -q
77%patch0 -p1
78
79%build
80%{__aclocal}
81%{__autoconf}
82%{__autoheader}
83%{__automake}
84%configure \
85 SYSCRONTAB=/etc/cron.d/crontab \
86 SYS_CROND_DIR=/etc/cron.d \
87 --sysconfdir=/etc/cron \
88 --with-pam \
89 --with%{!?with_selinux:out}-selinux \
90 --with%{!?with_audit:out}-audit \
91 --with%{!?with_inotify:out}-inotify \
92 --enable-anacron
93
94%{__make}
95
96%install
97rm -rf $RPM_BUILD_ROOT
98install -d $RPM_BUILD_ROOT{/var/{log,spool/{ana,}cron},%{_mandir}} \
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 \
103 pamdir=/etc/pam.d \
104 DESTDIR=$RPM_BUILD_ROOT
105
106install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
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
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
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
205%attr(755,root,root) %{_sysconfdir}/cron.hourly/0anacron
206%{_mandir}/man5/anacrontab.5*
207%{_mandir}/man8/anacron.8*
208
209%attr(1730,root,crontab) /var/spool/anacron
This page took 0.031406 seconds and 4 git commands to generate.