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