cronie-vl.spec 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. %bcond_with selinux
  2. %bcond_without pam
  3. %bcond_without audit
  4. %bcond_without inotify
  5. %define ver 1.4.11
  6. %define rel 2
  7. Summary: Cron daemon for executing programs at set times
  8. Name: cronie
  9. Version: %{ver}
  10. Release: %{rel}%{?_dist_release}
  11. License: MIT and BSD and ISC and GPLv2+
  12. Group: System Environment/Base
  13. URL: https://fedorahosted.org/cronie
  14. Source0: https://fedorahosted.org/releases/c/r/cronie/%{name}-%{version}.tar.gz
  15. # from cronie 1.4.8 tarball
  16. Source1: cronie.init
  17. #Patch0: cronie-systemd.patch
  18. Patch1: cronie-1.4.11-fcntl_locking.patch
  19. Patch2: cronie-1.4.11-pamenv.patch
  20. Patch3: cronie-1.4.11-man-debug.patch
  21. Patch4: cronie-check-config-param.patch
  22. Requires: dailyjobs
  23. Conflicts: vixie-cron
  24. Vendor: Project Vine
  25. Distribution: Vine Linux
  26. Packager: iwaim
  27. %if %{with selinux}
  28. Requires: libselinux >= 2.0.64
  29. Buildrequires: libselinux-devel >= 2.0.64
  30. %endif
  31. %if %{with pam}
  32. Requires: pam >= 1.0.1
  33. Buildrequires: pam-devel >= 1.0.1
  34. %endif
  35. %if %{with audit}
  36. Buildrequires: audit-libs-devel >= 1.4.1
  37. %endif
  38. Requires(post): coreutils sed
  39. Requires(post): chkconfig
  40. Requires(preun): chkconfig
  41. %description
  42. Cronie contains the standard UNIX daemon crond that runs specified programs at
  43. scheduled times and related tools. It is a fork of the original vixie-cron and
  44. has security and configuration enhancements like the ability to use pam and
  45. SELinux.
  46. %package anacron
  47. Summary: Utility for running regular jobs
  48. Requires: crontabs
  49. Group: System Environment/Base
  50. Provides: dailyjobs
  51. Provides: anacron = 2.4
  52. Obsoletes: anacron <= 2.3
  53. Requires(post): coreutils
  54. Requires: %{name} = %{version}-%{release}
  55. %description anacron
  56. Anacron is part of cronie that is used for running jobs with regular
  57. periodicity which do not have exact time of day of execution.
  58. The default settings of anacron execute the daily, weekly, and monthly
  59. jobs, but anacron allows setting arbitrary periodicity of jobs.
  60. Using anacron allows running the periodic jobs even if the system is often
  61. powered off and it also allows randomizing the time of the job execution
  62. for better utilization of resources shared among multiple systems.
  63. %package noanacron
  64. Summary: Utility for running simple regular jobs in old cron style
  65. Group: System Environment/Base
  66. Provides: dailyjobs
  67. Requires: crontabs
  68. Requires: %{name} = %{version}-%{release}
  69. %description noanacron
  70. Old style of running {hourly,daily,weekly,monthly}.jobs without anacron. No
  71. extra features.
  72. %prep
  73. %setup -q
  74. #%patch0 -p1
  75. %patch1 -p1
  76. %patch2 -p1
  77. %patch3 -p1
  78. %patch4 -p1
  79. %build
  80. %configure \
  81. %if %{with pam}
  82. --with-pam \
  83. %endif
  84. %if %{with selinux}
  85. --with-selinux \
  86. %endif
  87. %if %{with audit}
  88. --with-audit \
  89. %endif
  90. %if %{with inotify}
  91. --with-inotify \
  92. %endif
  93. --enable-anacron \
  94. --enable-pie \
  95. --enable-relro
  96. make %{?_smp_mflags}
  97. %install
  98. make install DESTDIR=$RPM_BUILD_ROOT DESTMAN=$RPM_BUILD_ROOT%{_mandir}
  99. mkdir -pm700 $RPM_BUILD_ROOT%{_localstatedir}/spool/cron
  100. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
  101. mkdir -pm755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/
  102. %if ! %{with pam}
  103. rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/crond
  104. %endif
  105. install -m 600 crond.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/crond
  106. touch $RPM_BUILD_ROOT%{_sysconfdir}/cron.deny
  107. install -m 600 contrib/anacrontab $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab
  108. install -c -m755 contrib/0hourly $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/0hourly
  109. mkdir -pm 700 $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly
  110. install -c -m755 contrib/0anacron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/0anacron
  111. mkdir -p $RPM_BUILD_ROOT/var/spool/anacron
  112. touch $RPM_BUILD_ROOT/var/spool/anacron/cron.daily
  113. touch $RPM_BUILD_ROOT/var/spool/anacron/cron.weekly
  114. touch $RPM_BUILD_ROOT/var/spool/anacron/cron.monthly
  115. # noanacron package
  116. install -m 644 contrib/dailyjobs $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/dailyjobs
  117. # install initscript
  118. mkdir -p $RPM_BUILD_ROOT%{_initddir}
  119. install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/crond
  120. %post
  121. # run after an installation
  122. /sbin/chkconfig --add crond
  123. %post anacron
  124. [ -e /var/spool/anacron/cron.daily ] || touch /var/spool/anacron/cron.daily
  125. [ -e /var/spool/anacron/cron.weekly ] || touch /var/spool/anacron/cron.weekly
  126. [ -e /var/spool/anacron/cron.monthly ] || touch /var/spool/anacron/cron.monthly
  127. %preun
  128. # run before a package is removed
  129. if [ "$1" -eq 0 ]; then
  130. /sbin/service crond stop >/dev/null 2>&1
  131. /sbin/chkconfig --del crond
  132. fi
  133. %postun
  134. # run after a package is removed
  135. if [ "$1" -ge "1" ]; then
  136. /sbin/service crond condrestart >/dev/null 2>&1 || :
  137. fi
  138. %triggerpostun -- vixie-cron
  139. /sbin/chkconfig --add crond
  140. %files
  141. %doc AUTHORS COPYING INSTALL README ChangeLog
  142. %attr(755,root,root) %{_sbindir}/crond
  143. %attr(4755,root,root) %{_bindir}/crontab
  144. %{_mandir}/man8/crond.*
  145. %{_mandir}/man8/cron.*
  146. %{_mandir}/man5/crontab.*
  147. %{_mandir}/man1/crontab.*
  148. %dir %{_localstatedir}/spool/cron
  149. %dir %{_sysconfdir}/cron.d
  150. %if %{with pam}
  151. %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/crond
  152. %endif
  153. %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/crond
  154. %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/cron.deny
  155. %attr(0644,root,root) %{_sysconfdir}/cron.d/0hourly
  156. %attr(0755,root,root) %{_initddir}/crond
  157. %files anacron
  158. %{_sbindir}/anacron
  159. %attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron
  160. %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/anacrontab
  161. %dir /var/spool/anacron
  162. %ghost %verify(not md5 size mtime) /var/spool/anacron/cron.daily
  163. %ghost %verify(not md5 size mtime) /var/spool/anacron/cron.weekly
  164. %ghost %verify(not md5 size mtime) /var/spool/anacron/cron.monthly
  165. %{_mandir}/man5/anacrontab.*
  166. %{_mandir}/man8/anacron.*
  167. %files noanacron
  168. %attr(0644,root,root) %{_sysconfdir}/cron.d/dailyjobs
  169. %changelog
  170. * Thu Jun 26 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 1.4.11-2
  171. - run chkconfig for vixie-cron in triggerpostun script
  172. * Thu Jun 26 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 1.4.11-1
  173. - initial build for Vine Linux
  174. * Mon Jan 27 2014 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-11
  175. - now it's work even on ppc64, all checks working correctly
  176. - Related: rhbz#1031384
  177. * Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.4.11-10
  178. - Mass rebuild 2014-01-24
  179. * Wed Jan 22 2014 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-9
  180. - fix coverity warnings about dead code. Incorrect checking of values.
  181. - Related: rhbz#1031384
  182. * Mon Jan 20 2014 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-8
  183. - anacron do not execute jobs run from command line
  184. - Related: rhbz#1031384
  185. * Wed Jan 08 2014 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-7
  186. - anacron segfaults with certain config data
  187. - Resolves: rhbz#1031384
  188. * Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.4.11-6
  189. - Mass rebuild 2013-12-27
  190. * Tue Oct 15 2013 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-5
  191. - Cronie doesn't work when is executed as stand alone without systemd (for
  192. debuging issues)
  193. - Fix another permission, hopefully all now.
  194. - Resolves: rhbz#1012420, rhbz#1015567
  195. * Fri Sep 13 2013 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-4
  196. - fix permission on configuration files, same as rhbz#706979
  197. * Fri Aug 30 2013 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-3
  198. - 919290 systemd script use "KillMode=process"
  199. - Fcntl locking has different semantics than flock. Prefer flock.
  200. - 49225e172d156531ca142518d2638350752e373a
  201. - Pull PAM environment variables also from session modules.
  202. - c8e7d1b43c86a85441cb09cf7e08090f3ec1f384
  203. * Mon Jul 22 2013 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-2
  204. - scriptlets are not created correctly if systemd is not in BR 986698
  205. - remove sub-package sysvinit, which is not needed anymore
  206. - update license, anacron is under GPLv2+
  207. * Thu Jul 18 2013 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.11-1
  208. - new release 1.4.11 (contains previous bug fixes from 1.4.10-5)
  209. * Tue Jun 11 2013 Tomáš Mráz <tmraz@redhat.com> - 1.4.10-5
  210. - add support for RANDOM_DELAY - delaying job startups
  211. - pass some environment variables to processes (LANG, etc.) (#969761)
  212. - do not use putenv() with string literals (#971516)
  213. * Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.10-4
  214. - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
  215. * Wed Jan 2 2013 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.10-3
  216. - change configuration files to 644
  217. - change 6755 to 4755 for crontab binary
  218. * Tue Nov 27 2012 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.10-1
  219. - New release 1.4.10
  220. * Thu Nov 22 2012 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.9-1
  221. - New release 1.4.9
  222. * Wed Sep 05 2012 Václav Pavlín <vpavlin@redhat.com> - 1.4.8-13
  223. - Scriptlets replaced with new systemd macros (#850070)
  224. * Fri Jul 27 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.8-12
  225. - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
  226. * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.8-11
  227. - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
  228. * Wed Oct 26 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.8-10
  229. - Rebuilt for glibc bug#747377
  230. * Tue Oct 25 2011 Tomáš Mráz <tmraz@redhat.com> - 1.4.8-9
  231. - make crond run a little bit later in the boot process (#747759)
  232. * Mon Oct 17 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.8-8
  233. - change triggerun to fix 735802 during upgrade
  234. * Wed Jul 27 2011 Karsten Hopp <karsten@redhat.com> 1.4.8-7
  235. - rebuild again, ppc still had the broken rpm in the buildroots
  236. * Thu Jul 21 2011 Rex Dieter <rdieter@fedoraproject.org> 1.4.8-6
  237. - rebuild (broken rpm in buildroot)
  238. * Thu Jul 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.8-5
  239. - fix permission of init.d/crond
  240. * Thu Jun 30 2011 Tomáš Mráz <tmraz@redhat.com> - 1.4.8-4
  241. - drop the without systemd build condition
  242. - add the chkconfig readding trigger to the sysvinit subpackage
  243. * Wed Jun 29 2011 Tomáš Mráz <tmraz@redhat.com> - 1.4.8-3
  244. - start crond after auditd
  245. * Wed Jun 29 2011 Tomáš Mráz <tmraz@redhat.com> - 1.4.8-2
  246. - fix inotify support to not leak fds (#717505)
  247. * Tue Jun 28 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.8-1
  248. - update to 1.4.8
  249. - create sub-package sysvinit for initscript
  250. * Mon May 9 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.7-3
  251. - missing requirement on systemd-sysv for scriptlets
  252. * Thu May 05 2011 Tomáš Mráz <tmraz@redhat.com> - 1.4.7-2
  253. - use only systemd units with systemd
  254. - add trigger for restart on glibc, libselinux or pam upgrades (#699189)
  255. * Tue Mar 15 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.7-1
  256. - new release 1.4.7
  257. * Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.6-9
  258. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  259. * Mon Jan 17 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-8
  260. - enable crond even with systemctl
  261. * Thu Dec 16 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-7
  262. - 663193 rewritten selinux support
  263. * Wed Dec 15 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-6
  264. - apply selinux patch from dwalsh
  265. * Fri Dec 10 2010 Tomas Mraz <tmraz@redhat.com> - 1.4.6-5
  266. - do not lock jobs that fall out of allowed range - 661966
  267. * Thu Dec 02 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-4
  268. - fix post (thanks plautrba for review)
  269. * Tue Nov 30 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-3
  270. - systemd init script 617320
  271. * Tue Nov 30 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-2
  272. - fix typos in man pages
  273. * Fri Oct 22 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.6-1
  274. - update to 1.4.6
  275. * Fri Aug 13 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.5-4
  276. - 623908 fix fd leak in anacron, which caused denail of prelink
  277. and others
  278. * Mon Aug 9 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.5-2
  279. - remove sendmail from requirements. If it's not installed, it will
  280. log into (r)syslog.
  281. * Mon Aug 2 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.5-1
  282. - update to new release
  283. * Fri Feb 19 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.4-1
  284. - update to new release
  285. * Mon Feb 15 2010 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.3-3
  286. - 564894 FTBFS DSOLinking
  287. * Thu Nov 5 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.3-2
  288. - 533189 pam needs add a line and selinux needs defined one function
  289. * Fri Oct 30 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.3-1
  290. - 531963 and 532482 creating noanacron package
  291. * Mon Oct 19 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.2-2
  292. - 529632 service crond stop returns appropriate value
  293. * Mon Oct 12 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.2-1
  294. - new release
  295. * Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.4.1-3
  296. - rebuilt with new audit
  297. * Fri Aug 14 2009 Tomas Mraz <tmraz@redhat.com> - 1.4.1-2
  298. - create the anacron timestamps in correct post script
  299. * Fri Aug 14 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.4.1-1
  300. - update to 1.4.1
  301. - create and own /var/spool/anacron/cron.{daily,weekly,monthly} to
  302. remove false warning about non existent files
  303. - Resolves: 517398
  304. * Wed Aug 5 2009 Tomas Mraz <tmraz@redhat.com> - 1.4-4
  305. - 515762 move anacron provides and obsoletes to the anacron subpackage
  306. * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-3
  307. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  308. * Mon Jul 20 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.4-2
  309. - merge cronie and anacron in new release of cronie
  310. - obsolete/provide anacron in spec
  311. * Thu Jun 18 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.3-2
  312. - 506560 check return value of access
  313. * Mon Apr 27 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.3-1
  314. - new release
  315. * Fri Apr 24 2009 Marcela Mašláňová <mmaslano@redhat.com> - 1.2-8
  316. - 496973 close file descriptors after exec
  317. * Mon Mar 9 2009 Tomas Mraz <tmraz@redhat.com> - 1.2-7
  318. - rebuild
  319. * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-6
  320. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  321. * Tue Dec 23 2008 Marcela Mašláňová <mmaslano@redhat.com> - 1.2-5
  322. - 477100 NO_FOLLOW was removed, reload after change in symlinked
  323. crontab is needed, man updated.
  324. * Fri Oct 24 2008 Marcela Mašláňová <mmaslano@redhat.com> - 1.2-4
  325. - update init script
  326. * Thu Sep 25 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.2-3
  327. - add sendmail file into requirement, cause it's needed some MTA
  328. * Thu Sep 18 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.2-2
  329. - 462252 /etc/sysconfig/crond does not need to be executable
  330. * Thu Jun 26 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.2-1
  331. - update to 1.2
  332. * Tue Jun 17 2008 Tomas Mraz <tmraz@redhat.com> - 1.1-3
  333. - fix setting keycreate context
  334. - unify logging a bit
  335. - cleanup some warnings and fix a typo in TZ code
  336. - 450993 improve and fix inotify support
  337. * Wed Jun 4 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.1-2
  338. - 49864 upgrade/update problem. Syntax error in spec.
  339. * Wed May 28 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.1-1
  340. - release 1.1
  341. * Tue May 20 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.0-6
  342. - 446360 check for lock didn't call chkconfig
  343. * Tue Feb 12 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.0-5
  344. - upgrade from less than cronie-1.0-4 didn't add chkconfig
  345. * Wed Feb 6 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.0-4
  346. - 431366 after reboot wasn't cron in chkconfig
  347. * Tue Feb 5 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.0-3
  348. - 431366 trigger part => after update from vixie-cron on cronie will
  349. be daemon running.
  350. * Wed Jan 30 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.0-2
  351. - change the provides on higher version than obsoletes
  352. * Tue Jan 8 2008 Marcela Maslanova <mmaslano@redhat.com> - 1.0-1
  353. - packaging cronie
  354. - thank's for help with packaging to my reviewers