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 selinux # build without SELinux support
10 Summary: Rotates, compresses, removes and mails system log files
11 Summary(de.UTF-8): Rotiert, komprimiert und verschickt Systemlogs
12 Summary(es.UTF-8): Hace el rutado, comprime y envía mail de logs del sistema
13 Summary(fr.UTF-8): Fait tourner, compresse, et envoie par mail les connexions au système
14 Summary(pl.UTF-8): System rotacji i kompresowania logów
15 Summary(pt_BR.UTF-8): Rotaciona, comprime e envia mail de logs do sistema
16 Summary(ru.UTF-8): Ротирует, компрессирует, удаляет и отправляет по почте лог-файлы
17 Summary(tr.UTF-8): Sistem günlüklerini yönlendirir, sıkıştırır ve mektup olarak yollar
18 Summary(uk.UTF-8): Ротує, компресує, видаляє та відправляє поштою лог-файли
23 Group: Applications/System
24 Source0: https://fedorahosted.org/releases/l/o/logrotate/%{name}-%{version}.tar.gz
25 # Source0-md5: b3589bea6d8d5afc8a84134fddaae973
27 Source2: %{name}.sysconfig
28 Patch0: %{name}-cron.patch
29 Patch1: %{name}-man.patch
30 URL: https://fedorahosted.org/logrotate/
31 %{?with_selinux:BuildRequires: libselinux-devel}
32 BuildRequires: popt-devel >= 1.3
36 Requires: filesystem >= 3.0-22
38 Requires: setup >= 2.4.6
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define statdir /var/lib/misc
44 The logrotate utility is designed to simplify the administration of
45 log files on a system which generates a lot of log files. Logrotate
46 allows for the automatic rotation compression, removal and mailing of
47 log files. Logrotate can be set to handle a log file daily, weekly,
48 monthly or when the log file gets to a certain size. Normally,
49 logrotate runs as a daily cron job.
51 %description -l de.UTF-8
52 Logrotate vereinfacht die Verwaltung von Systemen, die sehr viele
53 Log-Dateien erzeugen, indem es das automatische Rotieren,
54 Komprimieren, Entfernen, und Senden von Log-Dateien ermöglicht. Jede
55 Log-Datei kann täglich, wöchentlich oder monatlich verarbeitet werden,
56 wenn sie zu groß wird.
58 %description -l es.UTF-8
59 Logrotate fue proyectado para facilitar la administración de sistemas
60 que generan gran número de archivos de log. Permite automatización en
61 la rotación, compresión, remoción y envío de mail de archivos de logs.
62 Cada archivo de log puede ser tratado diariamente, semanalmente,
63 mensualmente o cuanto crezca demasiado.
65 %description -l fr.UTF-8
66 Logrotate est conçu pour faciliter l'administration de systèmes qui
67 générent un grand nombre de fichiers de \"log\". Il permet le
68 roulement, la suppréssion la compression et l'envoi automatiques de
69 ces fichiers. Chaque fichier de \"log\" peut être pris en charge de
70 manière quotidienne, hebdomadaire, mensuelle, ou quand il devient trop
73 %description -l pl.UTF-8
74 Logrotate jest przeznaczony do łatwej administracji plikami logów.
75 Program ten pozwala na automatyczną kompresję logów. Może kontrolować
76 logi raz dziennie, raz na miesiąc, raz na tydzień lub wtedy kiedy
77 pliki z logami systemowymi są już duże.
79 %description -l pt_BR.UTF-8
80 Logrotate foi projetado para facilitar a administração de sistemas que
81 geram grande número de arquivos de log. Permite automatização na
82 rotação, compressão, remoção e envio de mail de arquivos de logs. Cada
83 arquivo de log pode ser tratado diariamente, semanalmente, mensalmente
84 ou quanto crescer demais.
86 %description -l ru.UTF-8
87 Logrotate предназначен для облегчения администрирования системы,
88 которая генерирует большое количество файлов с логами. Он позволяет
89 автоматически ротировать, компрессировать, удалять и посылать файлы с
90 логами по e-mail. Каждый лог может обрабатываться ежедневно,
91 еженедельно, ежемесячно или по достижении определенного размера.
93 %description -l tr.UTF-8
94 logrotate çok fazla sayıda günlük dosyası üreten sistemlerin
95 yönetimini kolaylaştırmak için tasarlanmıştır. Kayıt dosyalarının
96 otomatik olarak yönlendirilmesini, sıkıştırılmasını, silinmesinı ve
97 mektup olarak yollanmasını sağlar. Her dosya günlük, haftalık, aylık
98 olarak ya da çok büyük boyutlara ulaştığında işlenebilir.
100 %description -l uk.UTF-8
101 Logrotate призначений для полегшення адміністрування системи, яка
102 генерує велику кількість файлів з логами. Він дозволяє автоматично
103 ротувати, компресувати, видаляти та посилати поштою лог-файли. Кожен
104 лог може оброблятися щоденно, щотижня, щомісяця або по досягненні
115 RPM_OPT_FLAGS="%{rpmcflags}" \
116 WITH_SELINUX=%{?with_selinux:yes}%{!?with_selinux:no} \
117 STATEFILE="%{statdir}/logrotate.status"
120 rm -rf $RPM_BUILD_ROOT
121 install -d $RPM_BUILD_ROOT/etc/{cron.daily,logrotate.d,sysconfig} \
122 $RPM_BUILD_ROOT{%{_mandir},%{statdir},/var/log/archive}
125 BINDIR=$RPM_BUILD_ROOT%{_sbindir} \
126 MANDIR=$RPM_BUILD_ROOT%{_mandir}
128 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
129 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/logrotate
130 install examples/logrotate.cron $RPM_BUILD_ROOT/etc/cron.daily/logrotate
131 > $RPM_BUILD_ROOT%{statdir}/logrotate.status
132 > $RPM_BUILD_ROOT/var/log/archiv
135 rm -rf $RPM_BUILD_ROOT
138 # change /var/log/archiv to /var/log/archive
139 if [ ! -L /var/log/archiv ]; then
140 if [ -d /var/log/archiv ]; then
141 if [ -d /var/log/archive ]; then
142 if [ ! -L /var/log/archive ]; then
143 mv /var/log/archiv/* /var/log/archive
144 rmdir /var/log/archiv 2>/dev/null || mv -v /var/log/archiv{,.rpmsave}
146 mv -v /var/log/archive{,.rpmsave}
147 mv /var/log/archiv /var/log/archive
150 mv /var/log/archiv /var/log/archive
154 # always have archiv symlink (until all packages from Ac use new dir)
155 ln -s archive /var/log/archiv
160 if [ -f /var/lib/logrotate.status ]; then
161 mv -f /var/lib/logrotate.status %{statdir}/logrotate.status
163 touch %{statdir}/logrotate.status
164 chmod 000 %{statdir}/logrotate.status
165 chown root:root %{statdir}/logrotate.status
166 chmod 640 %{statdir}/logrotate.status
170 %defattr(644,root,root,755)
172 %attr(755,root,root) %{_sbindir}/logrotate
173 %attr(750,root,root) /etc/cron.daily/logrotate
174 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
175 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
176 %attr(640,root,root) %ghost %{statdir}/logrotate.status
177 %attr(750,root,logs) %dir /var/log/archive
178 %ghost /var/log/archiv
179 %{_mandir}/man8/logrotate.8*