%global _configure ../configure Name: logrotate Version: 3.14.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 Source1: rwtab BuildRequires: acl gcc automake git libacl-devel libselinux-devel popt-devel Requires: coreutils # display version information(#1611498) Patch1: 0001-logrotate-3.14.0-man-version.patch # fix Coverity Analysis issue Patch2: 0002-logrotate-3.14.0-coverity.patch Patch6001: do_mkdir-fix-time-of-check-time-of-use-race-conditio.patch Patch6002: config-logrotate-fix-couple-printf-format-specifiers.patch Patch6003: explicitly-cast-uid_t-and-gid_t-to-unsigned-int.patch Patch6004: config-add-variable-initialization-Wconditional-unin.patch %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-default %{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 # logrotate run on read-only root mkdir -p %{buildroot}%{_sysconfdir}/rwtab.d install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rwtab.d/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 %dir %{_sysconfdir}/cron.daily %config(noreplace) %{_sysconfdir}/cron.daily/logrotate %config(noreplace) %{_sysconfdir}/logrotate.conf %dir %{_sysconfdir}/logrotate.d %config(noreplace) %{_sysconfdir}/logrotate.d/*tmp %config(noreplace) %{_sysconfdir}/rwtab.d/logrotate %{_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 * Fri Sep 27 2019 openEuler Buildteam - 3.14.0-6 - del unnecessary statement * Mon Sep 16 2019 openEuler Buildteam - 3.14.0-5 - modify spec * Tue Sep 10 2019 openEuler Buildteam - 3.14.0-4 - rewrite spec * Tue Aug 20 2019 Shouping Wang - 3.14.0-3 - Type:enhancement - ID:NA - SUG:NA - DESC:format patches for openeuler * Mon Aug 19 2019 Shouping Wang - 3.14.0-2 - Type:enhancement - ID:NA - SUG:NA - DESC:format patches * Thu Feb 28 2019 Xiaoqi Guo - 3.14.0-1 - Type:bugfix - ID:NA - SUG:NA - DESC:backport patch from https://github.com/logrotate/logrotate/