2 # - bug: when logrotate.status is written truncated (due disk getting full) and
3 # the line is partial, it will complain erronously that the line is too long
4 # while it just doesn't have the second DATE column. and that error should be
5 # ignored as warning not fatal as error.
8 %bcond_without acl # build without ACLs support
9 %bcond_without selinux # build without SELinux support
10 %bcond_without tests # do not perform "make test"
12 Summary: Rotates, compresses, removes and mails system log files
13 Summary(de.UTF-8): Rotiert, komprimiert und verschickt Systemlogs
14 Summary(es.UTF-8): Hace el rutado, comprime y envía mail de logs del sistema
15 Summary(fr.UTF-8): Fait tourner, compresse, et envoie par mail les connexions au système
16 Summary(pl.UTF-8): System rotacji i kompresowania logów
17 Summary(pt_BR.UTF-8): Rotaciona, comprime e envia mail de logs do sistema
18 Summary(ru.UTF-8): Ротирует, компрессирует, удаляет и отправляет по почте лог-файлы
19 Summary(tr.UTF-8): Sistem günlüklerini yönlendirir, sıkıştırır ve mektup olarak yollar
20 Summary(uk.UTF-8): Ротує, компресує, видаляє та відправляє поштою лог-файли
25 Group: Applications/System
26 Source0: https://github.com/logrotate/logrotate/releases/download/%{version}/%{name}-%{version}.tar.xz
27 # Source0-md5: 1c0f6e6e490c4bcac0a1e77ad1310683
29 Source2: %{name}.sysconfig
31 Source4: %{name}.crontab
32 Patch0: tabooext.patch
33 Patch1: %{name}-man.patch
34 URL: https://github.com/logrotate/logrotate
35 %{?with_acl:BuildRequires: acl-devel}
36 BuildRequires: autoconf >= 2.50
37 BuildRequires: automake >= 1:1.13
39 BuildRequires: libselinux-devel
40 %{?with_tests:BuildRequires: libselinux-utils}
42 BuildRequires: popt-devel >= 1.3
43 BuildRequires: rpmbuild(macros) >= 1.644
44 BuildRequires: tar >= 1:1.22
46 Requires(post): coreutils
49 Requires: filesystem >= 4.0-4
51 Requires: setup >= 2.4.6
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 %define statdir /var/lib/misc
56 %define _libexecdir %{_prefix}/lib
59 The logrotate utility is designed to simplify the administration of
60 log files on a system which generates a lot of log files. Logrotate
61 allows for the automatic rotation compression, removal and mailing of
62 log files. Logrotate can be set to handle a log file daily, weekly,
63 monthly or when the log file gets to a certain size. Normally,
64 logrotate runs as a daily cron job.
66 %description -l de.UTF-8
67 Logrotate vereinfacht die Verwaltung von Systemen, die sehr viele
68 Log-Dateien erzeugen, indem es das automatische Rotieren,
69 Komprimieren, Entfernen, und Senden von Log-Dateien ermöglicht. Jede
70 Log-Datei kann täglich, wöchentlich oder monatlich verarbeitet werden,
71 wenn sie zu groß wird.
73 %description -l es.UTF-8
74 Logrotate fue proyectado para facilitar la administración de sistemas
75 que generan gran número de archivos de log. Permite automatización en
76 la rotación, compresión, remoción y envío de mail de archivos de logs.
77 Cada archivo de log puede ser tratado diariamente, semanalmente,
78 mensualmente o cuanto crezca demasiado.
80 %description -l fr.UTF-8
81 Logrotate est conçu pour faciliter l'administration de systèmes qui
82 générent un grand nombre de fichiers de \"log\". Il permet le
83 roulement, la suppréssion la compression et l'envoi automatiques de
84 ces fichiers. Chaque fichier de \"log\" peut être pris en charge de
85 manière quotidienne, hebdomadaire, mensuelle, ou quand il devient trop
88 %description -l pl.UTF-8
89 Logrotate jest przeznaczony do łatwej administracji plikami logów.
90 Program ten pozwala na automatyczną kompresję logów. Może kontrolować
91 logi raz dziennie, raz na miesiąc, raz na tydzień lub wtedy kiedy
92 pliki z logami systemowymi są już duże.
94 %description -l pt_BR.UTF-8
95 Logrotate foi projetado para facilitar a administração de sistemas que
96 geram grande número de arquivos de log. Permite automatização na
97 rotação, compressão, remoção e envio de mail de arquivos de logs. Cada
98 arquivo de log pode ser tratado diariamente, semanalmente, mensalmente
99 ou quanto crescer demais.
101 %description -l ru.UTF-8
102 Logrotate предназначен для облегчения администрирования системы,
103 которая генерирует большое количество файлов с логами. Он позволяет
104 автоматически ротировать, компрессировать, удалять и посылать файлы с
105 логами по e-mail. Каждый лог может обрабатываться ежедневно,
106 еженедельно, ежемесячно или по достижении определенного размера.
108 %description -l tr.UTF-8
109 logrotate çok fazla sayıda günlük dosyası üreten sistemlerin
110 yönetimini kolaylaştırmak için tasarlanmıştır. Kayıt dosyalarının
111 otomatik olarak yönlendirilmesini, sıkıştırılmasını, silinmesinı ve
112 mektup olarak yollanmasını sağlar. Her dosya günlük, haftalık, aylık
113 olarak ya da çok büyük boyutlara ulaştığında işlenebilir.
115 %description -l uk.UTF-8
116 Logrotate призначений для полегшення адміністрування системи, яка
117 генерує велику кількість файлів з логами. Він дозволяє автоматично
118 ротувати, компресувати, видаляти та посилати поштою лог-файли. Кожен
119 лог може оброблятися щоденно, щотижня, щомісяця або по досягненні
133 --disable-silent-rules \
134 --with%{!?with_acl:out}-acl \
135 --with%{!?with_selinux:out}-selinux \
136 --with-default-mail-command=/bin/mail \
137 --with-compress-command=/bin/gzip \
138 --with-uncompress-command=/bin/gunzip \
139 --with-state-file-path=%{statdir}/logrotate.status
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT/etc/{cron.d,logrotate.d,sysconfig} \
150 $RPM_BUILD_ROOT{%{_libexecdir},%{_mandir},%{statdir}}
153 DESTDIR=$RPM_BUILD_ROOT
155 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
156 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
157 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/%{name}
158 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/%{name}
159 > $RPM_BUILD_ROOT%{statdir}/%{name}.status
162 rm -rf $RPM_BUILD_ROOT
164 %triggerun -- %{name} < 3.8.6-1
165 # if previous install had /etc/cron.daily/* files removed (missingok), disable the cronjob
166 if [ ! -e /etc/cron.daily/%{name} ]; then
167 echo DISABLE_LOGROTATE_CRON=yes >> /etc/sysconfig/%{name}
170 %triggerpostun -- %{name} < 3.7.8-4
171 %{__sed} -i -e 's,olddir /var/log/archiv$,olddir /var/log/archive,' %{_sysconfdir}/%{name}.conf %{_sysconfdir}/logrotate.d/* || :
174 if [ -f /var/lib/logrotate.status ]; then
175 mv -f /var/lib/logrotate.status %{statdir}/logrotate.status
177 touch %{statdir}/logrotate.status
178 chmod 000 %{statdir}/logrotate.status
179 chown root:root %{statdir}/logrotate.status
180 chmod 640 %{statdir}/logrotate.status
184 %defattr(644,root,root,755)
185 %doc README.md ChangeLog.md
186 %attr(755,root,root) %{_sbindir}/logrotate
187 %attr(755,root,root) %{_libexecdir}/logrotate
188 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
189 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
190 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
191 %attr(640,root,root) %ghost %{statdir}/logrotate.status
192 %{_mandir}/man5/logrotate.conf.5*
193 %{_mandir}/man8/logrotate.8*