ca1e0ce6d9
- Move logrotate.status to /var/lib/misc following FHS/LSB and making implementing read-only root filesystem much easier. [FATE#322036] OBS-URL: https://build.opensuse.org/request/show/440124 OBS-URL: https://build.opensuse.org/package/show/Base:System/logrotate?expand=0&rev=50
122 lines
4.0 KiB
RPMSpec
122 lines
4.0 KiB
RPMSpec
#
|
|
# spec file for package logrotate
|
|
#
|
|
# Copyright (c) 2016 SUSE LINUX 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 http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: logrotate
|
|
Version: 3.10.0
|
|
Release: 0
|
|
Summary: Rotate, compress, remove, and mail system log files
|
|
License: GPL-2.0+
|
|
Group: System/Base
|
|
Url: https://github.com/logrotate/logrotate
|
|
Source0: https://github.com/logrotate/logrotate/releases/download/%{version}/logrotate-%{version}.tar.xz
|
|
Source100: %{name}-rpmlintrc
|
|
Source101: %{name}.service
|
|
Source102: %{name}.timer
|
|
Patch0: logrotate-3.7.8-suse.patch
|
|
Patch1: logrotate-conf.patch
|
|
Patch2: logrotate-autoext.patch
|
|
Patch3: logrotate-addextension.patch
|
|
Patch5: logrotate-manpage_config_clarification.patch
|
|
# 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
|
|
# PATCH-FEATURE-SLE logrotate-var-lib-misc.patch FATE#322036:
|
|
# According to FHS/LSB, this should be in /var/lib/misc. Which
|
|
# would allow a read-only root filesystem without breaking snapshots,
|
|
# rollback and transactional updates
|
|
Patch7: logrotate-var-lib-misc.patch
|
|
BuildRequires: acl
|
|
BuildRequires: libacl-devel
|
|
BuildRequires: libselinux-devel
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: popt-devel
|
|
BuildRequires: pkgconfig(systemd) >= 197
|
|
Requires: xz
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
%{?systemd_requires}
|
|
|
|
%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
|
|
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.
|
|
|
|
%prep
|
|
%setup -q
|
|
%patch0
|
|
%patch1
|
|
%patch2
|
|
%patch3
|
|
%patch5 -p1
|
|
%patch6 -p1
|
|
%patch7 -p0
|
|
|
|
%build
|
|
%configure
|
|
make %{?_smp_mflags}
|
|
|
|
%check
|
|
make %{?_smp_mflags} check
|
|
|
|
%install
|
|
%make_install
|
|
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
|
install -m 644 examples/logrotate-default %{buildroot}%{_sysconfdir}/logrotate.conf
|
|
install -m 644 examples/logrotate.wtmp %{buildroot}%{_sysconfdir}/logrotate.d/wtmp
|
|
install -D -m 0644 %{SOURCE101} %{buildroot}%{_unitdir}/%{name}.service
|
|
install -D -m 0644 %{SOURCE102} %{buildroot}%{_unitdir}/%{name}.timer
|
|
ln -s service %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
%pre
|
|
#only the timer can be enabled/disabled/masked !
|
|
%service_add_pre %{name}.service %{name}.timer
|
|
|
|
%post
|
|
%{remove_and_set MAX_DAYS_FOR_LOG_FILES}
|
|
if [ -f %{_sysconfdir}/logrotate.d/aaa_base ] ; then
|
|
echo "Saving old logrotate system configuration"
|
|
mv -v %{_sysconfdir}/logrotate.d/aaa_base %{_sysconfdir}/logrotate.d.aaa_base.save
|
|
fi
|
|
# Move /var/lib/logrotate.status
|
|
if [ -f /var/lib/logrotate.status -a !-f /var/lib/misc/logrotate.status ]; then
|
|
mv /var/lib/logrotate.status /var/lib/misc/logrotate.status ||:
|
|
fi
|
|
|
|
%service_add_post %{name}.service %{name}.timer
|
|
|
|
%preun
|
|
%service_del_preun %{name}.service %{name}.timer
|
|
|
|
%postun
|
|
%service_del_postun %{name}.service %{name}.timer
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%doc CHANGES COPYING
|
|
%{_sbindir}/logrotate
|
|
%{_sbindir}/rc%{name}
|
|
%{_mandir}/man8/logrotate.8*
|
|
%{_mandir}/man5/logrotate.conf.5*
|
|
%config %{_sysconfdir}/logrotate.conf
|
|
%config(noreplace)%{_sysconfdir}/logrotate.d/wtmp
|
|
%{_unitdir}/%{name}.service
|
|
%{_unitdir}/%{name}.timer
|
|
|
|
%changelog
|