File logrotate.spec of Package logrotate.361

# spec file for package logrotate
# Copyright (c) 2012 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

# norootforbuild


Name:           logrotate
BuildRequires:  popt-devel
BuildRequires:  libselinux-devel
Summary:        Rotate, Compress, Remove, and Mail System Log Files
Version:        3.7.9
Release:        6.<RELEASE11>
License:        GPLv2+
Group:          System/Base
Source:         %{name}-%{version}.tar.bz2
Source100:      %{name}-rpmlintrc
Patch:          logrotate-3.7.8-suse.patch
Patch1:         logrotate-3.7.8-conf.patch
Patch2:         logrotate-3.7.8-autoext.patch
Patch3:         logrotate-3.7.8-addextension.patch
Patch4:         logrotate-3.7.8-mess_err.patch
Patch5:         logrotate-CVE-2011-1098.patch
Patch6:         logrotate-shred-CVE-2011-1154.patch
Patch7:         logrotate-CVE-2011-1155.patch
Patch8:         logrotate-3.7.9-su.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %fillup_prereq /bin/rm /bin/mv
Requires:       bzip2 cron

The logrotate utility is designed to simplify the administration of log
files on a system that generates a lot of log files. Logrotate allows
the automatic rotation, compression, removal, and mailing of log files.
Logrotate can be set to handle a log file daily, weekly, monthly, or
when the log file reaches a certain size. Normally, logrotate runs as a
daily cron job.

    Erik Troan <>
    Matt Wilson <>
    Preston Brown <>

%setup -q
%patch5 -p1
%patch8 -p1

make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes

make test

mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,cron.daily}
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -m 644 examples/logrotate-default $RPM_BUILD_ROOT/etc/logrotate.conf
install -m 755 examples/logrotate.cron $RPM_BUILD_ROOT/etc/cron.daily/logrotate
install -m 644 examples/logrotate.wtmp $RPM_BUILD_ROOT/etc/logrotate.d/wtmp

%{remove_and_set MAX_DAYS_FOR_LOG_FILES}
if [ -f /etc/logrotate.d/aaa_base ] ; then
   echo "Saving old logrotate system confguration"
   mv -v /etc/logrotate.d/aaa_base /etc/


%config /etc/logrotate.conf