Accepting request 248612 from Base:System
1 OBS-URL: https://build.opensuse.org/request/show/248612 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cronie?expand=0&rev=55
This commit is contained in:
commit
3bb3e02e08
@ -1,3 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 11 13:59:08 UTC 2014 - kstreitova@suse.com
|
||||
|
||||
- clean up with spec-cleaner
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 11 13:51:44 UTC 2014 - kstreitova@suse.com
|
||||
|
||||
- fix dangling symlink on sbin/service
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 1 14:32:37 UTC 2014 - vcizek@suse.com
|
||||
|
||||
- add sysconfig.cron that used to be provided by aaa_base (bnc#860058)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 16 13:51:14 UTC 2014 - vdziewiecki@suse.com
|
||||
|
||||
|
146
cronie.spec
146
cronie.spec
@ -17,25 +17,15 @@
|
||||
|
||||
|
||||
# 3 : we don't need to do something with /etc/sysconfig/cron for now
|
||||
%define cron_configs \{/etc/pam.d/crond,/etc/crontab,/etc/cron.deny,/etc/omc/srvinfo.d/cron.xml\}
|
||||
|
||||
%define cron_configs \{%{_sysconfdir}/pam.d/crond,%{_sysconfdir}/crontab,%{_sysconfdir}/cron.deny,%{_sysconfdir}/omc/srvinfo.d/cron.xml\}
|
||||
Name: cronie
|
||||
BuildRequires: audit-devel
|
||||
BuildRequires: libselinux-devel
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
Url: https://fedorahosted.org/cronie/
|
||||
Recommends: smtp_daemon
|
||||
Suggests: postfix
|
||||
PreReq: permissions cron
|
||||
%{?systemd_requires}
|
||||
Version: 1.4.11
|
||||
Release: 0
|
||||
%{expand: %%define cronie_version %version}
|
||||
Summary: Cron Daemon
|
||||
License: BSD-3-Clause and GPL-2.0 and MIT
|
||||
Group: System/Daemons
|
||||
Source0: https://fedorahosted.org/releases/c/r/%name/%name-%version.tar.gz
|
||||
Url: https://fedorahosted.org/cronie/
|
||||
Source0: https://fedorahosted.org/releases/c/r/%{name}/%{name}-%{version}.tar.gz
|
||||
Source2: run-crons
|
||||
Source3: sample.root
|
||||
Source4: deny.sample
|
||||
@ -43,25 +33,37 @@ Source5: cron.xml
|
||||
Source6: cronie-rpmlintrc
|
||||
Source7: cron_to_cronie.README
|
||||
Source8: cron.service
|
||||
Source9: sysconfig.cron
|
||||
# PATCH-FEATURE-OPENSUSE cronie-pam_config.diff added pam config file from old cron
|
||||
Patch3: %name-pam_config.diff
|
||||
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
|
||||
Patch4: %{name}-nheader_lines.diff
|
||||
# we use cron.pid instead of crond.pid
|
||||
Patch5: %name-crond_pid.diff
|
||||
Patch5: %{name}-crond_pid.diff
|
||||
# PATCH-FIX-UPSTREAM mention logging disabling for a command in man
|
||||
Patch7: cronie-1.4.7-disable_logging.patch
|
||||
# PATCH-FIX-UPSTREAM use run-crons instead of run-parts for anacron (bnc#689494)
|
||||
Patch8: cronie-anacron-1.4.7-run-crons.patch
|
||||
Patch10: cronie-nofork-nopid.patch
|
||||
Patch12: cronie-piddir.patch
|
||||
Conflicts: cron <= 4.1
|
||||
BuildRequires: audit-devel
|
||||
BuildRequires: libselinux-devel
|
||||
BuildRequires: pam-devel
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
Requires(pre): cron
|
||||
Requires(post): permissions
|
||||
Requires(post): %fillup_prereq
|
||||
Recommends: smtp_daemon
|
||||
Suggests: postfix
|
||||
# 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
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%{?systemd_requires}
|
||||
%{expand: %%define cronie_version %{version}}
|
||||
Conflicts: cron <= 4.1
|
||||
|
||||
%description
|
||||
cron automatically starts programs at specific times. Add new entries
|
||||
@ -99,71 +101,82 @@ overloaded in settings.
|
||||
%patch5 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
cp %{S:7} ./cron_to_cronie.README
|
||||
cp %{SOURCE7} ./cron_to_cronie.README
|
||||
%patch10
|
||||
%patch12 -p1
|
||||
|
||||
%build
|
||||
# fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked
|
||||
export CFLAGS="$RPM_OPT_FLAGS -DCRON_VERSION=\\\"%{version}\\\""
|
||||
export CFLAGS="%{optflags} -DCRON_VERSION=\\\"%{version}\\\""
|
||||
export LDFLAGS="-Wl,-z,relro,-z,now,-z,defs"
|
||||
%configure --with-audit --enable-anacron --with-pam --with-selinux --with-inotify --enable-pie SPOOL_DIR="/var/spool/cron/tabs"
|
||||
%{__make} %{?_smp_mflags}
|
||||
%configure \
|
||||
--with-audit \
|
||||
--enable-anacron \
|
||||
--with-pam \
|
||||
--with-selinux \
|
||||
--with-inotify \
|
||||
--enable-pie \
|
||||
SPOOL_DIR="%{_localstatedir}/spool/cron/tabs"
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%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
|
||||
%{__ln_s} -f ../../sbin/service %{buildroot}/usr/sbin/rccron
|
||||
%{__install} -v -d %{buildroot}/%{_unitdir}
|
||||
%{__install} -v -m 644 %{SOURCE8} %{buildroot}/%{_unitdir}
|
||||
%{__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
|
||||
make DESTDIR=%{buildroot} install %{?_smp_mflags}
|
||||
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 $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
|
||||
touch %{buildroot}%{_localstatedir}/spool/anacron/cron.daily
|
||||
touch %{buildroot}%{_localstatedir}/spool/anacron/cron.weekly
|
||||
touch %{buildroot}%{_localstatedir}/spool/anacron/cron.monthly
|
||||
|
||||
# service xml
|
||||
%{__install} -v -d %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
||||
%{__install} -v -m644 %{S:5} %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
||||
install -v -d %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
||||
install -v -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
||||
|
||||
%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`
|
||||
check_cron_mail_feature=`%{_sbindir}/cron --help 2>&1 | %{_bindir}/grep mail`
|
||||
# vixie-cron 4.1 doesn't contain mail fature
|
||||
if [ -e /usr/sbin/cron -a "${check_cron_mail_feature}" == "" ]; then
|
||||
if [ -e %{_sbindir}/cron -a "${check_cron_mail_feature}" == "" ]; then
|
||||
# save configs for cronie post-install phase
|
||||
touch /var/run/update_from_old_cron
|
||||
touch %{_localstatedir}/run/update_from_old_cron
|
||||
echo $1
|
||||
for conf in %{cron_configs}
|
||||
for conf in %{cron_configs}
|
||||
do
|
||||
%__mv "$conf" "$conf.bk" ||:
|
||||
mv "$conf" "$conf.bk" ||:
|
||||
done
|
||||
fi
|
||||
|
||||
%pre
|
||||
if [ -e /var/run/update_from_old_cron ]; then
|
||||
if [ -e %{_localstatedir}/run/update_from_old_cron ]; then
|
||||
# restore configs
|
||||
for conf in %{cron_configs}
|
||||
do
|
||||
%__mv "$conf.bk" "$conf" ||:
|
||||
mv "$conf.bk" "$conf" ||:
|
||||
done
|
||||
fi
|
||||
%service_add_pre cron.service
|
||||
|
||||
%post
|
||||
# when we are doing rename then we pretend update with set 2
|
||||
%set_permissions /etc/crontab /usr/bin/crontab
|
||||
%set_permissions %{_sysconfdir}/crontab %{_bindir}/crontab
|
||||
%{fillup_only -n cron}
|
||||
%service_add_post cron.service
|
||||
|
||||
%verifyscript
|
||||
%verify_permissions -e /etc/crontab -e /usr/bin/crontab
|
||||
%verify_permissions -e %{_sysconfdir}/crontab -e %{_bindir}/crontab
|
||||
|
||||
%preun
|
||||
%service_del_preun cron.service
|
||||
@ -172,46 +185,47 @@ fi
|
||||
%service_del_postun cron.service
|
||||
|
||||
%posttrans
|
||||
if [ -e /var/run/update_from_old_cron ]; then
|
||||
%{__rm} /var/run/update_from_old_cron ||:
|
||||
if [ -e %{_localstatedir}/run/update_from_old_cron ]; then
|
||||
rm %{_localstatedir}/run/update_from_old_cron ||:
|
||||
fi
|
||||
|
||||
%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
|
||||
[ -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
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS COPYING 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/pam.d/crond
|
||||
%verify(not mode) %config(noreplace) /etc/crontab
|
||||
%config(noreplace) /etc/cron.deny
|
||||
%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
|
||||
%{_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
|
||||
%verify(not mode) %attr (4750,root,trusted) %{_bindir}/crontab
|
||||
%attr (755,root,root) %{_sbindir}/cron
|
||||
%{_sbindir}/rccron
|
||||
/usr/lib/cron
|
||||
%{_libexecdir}/cron
|
||||
%config %{_sysconfdir}/omc/srvinfo.d/cron.xml
|
||||
%dir %{_sysconfdir}/omc/srvinfo.d/
|
||||
%dir %{_sysconfdir}/omc/
|
||||
%{_unitdir}/cron.service
|
||||
%{_localstatedir}/adm/fillup-templates/sysconfig.cron
|
||||
|
||||
%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
|
||||
%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
|
||||
%{_mandir}/man5/anacrontab.*
|
||||
%{_mandir}/man8/anacron.*
|
||||
|
||||
|
76
sysconfig.cron
Normal file
76
sysconfig.cron
Normal file
@ -0,0 +1,76 @@
|
||||
## The Parameters MAX_DAYS_IN_TMP, MAX_DAYS_IN_LONG_TMP, TMP_DIRS_TO_CLEAR,
|
||||
## LONG_TMP_DIRS_TO_CLEAR, CLEAR_TMP_DIRS_AT_BOOTUP and OWNER_TO_KEEP_IN_TMP have
|
||||
## been converted to systemd-tmpfiles settings in /etc/tmpfiles.d/tmp.conf.
|
||||
## Please check and modify to your needs.
|
||||
## See 'man tmpfiles.d' for details.
|
||||
|
||||
|
||||
## Type: string
|
||||
## Default: ""
|
||||
#
|
||||
# At which time cron.daily should start. Default is 15 minutes after booting
|
||||
# the system. Example setting would be "14:00".
|
||||
# Due to the fact that cron script runs only every 15 minutes,
|
||||
# it will only run on xx:00, xx:15, xx:30, xx:45, not at the accurate time
|
||||
# you set.
|
||||
DAILY_TIME=""
|
||||
|
||||
## Type: integer
|
||||
## Default: 5
|
||||
#
|
||||
# Maximum days not running when using a fixed time set in DAILY_TIME.
|
||||
# 0 to skip this. This is for users who will power off their system.
|
||||
#
|
||||
# There is a fixed max. of 14 days set, if you want to override this
|
||||
# change MAX_NOT_RUN_FORCE in /usr/lib/cron/run-crons
|
||||
MAX_NOT_RUN="5"
|
||||
|
||||
## Type: yesno
|
||||
## Default: no
|
||||
#
|
||||
# send status email even if all scripts in
|
||||
# cron.{hourly,daily,weekly,monthly}
|
||||
# returned without error? (yes/no)
|
||||
#
|
||||
SEND_MAIL_ON_NO_ERROR="no"
|
||||
|
||||
## Type: yesno
|
||||
## Default: no
|
||||
#
|
||||
# send email containing output from all successful jobs in
|
||||
# cron.{hourly,daily,weekly,monthly}. Output from failed
|
||||
# jobs is always sent. If SEND_MAIL_ON_NO_ERROR is yes, this
|
||||
# setting is ignored. (yes/no)
|
||||
#
|
||||
SEND_OUTPUT_ON_NO_ERROR="no"
|
||||
|
||||
## Type: yesno
|
||||
## Default: no
|
||||
#
|
||||
# generate syslog message for all scripts in
|
||||
# cron.{hourly,daily,weekly,monthly}
|
||||
# even if they haven't returned an error? (yes/no)
|
||||
#
|
||||
SYSLOG_ON_NO_ERROR="no"
|
||||
## Path: System/Cron/Man
|
||||
## Description: cron configuration for man utility
|
||||
## Type: yesno
|
||||
## Default: yes
|
||||
#
|
||||
# Should mandb and whatis be recreated by cron.daily ("yes" or "no")
|
||||
#
|
||||
REINIT_MANDB=yes
|
||||
|
||||
## Type: yesno
|
||||
## Default: yes
|
||||
#
|
||||
# Should old preformatted man pages (in /var/cache/man) be deleted? (yes/no)
|
||||
#
|
||||
DELETE_OLD_CATMAN=yes
|
||||
|
||||
## Type: integer
|
||||
## Default: 7
|
||||
#
|
||||
# How long should old preformatted man pages be kept before deletion? (days)
|
||||
#
|
||||
CATMAN_ATIME=7
|
Loading…
Reference in New Issue
Block a user