logrotate.spec.in 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. Summary: Rotates, compresses, removes and mails system log files
  2. Name: logrotate
  3. Version: @VERSION@
  4. Release: 1%{?dist}
  5. License: GPLv2+
  6. Group: System Environment/Base
  7. Source: https://github.com/logrotate/logrotate/releases/download/%{version}/logrotate-%{version}.tar.gz
  8. Requires: coreutils >= 5.92 libsepol libselinux popt
  9. BuildRequires: libselinux-devel popt-devel
  10. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  11. %{!?_licensedir:%global license %%doc}
  12. %description
  13. The logrotate utility is designed to simplify the administration of
  14. log files on a system which generates a lot of log files. Logrotate
  15. allows for the automatic rotation compression, removal and mailing of
  16. log files. Logrotate can be set to handle a log file daily, weekly,
  17. monthly or when the log file gets to a certain size. Normally,
  18. logrotate runs as a daily cron job.
  19. Install the logrotate package if you need a utility to deal with the
  20. log files on your system.
  21. %prep
  22. %setup -q
  23. %build
  24. %configure \
  25. --with-selinux
  26. make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
  27. %install
  28. rm -rf $RPM_BUILD_ROOT
  29. make install DESTDIR=$RPM_BUILD_ROOT
  30. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
  31. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily
  32. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib
  33. install -p -m 644 examples/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
  34. install -p -m 644 examples/btmp $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/btmp
  35. install -p -m 644 examples/wtmp $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/wtmp
  36. install -p -m 755 examples/logrotate.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/logrotate
  37. touch $RPM_BUILD_ROOT%{_localstatedir}/lib/logrotate.status
  38. %clean
  39. rm -rf $RPM_BUILD_ROOT
  40. %files
  41. %defattr(-,root,root)
  42. %license COPYING
  43. %attr(0755, root, root) %{_sbindir}/logrotate
  44. %attr(0644, root, root) %{_mandir}/man8/logrotate.8*
  45. %attr(0644, root, root) %{_mandir}/man5/logrotate.conf.5*
  46. %attr(0755, root, root) %{_sysconfdir}/cron.daily/logrotate
  47. %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/logrotate.conf
  48. %attr(0755, root, root) %{_sysconfdir}/logrotate.d
  49. %attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status