cronie/cronie.spec
OBS User autobuild 2d0a5007f2 Accepting request 49010 from Base:System
Copy from Base:System/cronie based on submit request 49010 from user elvigia

OBS-URL: https://build.opensuse.org/request/show/49010
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cronie?expand=0&rev=1
2010-09-27 15:40:15 +00:00

162 lines
5.7 KiB
RPMSpec

#
# spec file for package cronie (Version 1.4.5_git201007091204)
#
# 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/
#
# norootforbuild
Name: cronie
BuildRequires: audit-devel libselinux-devel pam-devel
Url: https://fedorahosted.org/cronie/
License: MIT and BSD and GPLv2
Group: System/Daemons
Requires: smtp_daemon
Recommends: postfix
AutoReqProv: on
PreReq: permissions %fillup_prereq %insserv_prereq
Version: 1.4.5_git201007091204
Release: 1
Summary: Cron Daemon
Source0: %name-%version.tar.bz2
Source1: cron.init
Source2: run-crons
Source3: sample.root
Source4: deny.sample
Source5: cron.xml
Source6: cronie-rpmlintrc
# 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
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: cron = 4.2
Obsoletes: cron <= 4.1
%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.
%package anacron
License: MIT and BSD and GPLv2
Summary: Utility for running regular jobs
Group: System Environment/Base
Requires: %{name} = %{version}
%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
%patch4 -p1
%patch5 -p1
%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/
%post
%{fillup_and_insserv -y cron}
%run_permissions
%verifyscript
%verify_permissions -e /etc/crontab -e /usr/bin/crontab
%preun
%stop_on_removal cron
%postun
%restart_on_update cron
%{insserv_cleanup}
%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.*
%changelog