2007-01-16 00:24:09 +01:00
#
2011-05-19 09:46:17 +02:00
# spec file for package logrotate
2007-01-16 00:24:09 +01:00
#
2016-10-04 13:00:37 +02:00
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
2007-01-16 00:24:09 +01:00
#
2008-08-15 00:58:09 +02:00
# 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.
2007-01-16 00:24:09 +01:00
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name : logrotate
2016-10-05 13:39:50 +02:00
Version : 3.10.0
2013-04-17 10:06:58 +02:00
Release : 0
2011-05-18 19:37:01 +02:00
Summary : Rotate, compress, remove, and mail system log files
2013-04-17 10:06:58 +02:00
License : GPL-2.0+
2007-01-16 00:24:09 +01:00
Group : System/Base
2016-10-05 13:39:50 +02:00
Url : https://github.com/logrotate/logrotate
Source0 : https://github.com/logrotate/logrotate/releases/download/%{version} /logrotate-%{version} .tar.xz
2010-08-24 17:44:55 +02:00
Source100 : %{name} -rpmlintrc
2014-04-03 17:12:24 +02:00
Source101 : %{name} .service
Source102 : %{name} .timer
2011-05-18 19:37:01 +02:00
Patch0 : logrotate-3.7.8-suse.patch
2015-02-20 13:18:45 +01:00
Patch1 : logrotate-conf.patch
Patch2 : logrotate-autoext.patch
Patch3 : logrotate-addextension.patch
2013-08-02 16:50:50 +02:00
Patch5 : logrotate-manpage_config_clarification.patch
2016-10-04 13:00:37 +02:00
# PATCH-FIX-UPSTREAM logrotate-fix-test62_with_bash-4.4.patch gh#logrotate/logrotate#66 dimstar@opensuse.org -- Fix test suite in combination with bash 4.4
Patch6 : logrotate-fix-test62_with_bash-4.4.patch
2013-11-13 08:50:35 +01:00
BuildRequires : acl
BuildRequires : libacl-devel
2011-05-18 19:37:01 +02:00
BuildRequires : libselinux-devel
2016-10-05 13:39:50 +02:00
BuildRequires : pkgconfig
2011-05-18 19:37:01 +02:00
BuildRequires : popt-devel
2014-04-03 17:12:24 +02:00
BuildRequires : pkgconfig(systemd) >= 197
2013-04-17 10:06:58 +02:00
Requires : xz
2007-01-16 00:24:09 +01:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2014-04-03 17:12:24 +02:00
%{?systemd_requires}
2007-01-16 00:24:09 +01:00
%description
The logrotate utility is designed to simplify the administration of log
files on a system that generates a lot of log files. Logrotate allows
2007-08-16 18:19:25 +02:00
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.
2007-01-16 00:24:09 +01:00
%prep
%setup -q
2011-05-18 19:37:01 +02:00
%patch0
2007-01-16 00:24:09 +01:00
%patch1
%patch2
%patch3
2013-08-02 16:50:50 +02:00
%patch5 -p1
2016-10-04 13:00:37 +02:00
%patch6 -p1
2007-01-16 00:24:09 +01:00
%build
2016-10-05 13:39:50 +02:00
%configure
make %{?_smp_mflags}
2008-08-15 00:58:09 +02:00
%check
2016-10-05 13:39:50 +02:00
make %{?_smp_mflags} check
2007-01-16 00:24:09 +01:00
%install
2016-10-05 13:39:50 +02:00
%make_install
mkdir -p %{buildroot} %{_sysconfdir} /logrotate.d
2011-05-18 19:37:01 +02:00
install -m 644 examples/logrotate-default %{buildroot} %{_sysconfdir} /logrotate.conf
install -m 644 examples/logrotate.wtmp %{buildroot} %{_sysconfdir} /logrotate.d/wtmp
2015-06-22 16:28:41 +02:00
install -D -m 0644 %{SOURCE101} %{buildroot} %{_unitdir} /%{name} .service
install -D -m 0644 %{SOURCE102} %{buildroot} %{_unitdir} /%{name} .timer
2016-10-05 13:39:50 +02:00
ln -s service %{buildroot} %{_sbindir} /rc%{name}
2014-04-03 17:12:24 +02:00
%pre
#only the timer can be enabled/disabled/masked !
%service_add_pre %{name} .service %{name} .timer
2007-01-16 00:24:09 +01:00
%post
%{remove_and_set MAX_DAYS_FOR_LOG_FILES}
2015-06-22 16:28:41 +02:00
if [ -f %{_sysconfdir} /logrotate.d/aaa_base ] ; then
2011-09-13 11:24:51 +02:00
echo " S a v i n g o l d l o g r o t a t e s y s t e m c o n f i g u r a t i o n "
2015-06-22 16:28:41 +02:00
mv -v %{_sysconfdir} /logrotate.d/aaa_base %{_sysconfdir} /logrotate.d.aaa_base.save
2007-01-16 00:24:09 +01:00
fi
2014-04-03 17:12:24 +02:00
%service_add_post %{name} .service %{name} .timer
%preun
%service_del_preun %{name} .service %{name} .timer
%postun
%service_del_postun %{name} .service %{name} .timer
2007-01-16 00:24:09 +01:00
%files
%defattr (-,root,root)
2013-08-23 14:06:43 +02:00
%doc CHANGES COPYING
2008-09-06 00:08:20 +02:00
%{_sbindir} /logrotate
2016-10-05 13:39:50 +02:00
%{_sbindir} /rc%{name}
2007-01-16 00:24:09 +01:00
%{_mandir} /man8/logrotate.8*
2010-08-24 17:44:55 +02:00
%{_mandir} /man5/logrotate.conf.5*
2011-05-18 19:37:01 +02:00
%config %{_sysconfdir} /logrotate.conf
2015-06-22 16:28:41 +02:00
%config (noreplace)%{_sysconfdir} /logrotate.d/wtmp
2014-04-03 17:12:24 +02:00
%{_unitdir} /%{name} .service
%{_unitdir} /%{name} .timer
2008-02-01 00:45:45 +01:00
2007-08-16 18:19:25 +02:00
%changelog