]> git.pld-linux.org Git - packages/cronie.git/blob - cronie.spec
- fix pam dir on install, disable selinux,audit on ac (need more work)
[packages/cronie.git] / cronie.spec
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
12 Summary:        Cron daemon for executing programs at set times
13 Name:           cronie
14 Version:        1.4.1
15 Release:        3
16 License:        MIT and BSD and GPLv2
17 Group:          Daemons
18 Source0:        %{name}-%{version}.tar.gz
19 # Source0-md5:  9c089d2035b9fa8263bc71da3eb31cdd
20 Source1:        %{name}.init
21 Source2:        cron.logrotate
22 Source3:        cron.sysconfig
23 Source4:        %{name}.crontab
24 Source5:        %{name}.pam
25 Patch0:         inotify-nosys.patch
26 URL:            https://fedorahosted.org/cronie/
27 %{?with_audit:BuildRequires:    audit-libs-devel}
28 BuildRequires:  autoconf
29 BuildRequires:  automake
30 %{?with_selinux:BuildRequires:  libselinux-devel}
31 BuildRequires:  pam-devel
32 BuildRequires:  rpm >= 4.4.9-56
33 BuildRequires:  rpmbuild(macros) >= 1.268
34 Requires(post): fileutils
35 Requires(post,preun):   /sbin/chkconfig
36 Requires(post,preun):   rc-scripts
37 Requires(postun):       /usr/sbin/groupdel
38 Requires(pre):  /usr/bin/getgid
39 Requires(pre):  /usr/sbin/groupadd
40 Requires:       /bin/run-parts
41 Requires:       /sbin/chkconfig
42 Requires:       psmisc >= 20.1
43 Requires:       rc-scripts
44 %{?with_inotify:Requires:       uname(release) >= 2.6.13}
45 Provides:       crondaemon
46 Provides:       crontabs = 1.7
47 Provides:       group(crontab)
48 %if "%{pld_release}" == "th"
49 Provides:       vixie-cron = 4:4.4
50 %endif
51 Obsoletes:      crondaemon
52 Obsoletes:      crontabs
53 %if "%{pld_release}" == "th"
54 Obsoletes:      vixie-cron <= 4:4.3
55 %endif
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %description
59 Cronie contains the standard UNIX daemon crond that runs specified
60 programs at scheduled times and related tools. It is based on the
61 original cron and has security and configuration enhancements like the
62 ability to use pam and SELinux.
63
64 %package anacron
65 Summary:        Utility for running regular jobs
66 Group:          Base
67 Provides:       anacron = 2.4
68 Obsoletes:      anacron <= 2.3
69
70 %description anacron
71 Anacron becames part of cronie. Anacron is used only for running
72 regular jobs. The default settings execute regular jobs by anacron,
73 however 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
97 rm -rf $RPM_BUILD_ROOT
98 install -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
106 install contrib/0anacron $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
107 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
108 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
109 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
110 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
111 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/crond
112
113 for 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
126 done
127
128 touch $RPM_BUILD_ROOT/var/log/cron
129
130 cat > $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
133 root
134 EOF
135
136 cat > $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
139 EOF
140
141 %clean
142 rm -rf $RPM_BUILD_ROOT
143
144 %pre
145 %groupadd -g 117 -r -f crontab
146
147 %post
148 /sbin/chkconfig --add crond
149 umask 027
150 touch /var/log/cron
151 chgrp crontab /var/log/cron
152 chmod 660 /var/log/cron
153 %service crond restart "Cron Daemon"
154
155 %preun
156 if [ "$1" = "0" ]; then
157         %service crond stop
158         /sbin/chkconfig --del crond
159 fi
160
161 %postun
162 if [ "$1" = "0" ]; then
163         %groupremove crontab
164 fi
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
173 chmod a-x /etc/rc.d/init.d/crond
174
175 %triggerpostun -- vixie-cron
176 # Restore what triggerun removed
177 chmod 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.062808 seconds and 3 git commands to generate.