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