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: 431e135abb7f3fe19de4c6a65bb66823
27 Source2: %{name}.sysconfig
28 Patch0: %{name}-man.patch
29 Patch1: %{name}-cron.patch
30 URL: https://fedorahosted.org/logrotate/
31 %{?with_selinux:BuildRequires: libselinux-devel}
32 BuildRequires: popt-devel >= 1.3
37 Requires: setup >= 2.4.6
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define statdir /var/lib/misc
43 The logrotate utility is designed to simplify the administration of
44 log files on a system which generates a lot of log files. Logrotate
45 allows for the automatic rotation compression, removal and mailing of
46 log files. Logrotate can be set to handle a log file daily, weekly,
47 monthly or when the log file gets to a certain size. Normally,
48 logrotate runs as a daily cron job.
50 %description -l de.UTF-8
51 Logrotate vereinfacht die Verwaltung von Systemen, die sehr viele
52 Log-Dateien erzeugen, indem es das automatische Rotieren,
53 Komprimieren, Entfernen, und Senden von Log-Dateien ermöglicht. Jede
54 Log-Datei kann täglich, wöchentlich oder monatlich verarbeitet werden,
55 wenn sie zu groß wird.
57 %description -l es.UTF-8
58 Logrotate fue proyectado para facilitar la administración de sistemas
59 que generan gran número de archivos de log. Permite automatización en
60 la rotación, compresión, remoción y envío de mail de archivos de logs.
61 Cada archivo de log puede ser tratado diariamente, semanalmente,
62 mensualmente o cuanto crezca demasiado.
64 %description -l fr.UTF-8
65 Logrotate est conçu pour faciliter l'administration de systèmes qui
66 générent un grand nombre de fichiers de \"log\". Il permet le
67 roulement, la suppréssion la compression et l'envoi automatiques de
68 ces fichiers. Chaque fichier de \"log\" peut être pris en charge de
69 manière quotidienne, hebdomadaire, mensuelle, ou quand il devient trop
72 %description -l pl.UTF-8
73 Logrotate jest przeznaczony do łatwej administracji plikami logów.
74 Program ten pozwala na automatyczną kompresję logów. Może kontrolować
75 logi raz dziennie, raz na miesiąc, raz na tydzień lub wtedy kiedy
76 pliki z logami systemowymi są już duże.
78 %description -l pt_BR.UTF-8
79 Logrotate foi projetado para facilitar a administração de sistemas que
80 geram grande número de arquivos de log. Permite automatização na
81 rotação, compressão, remoção e envio de mail de arquivos de logs. Cada
82 arquivo de log pode ser tratado diariamente, semanalmente, mensalmente
83 ou quanto crescer demais.
85 %description -l ru.UTF-8
86 Logrotate предназначен для облегчения администрирования системы,
87 которая генерирует большое количество файлов с логами. Он позволяет
88 автоматически ротировать, компрессировать, удалять и посылать файлы с
89 логами по e-mail. Каждый лог может обрабатываться ежедневно,
90 еженедельно, ежемесячно или по достижении определенного размера.
92 %description -l tr.UTF-8
93 logrotate çok fazla sayıda günlük dosyası üreten sistemlerin
94 yönetimini kolaylaştırmak için tasarlanmıştır. Kayıt dosyalarının
95 otomatik olarak yönlendirilmesini, sıkıştırılmasını, silinmesinı ve
96 mektup olarak yollanmasını sağlar. Her dosya günlük, haftalık, aylık
97 olarak ya da çok büyük boyutlara ulaştığında işlenebilir.
99 %description -l uk.UTF-8
100 Logrotate призначений для полегшення адміністрування системи, яка
101 генерує велику кількість файлів з логами. Він дозволяє автоматично
102 ротувати, компресувати, видаляти та посилати поштою лог-файли. Кожен
103 лог може оброблятися щоденно, щотижня, щомісяця або по досягненні
114 RPM_OPT_FLAGS="%{rpmcflags}" \
115 WITH_SELINUX=%{?with_selinux:yes}%{!?with_selinux:no} \
116 STATEFILE="%{statdir}/logrotate.status"
119 rm -rf $RPM_BUILD_ROOT
120 install -d $RPM_BUILD_ROOT/etc/{cron.daily,logrotate.d,sysconfig} \
121 $RPM_BUILD_ROOT{%{_mandir},%{statdir},/var/log/archive}
124 BINDIR=$RPM_BUILD_ROOT%{_sbindir} \
125 MANDIR=$RPM_BUILD_ROOT%{_mandir}
127 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.conf
128 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/logrotate
129 install examples/logrotate.cron $RPM_BUILD_ROOT/etc/cron.daily/logrotate
130 > $RPM_BUILD_ROOT%{statdir}/logrotate.status
131 > $RPM_BUILD_ROOT/var/log/archiv
134 rm -rf $RPM_BUILD_ROOT
137 # change /var/log/archiv to /var/log/archive
138 if [ ! -L /var/log/archiv ]; then
139 if [ -d /var/log/archiv ]; then
140 if [ -d /var/log/archive ]; then
141 if [ ! -L /var/log/archive ]; then
142 mv /var/log/archiv/* /var/log/archive
143 rmdir /var/log/archiv 2>/dev/null || mv -v /var/log/archiv{,.rpmsave}
145 mv -v /var/log/archive{,.rpmsave}
146 mv /var/log/archiv /var/log/archive
149 mv /var/log/archiv /var/log/archive
153 # always have archiv symlink (until all packages from Ac use new dir)
154 ln -s archive /var/log/archiv
159 if [ -f /var/lib/logrotate.status ]; then
160 mv -f /var/lib/logrotate.status %{statdir}/logrotate.status
162 touch %{statdir}/logrotate.status
163 chmod 000 %{statdir}/logrotate.status
164 chown root:root %{statdir}/logrotate.status
165 chmod 640 %{statdir}/logrotate.status
169 %defattr(644,root,root,755)
171 %attr(755,root,root) %{_sbindir}/logrotate
172 %attr(750,root,root) %dir /etc/logrotate.d
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