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
|
|
|
#
|
2018-01-06 07:57:55 +01:00
|
|
|
# Copyright (c) 2018 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
|
2018-01-06 07:57:55 +01:00
|
|
|
Version: 3.13.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
|
2018-04-03 13:51:31 +02:00
|
|
|
License: GPL-2.0-or-later
|
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
|
2016-12-28 12:32:47 +01:00
|
|
|
# SUSE specific logrotate configurations
|
|
|
|
Source1: logrotate.wtmp
|
|
|
|
Source2: logrotate.default
|
2010-08-24 17:44:55 +02:00
|
|
|
Source100: %{name}-rpmlintrc
|
2013-11-13 08:50:35 +01:00
|
|
|
BuildRequires: acl
|
|
|
|
BuildRequires: libacl-devel
|
2016-10-05 13:39:50 +02:00
|
|
|
BuildRequires: pkgconfig
|
2016-12-28 12:32:47 +01:00
|
|
|
BuildRequires: pkgconfig(libselinux)
|
|
|
|
BuildRequires: pkgconfig(popt)
|
2014-04-03 17:12:24 +02:00
|
|
|
BuildRequires: pkgconfig(systemd) >= 197
|
2013-04-17 10:06:58 +02:00
|
|
|
Requires: xz
|
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
|
|
|
|
|
|
|
|
%build
|
2016-12-28 12:32:47 +01:00
|
|
|
%configure \
|
2017-07-07 11:00:26 +02:00
|
|
|
--disable-silent-rules \
|
|
|
|
--with-state-file-path=%{_localstatedir}/lib/misc/logrotate.status \
|
|
|
|
--disable-werror
|
2016-10-05 13:39:50 +02:00
|
|
|
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
|
2016-12-28 12:32:47 +01:00
|
|
|
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/wtmp
|
|
|
|
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.conf
|
|
|
|
install -D -m 0644 examples/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
install -D -m 0644 examples/%{name}.timer %{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}
|
2016-11-14 14:39:27 +01:00
|
|
|
# Move /var/lib/logrotate.status
|
2016-12-28 12:32:47 +01:00
|
|
|
if [ -f %{_localstatedir}/lib/logrotate.status -a ! -f %{_localstatedir}/lib/misc/logrotate.status ]; then
|
|
|
|
mv %{_localstatedir}/lib/logrotate.status %{_localstatedir}/lib/misc/logrotate.status ||:
|
2016-11-14 14:39:27 +01:00
|
|
|
fi
|
2007-01-16 00:24:09 +01:00
|
|
|
|
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
|
2018-04-03 13:51:31 +02:00
|
|
|
%license COPYING
|
|
|
|
%doc ChangeLog.md README.md
|
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
|
2016-12-28 12:32:47 +01: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
|