File cronie.spec of Package cronie

# norootforbuild

%bcond_with selinux
%bcond_without pam
%bcond_with audit
%bcond_without inotify

Summary:       Cron daemon for executing programs at set times
Name:          cronie
Version:       1.2
Release:       0
License:       MIT and BSD
Group:         System/Base
URL:           https://fedorahosted.org/cronie
#Source0: https://fedorahosted.org/cronie/%{name}-%{version}.tar.gz
Source0:       %name-%version.tar.bz2
Patch0:	       %name-1.2-init.patch
Buildroot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:      syslog, bash >= 2.0
Requires:      /usr/sbin/sendmail
%if %{with selinux}
Requires:      libselinux >= 2.0.64
Buildrequires: libselinux-devel >= 2.0.64
%endif
%if %{with pam}
Requires:      pam >= 1.0.1
Buildrequires: pam-devel >= 1.0.1
%endif
%if %{with audit}
Buildrequires: audit-libs-devel >= 1.4.1
%endif

%description
Cronie contains the standard UNIX daemon crond that runs specified programs at
scheduled times and related tools. It is a fork of the original vixie-cron and
has security and configuration enhancements like the ability to use pam and
SELinux.

%prep
%setup -q
%patch0 -p1 

%build

%configure \
%if %{with pam}
	--with-pam \
%endif
%if %{with selinux}
	--with-selinux \
%endif
%if %{with audit}
	--with-audit \
%endif
%if %{with inotify}
	--with-inotify 
%endif

%__make %{?_smp_mflags} 

%install
%makeinstall DESTMAN=$RPM_BUILD_ROOT%{_mandir}
mkdir -pm700 $RPM_BUILD_ROOT%{_localstatedir}/spool/cron
mkdir -pm755 $RPM_BUILD_ROOT%{_initrddir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
mkdir -pm755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/
%if ! %{with pam}
    rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/crond
%endif
install -m 755 cronie.init $RPM_BUILD_ROOT%{_initrddir}/crond
touch $RPM_BUILD_ROOT%{_sysconfdir}/cron.deny

# treat sysconfig differently in SUSE
install -D -m 644 crond.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.crond

%clean
rm -rf $RPM_BUILD_ROOT

%post
%run_permissions
%fillup_only crond

%verifyscript
%verify_permissions

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING INSTALL README ChangeLog
%attr(755,root,root) %{_sbindir}/crond
%verify(not mode) %attr (4750,root,trusted) %{_bindir}/crontab
%doc %{_mandir}/man8/crond.*
%doc %{_mandir}/man8/cron.*
%doc %{_mandir}/man5/crontab.*
%doc %{_mandir}/man1/crontab.*
%dir %{_localstatedir}/spool/cron
%dir %{_sysconfdir}/cron.d
%exclude %{_initrddir}/crond
%if %{with pam}
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/pam.d/crond
%endif
%config(noreplace) %{_sysconfdir}/cron.deny
/var/adm/fillup-templates/sysconfig.crond

%changelog
openSUSE Build Service is sponsored by