%global _configure ../configure Name: logrotate Version: 3.16.0 Release: 6 Summary: simplify the administration of log files License: GPLv2+ Url: https://github.com/logrotate/logrotate Source0: https://github.com/logrotate/logrotate/releases/download/%{version}/logrotate-%{version}.tar.xz Patch6000: backport-skip-switchback-check-if-switched-to-root.patch Patch6001: backport-add-sanity-check.patch Patch6002: backport-improve-debug-logging.patch Patch6003: backport-call-switch_user_back-on-early-return.patch Patch6004: backport-Also-check-seteuid-fails-after-dropping-privileges.patch Patch6005: backport-do-not-rotate-old-logs-on-prerotate-failure.patch BuildRequires: acl gcc automake libacl-devel libselinux-devel popt-devel Requires: coreutils %description The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files. Logrotate allows for the automatic rotation compression, removal and mailing of log files.logrotate Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. %package_help %prep %autosetup -n %{name}-%{version} -p1 %build mkdir build && cd build %configure --with-state-file-path=%{_localstatedir}/lib/logrotate/logrotate.status %make_build V=1 %install %make_install -C build mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d mkdir -p %{buildroot}%{_sysconfdir}/cron.daily mkdir -p %{buildroot}%{_localstatedir}/lib/logrotate install -p -m 644 examples/logrotate.conf %{buildroot}%{_sysconfdir}/logrotate.conf install -p -m 644 examples/*tmp %{buildroot}%{_sysconfdir}/logrotate.d/ install -p -m 755 examples/logrotate.cron %{buildroot}%{_sysconfdir}/cron.daily/logrotate %check %make_build -C build check %pre # create it and copy the /var/lib/logrotate.status in it. if [ ! -d %{_localstatedir}/lib/logrotate/ -a -f %{_localstatedir}/lib/logrotate.status ]; then mkdir -p %{_localstatedir}/lib/logrotate cp -a %{_localstatedir}/lib/logrotate.status %{_localstatedir}/lib/logrotate fi %preun %post %postun %files %defattr(-,root,root) %license COPYING %config(noreplace) %{_sysconfdir}/cron.daily/logrotate %config(noreplace) %{_sysconfdir}/logrotate.conf %dir %{_sysconfdir}/logrotate.d %config(noreplace) %{_sysconfdir}/logrotate.d/*tmp %{_sbindir}/logrotate %dir %{_localstatedir}/lib/logrotate %ghost %verify(not size md5 mtime) %attr(0644, root, root) %{_localstatedir}/lib/logrotate/logrotate.status %files help %defattr(-,root,root) %doc ChangeLog.md %{_mandir}/man8/logrotate.8* %{_mandir}/man5/logrotate.conf.5* %changelog * Thu Jan 11 2024 hanhuihui - 3.16.0-6 - do not pack directories belonging to other packages * Mon Jun 5 2023 hanhuihui - 3.16.0-5 - do not rotate old logs on prerotate failure * Tue Mar 29 2022 dongyuzhen - 3.16.0-4 - fix switch_user_permanently: skip switchback check if switched to root * Fri Jun 11 2021 shixuantong - 3.16.0-3 - Type:bugfix - CVE:NA - SUG:NA - DESC:revert Solution to the failure of SUT full upgrade * Fri Jun 11 2021 shixuantong - 3.16.0-2 - Type:bugfix - CVE:NA - SUG:NA - DESC:Solution to the failure of SUT full upgrade * Fri Apr 24 2020 BruceGW - 3.16.0-1 - update upstream to 3.16.0 * Tue Jan 14 2020 openEuler Buildteam - 3.15.1-2 - del unuse info * Sat Oct 12 2019 openEuler Buildteam - 3.15.1-1 - update version to 3.15.1