2010-09-27 17:40:15 +02:00
|
|
|
#
|
2010-10-23 23:49:09 +02:00
|
|
|
# spec file for package cronie (Version 1.4.5_git201010210619)
|
2010-09-27 17:40:15 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2010-10-23 23:49:09 +02:00
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
# norootforbuild
|
2010-10-23 23:49:09 +02:00
|
|
|
|
2010-10-23 23:48:38 +02:00
|
|
|
# 3 : we don't need to do something with /etc/sysconfig/cron for now
|
|
|
|
%define cron_configs \{/etc/init.d/cron,/etc/pam.d/crond,/etc/crontab,/etc/cron.deny,/etc/omc/srvinfo.d/cron.xml\}
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
Name: cronie
|
2010-10-23 23:49:09 +02:00
|
|
|
BuildRequires: audit-devel libselinux-devel pam-devel xz
|
2010-09-27 17:40:15 +02:00
|
|
|
Url: https://fedorahosted.org/cronie/
|
|
|
|
License: MIT and BSD and GPLv2
|
|
|
|
Group: System/Daemons
|
2010-10-23 23:48:38 +02:00
|
|
|
Recommends: smtp_daemon
|
2010-09-27 17:40:15 +02:00
|
|
|
Recommends: postfix
|
|
|
|
AutoReqProv: on
|
2010-10-23 23:48:38 +02:00
|
|
|
PreReq: permissions %fillup_prereq %insserv_prereq cron
|
|
|
|
Version: 1.4.5_git201010210619
|
2010-09-27 17:40:15 +02:00
|
|
|
Release: 1
|
2010-10-23 23:49:09 +02:00
|
|
|
%{expand: %%define cronie_version %version}
|
2010-09-27 17:40:15 +02:00
|
|
|
Summary: Cron Daemon
|
2010-10-23 23:48:38 +02:00
|
|
|
Source0: %name-%version.tar.xz
|
2010-09-27 17:40:15 +02:00
|
|
|
Source1: cron.init
|
|
|
|
Source2: run-crons
|
|
|
|
Source3: sample.root
|
|
|
|
Source4: deny.sample
|
|
|
|
Source5: cron.xml
|
|
|
|
Source6: cronie-rpmlintrc
|
2010-10-23 23:48:38 +02:00
|
|
|
Source7: cron_to_cronie.README
|
2010-09-27 17:40:15 +02:00
|
|
|
# PATCH-FEATURE-OPENSUSE cronie-pam_config.diff added pam config file from old cron
|
|
|
|
Patch3: %name-pam_config.diff
|
|
|
|
# openSUSE set NHEADER_LINES to 3 - old openSUSE cron put three lines of comments
|
|
|
|
# in top of crontab file, so we want to hide this junk comments if user edit
|
|
|
|
# crontab file with crontab -e command, patch grabbed from old openSUSE cron
|
|
|
|
Patch4: %name-nheader_lines.diff
|
|
|
|
# we use cron.pid instead of crond.pid
|
|
|
|
Patch5: %name-crond_pid.diff
|
2010-10-23 23:48:38 +02:00
|
|
|
Conflicts: cron <= 4.1
|
|
|
|
# When finish update protection of sles11 we could uncomment line bellow and drop all
|
|
|
|
# ugly hacks with subpackage cron needed for proper update proces
|
|
|
|
# Obsoletes: cron <=4.x
|
2010-09-27 17:40:15 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
|
|
|
cron automatically starts programs at specific times. Add new entries
|
|
|
|
with "crontab -e". (See "man 5 crontab" and "man 1 crontab" for
|
|
|
|
documentation.)
|
|
|
|
|
|
|
|
Under /etc, find the directories cron.hourly, cron.daily, cron.weekly,
|
|
|
|
and cron.monthly. Scripts and programs that are located there are
|
|
|
|
started automatically.
|
|
|
|
|
2010-10-23 23:48:38 +02:00
|
|
|
%package -n cron
|
2010-10-23 23:49:09 +02:00
|
|
|
License: MIT and BSD and GPLv2
|
|
|
|
Version: 4.2
|
|
|
|
Release: 1
|
|
|
|
Summary: Auxiliary package
|
|
|
|
Group: System/Daemons
|
|
|
|
Requires: %{name} = %{cronie_version}-%{release}
|
2010-10-23 23:48:38 +02:00
|
|
|
|
|
|
|
%description -n cron
|
|
|
|
Auxiliary package, needed for proper update from vixie-cron 4.1 to cronie 1.4.4
|
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%package anacron
|
|
|
|
License: MIT and BSD and GPLv2
|
|
|
|
Summary: Utility for running regular jobs
|
|
|
|
Group: System Environment/Base
|
2010-10-25 13:09:07 +02:00
|
|
|
Requires: %{name} = %{cronie_version}
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%description anacron
|
|
|
|
Anacron becames part of cronie. Anacron is used only for running regular jobs.
|
|
|
|
The default settings execute regular jobs by anacron, however this could be
|
|
|
|
overloaded in settings.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
%patch3 -p1
|
2010-10-23 23:48:38 +02:00
|
|
|
%patch4
|
2010-09-27 17:40:15 +02:00
|
|
|
%patch5 -p1
|
2010-10-23 23:48:38 +02:00
|
|
|
cp %{S:7} ./cron_to_cronie.README
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
autoreconf -fiv
|
|
|
|
# fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked
|
|
|
|
CFLAGS="$RPM_OPT_FLAGS -DCRON_VERSION=\\\"%{version}\\\""
|
|
|
|
%configure --with-audit --enable-anacron --with-pam --with-selinux --with-inotify --enable-pie SPOOL_DIR="/var/spool/cron/tabs"
|
|
|
|
%{__make} %{?jobs:-j%jobs}
|
|
|
|
|
|
|
|
%install
|
|
|
|
%makeinstall
|
|
|
|
%{__mkdir_p} -v %{buildroot}%{_localstatedir}/spool/cron/{tabs,lastrun}
|
|
|
|
%{__mkdir_p} -v %{buildroot}%{_sysconfdir}/cron.{d,hourly,daily,weekly,monthly}
|
|
|
|
%{__install} -v -m 600 %{SOURCE3} %{buildroot}/etc/crontab
|
|
|
|
%{__install} -v -m 600 %{SOURCE4} %{buildroot}/etc/cron.deny
|
|
|
|
%{__install} -v -d %{buildroot}/usr/lib/cron
|
|
|
|
%{__install} -v %{SOURCE2} %{buildroot}/usr/lib/cron
|
|
|
|
%{__install} -v -d %{buildroot}%{_sysconfdir}/init.d/
|
|
|
|
%{__install} -v -m744 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/cron
|
|
|
|
%{__ln_s} -f ../../etc/init.d/cron %{buildroot}/usr/sbin/rccron
|
|
|
|
%{__install} -m 644 contrib/anacrontab $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab
|
|
|
|
%{__install} -c -m755 contrib/0anacron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/0anacron
|
|
|
|
%{__mkdir_p} $RPM_BUILD_ROOT/var/spool/anacron
|
|
|
|
%{__mv} %{buildroot}%{_sbindir}/crond %{buildroot}%{_sbindir}/cron
|
|
|
|
|
|
|
|
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.daily
|
|
|
|
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.weekly
|
|
|
|
touch $RPM_BUILD_ROOT/var/spool/anacron/cron.monthly
|
|
|
|
|
|
|
|
# service xml
|
|
|
|
%{__install} -v -d %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
|
|
|
%{__install} -v -m644 %{S:5} %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
|
|
|
|
2010-10-23 23:48:38 +02:00
|
|
|
%pre -n cron
|
|
|
|
# check if we are doing "ugly" update from old 4.1 vixie-cron
|
|
|
|
check_cron_mail_feature=`/usr/sbin/cron --help 2>&1 | /usr/bin/grep mail`
|
|
|
|
# vixie-cron 4.1 doesn't contain mail fature
|
|
|
|
if [ -e /usr/sbin/cron -a "${check_cron_mail_feature}" == "" ]; then
|
|
|
|
# save configs for cronie post-install phase
|
|
|
|
touch /var/run/update_from_old_cron
|
|
|
|
echo $1
|
|
|
|
for conf in %{cron_configs}
|
|
|
|
do
|
|
|
|
%__mv "$conf" "$conf.bk" ||:
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
%pre
|
|
|
|
if [ -e /var/run/update_from_old_cron ]; then
|
|
|
|
# restore configs
|
|
|
|
for conf in %{cron_configs}
|
|
|
|
do
|
|
|
|
%__mv "$conf.bk" "$conf" ||:
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%post
|
2010-10-23 23:48:38 +02:00
|
|
|
# when we are doing rename then we pretend update with set 2
|
|
|
|
if [ -e /var/run/update_from_old_cron ]; then
|
|
|
|
set 2
|
|
|
|
%restart_on_update cron
|
|
|
|
# in %postun restart_on_update call try-restart but we don't have init script in this phase when
|
|
|
|
# we are doing "ugly" update, but don't panic, it produces only warning to stderr
|
|
|
|
echo "Please ignore message about missing init script(from postun) - when occurs, we will install init script later with cronie package"
|
|
|
|
%__mv /etc/init.d/cron /etc/init.d/cron.bk ||:
|
|
|
|
%__ln_s /bin/true /etc/init.d/cron
|
|
|
|
fi
|
|
|
|
%{fillup_and_insserv -y cron}
|
2010-09-27 17:40:15 +02:00
|
|
|
%run_permissions
|
|
|
|
%verifyscript
|
|
|
|
%verify_permissions -e /etc/crontab -e /usr/bin/crontab
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%stop_on_removal cron
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%restart_on_update cron
|
2010-10-23 23:48:38 +02:00
|
|
|
%insserv_cleanup
|
|
|
|
|
|
|
|
%posttrans
|
|
|
|
if [ -e /var/run/update_from_old_cron ]; then
|
|
|
|
%{__rm} /var/run/update_from_old_cron ||:
|
|
|
|
%__mv /etc/init.d/cron.bk /etc/init.d/cron ||:
|
|
|
|
fi
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%post anacron
|
|
|
|
[ -e /var/spool/anacron/cron.daily ] || touch /var/spool/anacron/cron.daily
|
|
|
|
[ -e /var/spool/anacron/cron.weekly ] || touch /var/spool/anacron/cron.weekly
|
|
|
|
[ -e /var/spool/anacron/cron.monthly ] || touch /var/spool/anacron/cron.monthly
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc AUTHORS COPYING INSTALL README ChangeLog
|
|
|
|
%dir %attr(700,root,root) /var/spool/cron
|
|
|
|
%dir %attr(700,root,root) /var/spool/cron/tabs
|
|
|
|
%dir /var/spool/cron/lastrun
|
|
|
|
%config /etc/init.d/cron
|
|
|
|
%config /etc/pam.d/crond
|
|
|
|
%verify(not mode) %config(noreplace) /etc/crontab
|
|
|
|
%config(noreplace) /etc/cron.deny
|
|
|
|
%{_mandir}/man1/crontab.1.gz
|
|
|
|
%{_mandir}/man5/crontab.5.gz
|
|
|
|
%{_mandir}/man8/cron.8.gz
|
|
|
|
%{_mandir}/man8/crond.8.gz
|
|
|
|
%verify(not mode) %attr (4750,root,trusted) /usr/bin/crontab
|
|
|
|
%attr (755,root,root) %{_sbindir}/cron
|
|
|
|
%{_sbindir}/rccron
|
|
|
|
/usr/lib/cron
|
|
|
|
%config %{_sysconfdir}/omc/srvinfo.d/cron.xml
|
|
|
|
%dir %{_sysconfdir}/omc/srvinfo.d/
|
|
|
|
%dir %{_sysconfdir}/omc/
|
|
|
|
|
|
|
|
%files anacron
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_sbindir}/anacron
|
|
|
|
%attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron
|
|
|
|
%config(noreplace) %{_sysconfdir}/anacrontab
|
|
|
|
%dir /var/spool/anacron
|
|
|
|
%ghost %verify(not md5 size mtime) /var/spool/anacron/cron.daily
|
|
|
|
%ghost %verify(not md5 size mtime) /var/spool/anacron/cron.weekly
|
|
|
|
%ghost %verify(not md5 size mtime) /var/spool/anacron/cron.monthly
|
|
|
|
%{_mandir}/man5/anacrontab.*
|
|
|
|
%{_mandir}/man8/anacron.*
|
|
|
|
|
2010-10-23 23:48:38 +02:00
|
|
|
%files -n cron
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc cron_to_cronie.README
|
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%changelog
|