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