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
|
|
|
#
|
2024-01-11 18:56:06 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
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.
|
|
|
|
|
2019-08-20 10:34:31 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-09-27 17:40:15 +02:00
|
|
|
#
|
2012-01-20 10:56:05 +01:00
|
|
|
|
|
|
|
|
2021-03-12 23:08:57 +01:00
|
|
|
%define cron_configs %{_sysconfdir}/pam.d/crond %{_sysconfdir}/crontab %{_sysconfdir}/cron.deny
|
2017-11-24 11:21:12 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
2021-03-12 23:08:57 +01:00
|
|
|
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
2017-11-24 11:21:12 +01:00
|
|
|
%endif
|
2010-09-27 17:40:15 +02:00
|
|
|
Name: cronie
|
2023-11-17 11:51:38 +01:00
|
|
|
Version: 1.7.0
|
2011-11-30 14:10:32 +01:00
|
|
|
Release: 0
|
2010-09-27 17:40:15 +02:00
|
|
|
Summary: Cron Daemon
|
2018-09-21 11:56:34 +02:00
|
|
|
License: BSD-3-Clause AND GPL-2.0-only AND MIT
|
2012-04-11 10:58:20 +02:00
|
|
|
Group: System/Daemons
|
2019-12-05 12:20:19 +01:00
|
|
|
URL: https://github.com/cronie-crond/%{name}
|
2018-09-21 11:56:34 +02:00
|
|
|
Source0: https://github.com/cronie-crond/%{name}/archive/%{name}-%{version}.tar.gz
|
2010-09-27 17:40:15 +02:00
|
|
|
Source2: run-crons
|
|
|
|
Source3: sample.root
|
|
|
|
Source4: deny.sample
|
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
|
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
|
2023-04-05 14:48:36 +02:00
|
|
|
# PATCH-FEATURE-OPENSUSE user common-session-nonlogin
|
|
|
|
Patch14: cronie-pam_config-nonlogin.diff
|
2024-01-11 18:56:06 +01:00
|
|
|
# PATCH-FIX-UPSTREAM danilo.spinella@suse.com bsc#1218377
|
|
|
|
Patch15: test-for-etc-default-anacron.patch
|
2024-01-22 16:44:30 +01:00
|
|
|
# PATCH-FIX-UPSTREAM jsegitz@suse.de https://github.com/cronie-crond/cronie/pull/172
|
|
|
|
Patch16: safe-backup-permissions.patch
|
2014-09-11 16:22:49 +02:00
|
|
|
BuildRequires: audit-devel
|
2018-09-21 11:56:34 +02:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2014-09-11 16:22:49 +02:00
|
|
|
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)
|
2021-03-12 23:08:57 +01:00
|
|
|
Requires: mail
|
2014-09-11 16:22:49 +02:00
|
|
|
Requires(post): %fillup_prereq
|
2021-08-30 09:31:06 +02:00
|
|
|
Requires(post): debianutils
|
2021-09-15 14:19:01 +02:00
|
|
|
Requires(post): permissions
|
2015-06-20 14:01:49 +02:00
|
|
|
Requires(pre): cron
|
2017-11-30 13:50:00 +01:00
|
|
|
Suggests: mailx
|
2015-06-20 14:01:49 +02:00
|
|
|
Conflicts: cron <= 4.1
|
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}}
|
2021-03-12 23:08:57 +01:00
|
|
|
%if 0%{?suse_version} >= 1330
|
|
|
|
Requires(pre): group(trusted)
|
|
|
|
%endif
|
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}
|
2019-08-20 10:34:31 +02:00
|
|
|
Requires(post): permissions
|
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
|
2019-08-20 10:34:31 +02:00
|
|
|
%setup -q -n %{name}-%{name}-%{cronie_version}
|
2010-09-27 17:40:15 +02:00
|
|
|
%patch3 -p1
|
2010-10-23 23:48:38 +02:00
|
|
|
%patch4
|
2010-09-27 17:40:15 +02:00
|
|
|
%patch5 -p1
|
2014-09-11 16:22:49 +02:00
|
|
|
cp %{SOURCE7} ./cron_to_cronie.README
|
2014-09-22 15:11:11 +02:00
|
|
|
%patch13 -p1
|
2023-04-05 14:48:36 +02:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%patch14 -p1
|
|
|
|
%endif
|
2024-01-11 18:56:06 +01:00
|
|
|
%patch15 -p1
|
2024-01-22 16:44:30 +01:00
|
|
|
%patch16 -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"
|
2018-09-21 11:56:34 +02:00
|
|
|
autoreconf -f -i
|
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"
|
2021-03-12 23:08:57 +01:00
|
|
|
%make_build
|
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
|
2017-11-24 11:21:12 +01:00
|
|
|
mkdir -p %{buildroot}%{_fillupdir}
|
|
|
|
cp %{SOURCE9} %{buildroot}%{_fillupdir}/
|
2014-09-11 16:22:49 +02:00
|
|
|
|
2019-08-20 10:34:31 +02:00
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/cron.d
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/cron.daily
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/cron.weekly
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/cron.monthly
|
|
|
|
|
2014-09-11 16:22:49 +02:00
|
|
|
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
|
|
|
|
2022-12-13 10:23:40 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
2022-12-23 11:21:57 +01:00
|
|
|
mkdir -p %{buildroot}%{_pam_vendordir}
|
|
|
|
mv %{buildroot}%{_sysconfdir}/pam.d/crond %{buildroot}%{_pam_vendordir}/
|
2022-12-13 10:23:40 +01:00
|
|
|
%endif
|
2010-10-23 23:48:38 +02:00
|
|
|
|
|
|
|
%pre
|
2022-12-13 10:23:40 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
# Prepare for migration to /usr/etc; save any old .rpmsave
|
|
|
|
for i in pam.d/crond ; do
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
|
|
|
|
done
|
|
|
|
%endif
|
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
|
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
|
|
|
|
2022-12-13 10:23:40 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%posttrans
|
|
|
|
# Migration to /usr/etc, restore just created .rpmsave
|
|
|
|
for i in pam.d/crond ; do
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
|
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
|
|
|
|
2019-08-20 10:34:31 +02:00
|
|
|
%verifyscript -n cron
|
2021-03-12 23:08:57 +01:00
|
|
|
%verify_permissions -e %{_sysconfdir}/cron.d/
|
|
|
|
%verify_permissions -e %{_sysconfdir}/cron.daily/
|
|
|
|
%verify_permissions -e %{_sysconfdir}/cron.hourly/
|
|
|
|
%verify_permissions -e %{_sysconfdir}/cron.monthly/
|
|
|
|
%verify_permissions -e %{_sysconfdir}/cron.weekly/
|
2019-08-20 10:34:31 +02:00
|
|
|
|
|
|
|
%post -n cron
|
2021-03-12 23:08:57 +01:00
|
|
|
%set_permissions %{_sysconfdir}/cron.d/
|
|
|
|
%set_permissions %{_sysconfdir}/cron.daily/
|
|
|
|
%set_permissions %{_sysconfdir}/cron.hourly/
|
|
|
|
%set_permissions %{_sysconfdir}/cron.monthly/
|
|
|
|
%set_permissions %{_sysconfdir}/cron.weekly/
|
2019-08-20 10:34:31 +02:00
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%files
|
2021-03-12 23:08:57 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc AUTHORS 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
|
2022-12-13 10:23:40 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
2022-12-23 11:21:57 +01:00
|
|
|
%{_pam_vendordir}/crond
|
2022-12-13 10:23:40 +01:00
|
|
|
%else
|
2014-09-11 16:22:49 +02:00
|
|
|
%config %{_sysconfdir}/pam.d/crond
|
2022-12-13 10:23:40 +01:00
|
|
|
%endif
|
2014-09-11 16:22:49 +02:00
|
|
|
%verify(not mode) %config(noreplace) %{_sysconfdir}/crontab
|
|
|
|
%config(noreplace) %{_sysconfdir}/cron.deny
|
2021-03-12 23:08:57 +01: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}
|
|
|
|
%{_mandir}/man1/cronnext.1%{?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
|
2018-09-21 11:56:34 +02:00
|
|
|
%attr (755,root,root) %{_bindir}/cronnext
|
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
|
2017-11-24 11:21:12 +01:00
|
|
|
%{_fillupdir}/sysconfig.cron
|
2010-09-27 17:40:15 +02:00
|
|
|
|
|
|
|
%files anacron
|
|
|
|
%{_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
|
2021-03-12 23:08:57 +01: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
|
|
|
|
%doc cron_to_cronie.README
|
2019-08-20 10:34:31 +02:00
|
|
|
%dir %attr(755,root,root) %{_sysconfdir}/cron.d
|
|
|
|
%dir %attr(755,root,root) %{_sysconfdir}/cron.hourly
|
|
|
|
%dir %attr(755,root,root) %{_sysconfdir}/cron.daily
|
|
|
|
%dir %attr(755,root,root) %{_sysconfdir}/cron.weekly
|
|
|
|
%dir %attr(755,root,root) %{_sysconfdir}/cron.monthly
|
2010-10-23 23:48:38 +02:00
|
|
|
|
2010-09-27 17:40:15 +02:00
|
|
|
%changelog
|