# ignored as warning not fatal as error.
#
# Conditional build:
+%bcond_without acl # build without ACLs support
%bcond_without selinux # build without SELinux support
-#
+%bcond_without tests # do not perform "make test"
+
Summary: Rotates, compresses, removes and mails system log files
Summary(de.UTF-8): Rotiert, komprimiert und verschickt Systemlogs
Summary(es.UTF-8): Hace el rutado, comprime y envía mail de logs del sistema
Summary(tr.UTF-8): Sistem günlüklerini yönlendirir, sıkıştırır ve mektup olarak yollar
Summary(uk.UTF-8): Ротує, компресує, видаляє та відправляє поштою лог-файли
Name: logrotate
-Version: 3.7.7
-Release: 2
+Version: 3.9.2
+Release: 1
License: GPL v2
Group: Applications/System
-Source0: https://fedorahosted.org/releases/l/o/logrotate/%{name}-%{version}.tar.gz
-# Source0-md5: 431e135abb7f3fe19de4c6a65bb66823
+Source0: https://github.com/logrotate/logrotate/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 584bca013dcceeb23b06b27d6d0342fb
Source1: %{name}.conf
Source2: %{name}.sysconfig
-Patch0: %{name}-man.patch
-Patch1: %{name}-cron.patch
-URL: https://fedorahosted.org/logrotate/
-%{?with_selinux:BuildRequires: libselinux-devel}
+Source3: %{name}.cron
+Source4: %{name}.crontab
+Patch1: %{name}-man.patch
+Patch2: tabooext.patch
+Patch3: %{name}-largefile.patch
+URL: https://github.com/logrotate/logrotate
+%{?with_acl:BuildRequires: acl-devel}
+BuildRequires: autoconf >= 2.50
+BuildRequires: automake >= 1:1.13
+%if %{with selinux}
+BuildRequires: libselinux-devel
+%{?with_tests:BuildRequires: libselinux-utils}
+%endif
BuildRequires: popt-devel >= 1.3
+Requires(post): coreutils
Requires: coreutils
-Requires: /bin/mail
Requires: crondaemon
+Requires: filesystem >= 4.0-4
Requires: gzip
Requires: setup >= 2.4.6
+Suggests: /bin/mail
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define statdir /var/lib/misc
+%define _libexecdir %{_prefix}/lib
%description
The logrotate utility is designed to simplify the administration of
%prep
%setup -q
-%patch0 -p1
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+echo '
+#undef STATEFILE
+#define STATEFILE "%{statdir}/logrotate.status"
+' >> config.h
%build
-%{__make} \
- CC="%{__cc}" \
- RPM_OPT_FLAGS="%{rpmcflags}" \
- WITH_SELINUX=%{?with_selinux:yes}%{!?with_selinux:no} \
- STATEFILE="%{statdir}/logrotate.status"
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+
+%configure \
+ --disable-silent-rules \
+ --with%{!?with_acl:out}-acl \
+ --with%{!?with_selinux:out}-selinux \
+
+%{__make}
+
+%if %{with tests}
+%{__make} test
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/etc/{cron.daily,logrotate.d,sysconfig} \
- $RPM_BUILD_ROOT{%{_mandir},%{statdir},/var/log/archive}
+install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,sysconfig} \
+ $RPM_BUILD_ROOT{%{_libexecdir},%{_mandir},%{statdir}}
%{__make} install \
- BINDIR=$RPM_BUILD_ROOT%{_sbindir} \
- MANDIR=$RPM_BUILD_ROOT%{_mandir}
+ DESTDIR=$RPM_BUILD_ROOT
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
-install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/logrotate
-install examples/logrotate.cron $RPM_BUILD_ROOT/etc/cron.daily/logrotate
-> $RPM_BUILD_ROOT%{statdir}/logrotate.status
-> $RPM_BUILD_ROOT/var/log/archiv
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/%{name}
+cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}
+> $RPM_BUILD_ROOT%{statdir}/%{name}.status
%clean
rm -rf $RPM_BUILD_ROOT
-%pretrans
-# change /var/log/archiv to /var/log/archive
-if [ ! -L /var/log/archiv ]; then
- if [ -d /var/log/archiv ]; then
- if [ -d /var/log/archive ]; then
- mv /var/log/archiv/* /var/log/archive
- rmdir /var/log/archiv 2>/dev/null || mv -v /var/log/archiv{,.rpmsave}
- else
- mv /var/log/archiv /var/log/archive
- fi
- fi
-
- # always have archiv symlink (until all packages from Ac use new dir)
- install -d /var/log
- ln -s archive /var/log/archiv
+%triggerun -- %{name} < 3.8.6-1
+# if previous install had /etc/cron.daily/* files unlink (missingok), disable the cronjob
+if [ ! -e /etc/cron.daily/%{name} ]; then
+ echo DISABLE_LOGROTATE_CRON=yes >> /etc/sysconfig/%{name}
fi
-exit 0
+
+%triggerpostun -- %{name} < 3.7.8-4
+%{__sed} -i -e 's,olddir /var/log/archiv$,olddir /var/log/archive,' %{_sysconfdir}/%{name}.conf %{_sysconfdir}/logrotate.d/* || :
%post
if [ -f /var/lib/logrotate.status ]; then
%defattr(644,root,root,755)
%doc CHANGES
%attr(755,root,root) %{_sbindir}/logrotate
-%attr(750,root,root) %dir /etc/logrotate.d
-%attr(750,root,root) /etc/cron.daily/logrotate
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
+%attr(755,root,root) %{_libexecdir}/logrotate
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
%attr(640,root,root) %ghost %{statdir}/logrotate.status
-%attr(750,root,logs) %dir /var/log/archive
-%ghost /var/log/archiv
-%{_mandir}/man8/*
+%{_mandir}/man5/logrotate.conf.5*
+%{_mandir}/man8/logrotate.8*