2010-09-27 17:40:15 +02:00
|
|
|
#
|
2011-02-24 14:57:01 +01:00
|
|
|
# spec file for package cronie
|
2010-09-27 17:40:15 +02:00
|
|
|
#
|
2017-03-27 16:10:22 +02:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-09-27 17:40:15 +02:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
2012-01-20 10:56:05 +01:00
|
|
|
|
|
|
|
|
2016-10-07 15:08:45 +02:00
|
|
|
%define cron_configs %{_sysconfdir}/pam.d/crond %{_sysconfdir}/crontab %{_sysconfdir}/cron.deny
|
2010-09-27 17:40:15 +02:00
|
|
|
Name: cronie
|
2017-03-28 14:48:09 +02:00
|
|
|
Version: 1.5.1
|
2011-11-30 14:10:32 +01:00
|
|
|
Release: 0
|
2010-09-27 17:40:15 +02:00
|
|
|
Summary: Cron Daemon
|
2012-04-11 10:58:20 +02:00
|
|
|
License: BSD-3-Clause and GPL-2.0 and MIT
|
|
|
|
Group: System/Daemons
|
2014-09-11 16:22:49 +02:00
|
|
|
Url: https://fedorahosted.org/cronie/
|
|
|
|
Source0: https://fedorahosted.org/releases/c/r/%{name}/%{name}-%{version}.tar.gz
|
2010-09-27 17:40:15 +02:00
|
|
|
Source2: run-crons
|
|
|
|
Source3: sample.root
|
|
|
|
Source4: deny.sample
|
|
|
|
Source6: cronie-rpmlintrc
|
2010-10-23 23:48:38 +02:00
|
|
|
Source7: cron_to_cronie.README
|
2010-10-27 14:17:08 +02:00
|
|
|
Source8: cron.service
|
2014-09-11 16:22:49 +02:00
|
|
|
Source9: sysconfig.cron
|
2010-09-27 17:40:15 +02:00
|
|
|
# PATCH-FEATURE-OPENSUSE cronie-pam_config.diff added pam config file from old cron
|
2017-03-28 14:48:09 +02:00
|
|
|
Patch3: cronie-pam_config.diff
|
2014-09-11 16:22:49 +02:00
|
|
|
# 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
|
2010-09-27 17:40:15 +02:00
|
|
|
# crontab file with crontab -e command, patch grabbed from old openSUSE cron
|
2017-03-28 14:48:09 +02:00
|
|
|
Patch4: cronie-nheader_lines.diff
|
2014-09-11 16:22:49 +02:00
|
|
|
# we use cron.pid instead of crond.pid
|
2017-03-28 14:48:09 +02:00
|
|
|
Patch5: cronie-crond_pid.diff
|
2011-06-06 20:21:17 +02:00
|
|
|
# PATCH-FIX-UPSTREAM mention logging disabling for a command in man
|
|
|
|
Patch7: cronie-1.4.7-disable_logging.patch
|
2011-07-12 11:28:42 +02:00
|
|
|
# PATCH-FIX-UPSTREAM use run-crons instead of run-parts for anacron (bnc#689494)
|
|
|
|
Patch8: cronie-anacron-1.4.7-run-crons.patch
|
2012-08-26 10:00:29 +02:00
|
|
|
Patch10: cronie-nofork-nopid.patch
|
2013-09-12 19:29:26 +02:00
|
|
|
Patch12: cronie-piddir.patch
|
2014-09-22 15:11:11 +02:00
|
|
|
# PATCH-FIX-SUSE the first occurance of "/etc/anacrontab" was replaced by "/etc/crontab"
|
2015-06-20 14:01:49 +02:00
|
|
|
# in manpage file because the /etc/crontab is still used in SUSE.
|
2014-09-22 15:11:11 +02:00
|
|
|
Patch13: fix-manpage-replace-anacrontab-with-crontab.patch
|
2014-09-11 16:22:49 +02:00
|
|
|
BuildRequires: audit-devel
|
|
|
|
BuildRequires: libselinux-devel
|
|
|
|
BuildRequires: pam-devel
|
2017-03-27 16:10:22 +02:00
|
|
|
BuildRequires: pkgconfig
|
2014-09-11 16:22:49 +02:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
Requires(post): %fillup_prereq
|
2015-06-20 14:01:49 +02:00
|
|
|
Requires(post): permissions
|
|
|
|
Requires(pre): cron
|
2014-09-11 16:22:49 +02:00
|
|
|
Recommends: smtp_daemon
|
|
|
|
Suggests: postfix
|
2015-06-20 14:01:49 +02:00
|
|
|
Conflicts: cron <= 4.1
|
2010-09-27 17:40:15 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2014-09-11 16:22:49 +02:00
|
|
|
%{?systemd_requires}
|
2015-06-23 14:23:26 +02:00
|
|
|
# This is needed as cron subpkg has its own version
|
2014-09-11 16:22:49 +02:00
|
|
|
%{expand: %%define cronie_version %{version}}
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%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
|
|
|
Version: 4.2
|
2011-12-02 20:19:51 +01:00
|
|
|
Release: 0
|
2010-10-23 23:49:09 +02:00
|
|
|
Summary: Auxiliary package
|
2012-04-11 10:58:20 +02:00
|
|
|
Group: System/Daemons
|
2010-10-23 23:49:09 +02:00
|
|
|
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
|
|
|
|
Summary: Utility for running regular jobs
|
2010-11-08 14:16:40 +01:00
|
|
|
Group: System/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
|
2011-06-06 20:21:17 +02:00
|
|
|
%patch7 -p1
|
2011-07-12 11:28:42 +02:00
|
|
|
%patch8 -p1
|
2014-09-11 16:22:49 +02:00
|
|
|
cp %{SOURCE7} ./cron_to_cronie.README
|
2012-08-26 10:00:29 +02:00
|
|
|
%patch10
|
2013-09-12 19:29:26 +02:00
|
|
|
%patch12 -p1
|
2014-09-22 15:11:11 +02:00
|
|
|
%patch13 -p1
|
2014-09-11 16:22:49 +02:00
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%build
|
|
|
|
# fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked
|
2014-09-11 16:22:49 +02:00
|
|
|
export CFLAGS="%{optflags} -DCRON_VERSION=\\\"%{version}\\\""
|
2010-11-09 20:11:56 +01:00
|
|
|
export LDFLAGS="-Wl,-z,relro,-z,now,-z,defs"
|
2014-09-11 16:22:49 +02:00
|
|
|
%configure \
|
|
|
|
--with-audit \
|
|
|
|
--enable-anacron \
|
|
|
|
--with-pam \
|
|
|
|
--with-selinux \
|
|
|
|
--with-inotify \
|
|
|
|
--enable-pie \
|
|
|
|
SPOOL_DIR="%{_localstatedir}/spool/cron/tabs"
|
|
|
|
make %{?_smp_mflags}
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%install
|
2017-03-27 16:10:22 +02:00
|
|
|
%make_install
|
2014-09-11 16:22:49 +02:00
|
|
|
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}%{_sysconfdir}/crontab
|
|
|
|
install -v -m 600 %{SOURCE4} %{buildroot}%{_sysconfdir}/cron.deny
|
|
|
|
install -v -d %{buildroot}%{_libexecdir}/cron
|
|
|
|
install -v %{SOURCE2} %{buildroot}%{_libexecdir}/cron
|
|
|
|
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rccron
|
|
|
|
install -v -d %{buildroot}/%{_unitdir}
|
|
|
|
install -v -m 644 %{SOURCE8} %{buildroot}/%{_unitdir}
|
|
|
|
install -m 644 contrib/anacrontab %{buildroot}%{_sysconfdir}/anacrontab
|
|
|
|
install -c -m755 contrib/0anacron %{buildroot}%{_sysconfdir}/cron.hourly/0anacron
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/spool/anacron
|
|
|
|
mv %{buildroot}%{_sbindir}/crond %{buildroot}%{_sbindir}/cron
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
|
|
|
|
cp %{SOURCE9} %{buildroot}%{_localstatedir}/adm/fillup-templates/
|
|
|
|
|
|
|
|
touch %{buildroot}%{_localstatedir}/spool/anacron/cron.daily
|
|
|
|
touch %{buildroot}%{_localstatedir}/spool/anacron/cron.weekly
|
|
|
|
touch %{buildroot}%{_localstatedir}/spool/anacron/cron.monthly
|
2010-09-27 17:40:15 +02:00
|
|
|
|
2010-10-23 23:48:38 +02:00
|
|
|
%pre -n cron
|
2015-06-22 16:48:19 +02:00
|
|
|
# Check if we are doing update from 4.1 vixie-cron.
|
|
|
|
# The -h does report garbage on vixie cron.
|
|
|
|
check_cron_mail_feature=`%{_sbindir}/cron -h 2>&1 | %{_bindir}/grep mail`
|
2014-11-10 11:17:13 +01:00
|
|
|
if [ -e %{_sbindir}/cron -a -z "${check_cron_mail_feature}" ]; then
|
2014-09-11 16:22:49 +02:00
|
|
|
touch %{_localstatedir}/run/update_from_old_cron
|
2015-06-22 16:48:19 +02:00
|
|
|
for conf in %{cron_configs} ; do
|
|
|
|
cp "$conf" "$conf.rpmbk"
|
2010-10-23 23:48:38 +02:00
|
|
|
done
|
|
|
|
fi
|
2015-06-22 16:48:19 +02:00
|
|
|
exit 0
|
2010-10-23 23:48:38 +02:00
|
|
|
|
|
|
|
%pre
|
2011-09-29 11:35:07 +02:00
|
|
|
%service_add_pre cron.service
|
2010-10-23 23:48:38 +02:00
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%post
|
2015-06-22 16:48:19 +02:00
|
|
|
# Move the old cron configurations back if we were updating
|
|
|
|
if [ -e %{_localstatedir}/run/update_from_old_cron ]; then
|
|
|
|
for conf in %{cron_configs} ; do
|
|
|
|
mv "$conf.rpmbk" "$conf"
|
|
|
|
done
|
|
|
|
rm %{_localstatedir}/run/update_from_old_cron
|
|
|
|
fi
|
2014-09-11 16:22:49 +02:00
|
|
|
%set_permissions %{_sysconfdir}/crontab %{_bindir}/crontab
|
|
|
|
%{fillup_only -n cron}
|
2011-10-10 15:47:55 +02:00
|
|
|
%service_add_post cron.service
|
2015-06-22 16:48:19 +02:00
|
|
|
exit 0
|
2011-10-10 15:47:55 +02:00
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%verifyscript
|
2014-09-11 16:22:49 +02:00
|
|
|
%verify_permissions -e %{_sysconfdir}/crontab -e %{_bindir}/crontab
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%preun
|
2011-09-29 11:35:07 +02:00
|
|
|
%service_del_preun cron.service
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%postun
|
2011-09-29 11:35:07 +02:00
|
|
|
%service_del_postun cron.service
|
2010-10-23 23:48:38 +02:00
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%post anacron
|
2014-09-11 16:22:49 +02:00
|
|
|
[ -e %{_localstatedir}/spool/anacron/cron.daily ] || touch %{_localstatedir}/spool/anacron/cron.daily
|
|
|
|
[ -e %{_localstatedir}/spool/anacron/cron.weekly ] || touch %{_localstatedir}/spool/anacron/cron.weekly
|
|
|
|
[ -e %{_localstatedir}/spool/anacron/cron.monthly ] || touch %{_localstatedir}/spool/anacron/cron.monthly
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2011-11-30 17:23:05 +01:00
|
|
|
%doc AUTHORS COPYING README ChangeLog
|
2014-09-11 16:22:49 +02:00
|
|
|
%dir %attr(700,root,root) %{_localstatedir}/spool/cron
|
|
|
|
%dir %attr(700,root,root) %{_localstatedir}/spool/cron/tabs
|
|
|
|
%dir %{_localstatedir}/spool/cron/lastrun
|
|
|
|
%config %{_sysconfdir}/pam.d/crond
|
|
|
|
%verify(not mode) %config(noreplace) %{_sysconfdir}/crontab
|
|
|
|
%config(noreplace) %{_sysconfdir}/cron.deny
|
2017-03-27 16:10:22 +02:00
|
|
|
%{_mandir}/man1/crontab.1%{ext_man}
|
|
|
|
%{_mandir}/man5/crontab.5%{ext_man}
|
|
|
|
%{_mandir}/man8/cron.8%{ext_man}
|
|
|
|
%{_mandir}/man8/crond.8%{ext_man}
|
2014-09-11 16:22:49 +02:00
|
|
|
%verify(not mode) %attr (4750,root,trusted) %{_bindir}/crontab
|
2010-09-27 17:40:15 +02:00
|
|
|
%attr (755,root,root) %{_sbindir}/cron
|
2014-01-25 07:47:45 +01:00
|
|
|
%{_sbindir}/rccron
|
2014-09-11 16:22:49 +02:00
|
|
|
%{_libexecdir}/cron
|
2011-09-29 11:35:07 +02:00
|
|
|
%{_unitdir}/cron.service
|
2014-09-11 16:22:49 +02:00
|
|
|
%{_localstatedir}/adm/fillup-templates/sysconfig.cron
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%files anacron
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_sbindir}/anacron
|
|
|
|
%attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron
|
|
|
|
%config(noreplace) %{_sysconfdir}/anacrontab
|
2014-09-11 16:22:49 +02:00
|
|
|
%dir %{_localstatedir}/spool/anacron
|
|
|
|
%ghost %verify(not md5 size mtime) %{_localstatedir}/spool/anacron/cron.daily
|
|
|
|
%ghost %verify(not md5 size mtime) %{_localstatedir}/spool/anacron/cron.weekly
|
|
|
|
%ghost %verify(not md5 size mtime) %{_localstatedir}/spool/anacron/cron.monthly
|
2017-03-28 14:48:09 +02:00
|
|
|
%{_mandir}/man5/anacrontab.5%{ext_man}
|
|
|
|
%{_mandir}/man8/anacron.8%{ext_man}
|
2010-09-27 17:40:15 +02:00
|
|
|
|
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
|