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
|
|
|
#
|
2020-01-02 08:27:02 +01:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
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.
|
|
|
|
|
2019-04-05 09:24:38 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:24:09 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: logrotate
|
2020-01-08 09:29:48 +01:00
|
|
|
Version: 3.15.1
|
2013-04-17 10:06:58 +02:00
|
|
|
Release: 0
|
2018-09-11 09:17:52 +02:00
|
|
|
Summary: Cron service for rotating, compressing, mailing and removing 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
|
2020-01-08 09:29:48 +01:00
|
|
|
URL: https://github.com/logrotate/logrotate
|
2019-04-05 09:24:38 +02:00
|
|
|
Source0: https://github.com/%{name}/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
|
|
|
|
Source10: https://github.com/%{name}/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz.asc
|
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
|
2018-06-07 12:19:19 +02:00
|
|
|
Patch0: logrotate-3.13.0-systemd_add_home_env.patch
|
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
|
2020-01-02 08:27:02 +01:00
|
|
|
%{?systemd_ordering}
|
2007-01-16 00:24:09 +01:00
|
|
|
|
|
|
|
%description
|
2018-09-11 09:17:52 +02:00
|
|
|
The logrotate utility does automatic rotation, compression, mailing and removal
|
|
|
|
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
|
2007-08-16 18:19:25 +02:00
|
|
|
daily cron job.
|
2007-01-16 00:24:09 +01:00
|
|
|
|
2018-09-11 09:17:52 +02:00
|
|
|
It manages plain files only and is not involved in systemd's journal rotation.
|
|
|
|
|
2007-01-16 00:24:09 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2018-06-07 12:19:19 +02:00
|
|
|
%patch0 -p1
|
2007-01-16 00:24:09 +01:00
|
|
|
|
|
|
|
%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
|