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